1 ; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s
3 define i8 addrspace(1)* @test.not.ok.0(i8 addrspace(1)* %arg) gc "statepoint-example" {
4 ; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.0
6 br i1 undef, label %left, label %right
9 %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
16 ; CHECK: Illegal use of unrelocated value found!
17 ; CHECK-NEXT: Def: i8 addrspace(1)* %arg
18 ; CHECK-NEXT: Use: %val = phi i8 addrspace(1)* [ %arg, %left ], [ %arg, %right ]
19 %val = phi i8 addrspace(1)* [ %arg, %left ], [ %arg, %right]
20 ret i8 addrspace(1)* %val
23 define i8 addrspace(1)* @test.not.ok.1(i8 addrspace(1)* %arg) gc "statepoint-example" {
24 ; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.1
26 br i1 undef, label %left, label %right
29 %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
36 ; CHECK: Illegal use of unrelocated value found!
37 ; CHECK-NEXT: Def: i8 addrspace(1)* %arg
38 ; CHECK-NEXT: Use: %val = phi i8 addrspace(1)* [ %arg, %left ], [ null, %right ]
39 %val = phi i8 addrspace(1)* [ %arg, %left ], [ null, %right]
40 ret i8 addrspace(1)* %val
43 define i8 addrspace(1)* @test.ok.0(i8 addrspace(1)* %arg) gc "statepoint-example" {
44 ; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.0
46 br i1 undef, label %left, label %right
49 %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
56 %val = phi i8 addrspace(1)* [ null, %left ], [ null, %right]
57 ret i8 addrspace(1)* %val
60 define i8 addrspace(1)* @test.ok.1(i8 addrspace(1)* %arg) gc "statepoint-example" {
61 ; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.1
63 br i1 undef, label %left, label %right
66 call void @not_statepoint()
73 %val = phi i8 addrspace(1)* [ %arg, %left ], [ %arg, %right]
74 ret i8 addrspace(1)* %val
77 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
78 declare void @not_statepoint()