2016-01-29 08:28:57 +08:00
|
|
|
; RUN: opt < %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
2015-12-23 00:50:44 +08:00
|
|
|
|
2016-05-27 21:13:59 +08:00
|
|
|
; CHECK: derived %select base null
|
2015-12-23 00:50:44 +08:00
|
|
|
|
|
|
|
@global = external addrspace(1) global i8
|
|
|
|
|
|
|
|
define i8 @test(i1 %cond) gc "statepoint-example" {
|
|
|
|
%derived1 = getelementptr i8, i8 addrspace(1)* @global, i64 1
|
|
|
|
%derived2 = getelementptr i8, i8 addrspace(1)* @global, i64 2
|
|
|
|
%select = select i1 %cond, i8 addrspace(1)* %derived1, i8 addrspace(1)* %derived2
|
2016-01-29 08:28:57 +08:00
|
|
|
call void @extern()
|
2015-12-23 00:50:44 +08:00
|
|
|
; CHECK-NOT: relocate
|
|
|
|
; CHECK: %load = load i8, i8 addrspace(1)* %select
|
|
|
|
%load = load i8, i8 addrspace(1)* %select
|
|
|
|
ret i8 %load
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @extern() gc "statepoint-example"
|
|
|
|
|
2015-12-26 19:40:48 +08:00
|
|
|
declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
|