1 ; RUN: opt %s -safepoint-ir-verifier-print-only -verify-safepoint-ir -S 2>&1 | FileCheck %s
3 ; CHECK: Illegal use of unrelocated value found!
4 ; CHECK-NEXT: Def: %base_phi4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
5 ; CHECK-NEXT: Use: %safepoint_token = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) %base_phi1, ptr addrspace(1) %base_phi4, ptr addrspace(1) %relocated4, ptr addrspace(1) %relocated7) ]
8 %jObject = type { [8 x i8] }
10 declare ptr addrspace(1) @generate_obj1() #1
12 declare ptr addrspace(1) @generate_obj2() #1
14 declare ptr addrspace(1) @generate_obj3() #1
16 ; Function Attrs: nounwind
17 define void @test(ptr addrspace(1), ptr addrspace(1), i32, i1 %new_arg) #3 gc "statepoint-example" {
19 %result608 = call ptr addrspace(1) @generate_obj3()
20 br label %bci_37-aload
22 bci_37-aload: ; preds = %not_zero179, %bci_0
23 %base_phi = phi ptr addrspace(1) [ %base_phi1.relocated, %not_zero179 ], [ %result608, %bci_0 ], !is_base_value !0
24 %base_phi2 = phi ptr addrspace(1) [ %base_phi3, %not_zero179 ], [ %result608, %bci_0 ], !is_base_value !0
25 %relocated8 = phi ptr addrspace(1) [ %relocated7.relocated, %not_zero179 ], [ %result608, %bci_0 ]
26 %tmp3 = getelementptr inbounds %jObject, ptr addrspace(1) %relocated8, i64 0, i32 0, i64 32
27 br i1 %new_arg, label %not_zero179, label %not_zero146
29 not_zero146: ; preds = %bci_37-aload
30 %addr98.relocated = call ptr addrspace(1) @generate_obj2() #1
31 %obj609.relocated = call ptr addrspace(1) @generate_obj1() #1
34 not_zero179: ; preds = %not_zero146, %bci_37-aload
35 %base_phi1 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %base_phi, %bci_37-aload ], !is_base_value !0
36 %base_phi3 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
37 %relocated7 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %relocated8, %bci_37-aload ]
38 %base_phi4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
39 %relocated4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %tmp3, %bci_37-aload ]
40 %safepoint_token = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %base_phi1, ptr addrspace(1) %base_phi4, ptr addrspace(1) %relocated4, ptr addrspace(1) %relocated7)]
41 %tmp4 = call i32 @llvm.experimental.gc.result.i32(token %safepoint_token)
42 %base_phi1.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0)
43 %base_phi4.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 1, i32 1)
44 %relocated4.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 1, i32 2)
45 %relocated7.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 3)
46 br label %bci_37-aload
49 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
51 ; Function Attrs: nounwind
52 declare i32 @llvm.experimental.gc.result.i32(token) #4
54 ; Function Attrs: nounwind
55 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #4
57 ; Function Attrs: nounwind
59 attributes #0 = { noinline nounwind "gc-leaf-function"="true" }
60 attributes #1 = { "gc-leaf-function"="true" }
61 attributes #2 = { nounwind readonly "gc-leaf-function"="true" }
62 attributes #3 = { nounwind }
63 attributes #4 = { nounwind }