1 ; RUN: not opt -verify < %s 2>&1 | FileCheck %s
7 declare void @noreturn_func()
9 ; Operand bundles uses are like regular uses, and need to be dominated
12 define void @f0(i32* %ptr) {
13 ; CHECK: Instruction does not dominate all uses!
14 ; CHECK-NEXT: %x = add i32 42, 1
15 ; CHECK-NEXT: call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
18 %l = load i32, i32* %ptr
19 call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ]
24 define void @f1(i32* %ptr) personality i8 3 {
25 ; CHECK: Instruction does not dominate all uses!
26 ; CHECK-NEXT: %x = add i32 42, 1
27 ; CHECK-NEXT: invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
30 %l = load i32, i32* %ptr
31 invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ] to label %normal unwind label %exception
34 %cleanup = landingpad i8 cleanup
42 define void @f_deopt(i32* %ptr) {
43 ; CHECK: Multiple deopt operand bundles
44 ; CHECK-NEXT: call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.000000e+00, i64 100, i32 %l) ]
45 ; CHECK-NOT: call void @g() [ "deopt"(i32 42, i64 120, i32 %x) ]
48 %l = load i32, i32* %ptr
49 call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.0, i64 100, i32 %l) ]
50 call void @g() [ "deopt"(i32 42, i64 120) ] ;; The verifier should not complain about this one
55 define void @f_gc_transition(i32* %ptr) {
56 ; CHECK: Multiple gc-transition operand bundles
57 ; CHECK-NEXT: call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.000000e+00, i64 100, i32 %l) ]
58 ; CHECK-NOT: call void @g() [ "gc-transition"(i32 42, i64 120, i32 %x) ]
61 %l = load i32, i32* %ptr
62 call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.0, i64 100, i32 %l) ]
63 call void @g() [ "gc-transition"(i32 42, i64 120) ] ;; The verifier should not complain about this one
68 define void @f_clang_arc_attachedcall() {
69 ; CHECK: Multiple "clang.arc.attachedcall" operand bundles
70 ; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
71 ; CHECK-NEXT: must call a function returning a pointer
72 ; CHECK-NEXT: call i8 @foo1() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
73 ; CHECK-NEXT: or a non-returning function
74 ; CHECK-NEXT: call void @g() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
75 ; CHECK-NEXT: can take either no arguments
76 ; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* null) ]
77 ; CHECK-NEXT: can take either no arguments
78 ; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i64 0) ]
79 ; CHECK-NEXT: invalid function argument
80 ; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8 ()* @foo1) ]
81 ; CHECK-NEXT: invalid function argument
82 ; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(void (i1)* @llvm.assume) ]
84 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
85 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
86 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ]
87 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_unsafeClaimAutoreleasedReturnValue) ]
88 call %0* @foo0() [ "clang.arc.attachedcall"() ]
89 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
90 call i8 @foo1() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
91 call void @noreturn_func() #0 [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
92 call void @g() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
93 call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* null) ]
94 call %0* @foo0() [ "clang.arc.attachedcall"(i64 0) ]
95 call %0* @foo0() [ "clang.arc.attachedcall"(i8 ()* @foo1) ]
96 call %0* @foo0() [ "clang.arc.attachedcall"(void (i1)* @llvm.assume) ]
100 declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
101 declare i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8*)
102 declare i8* @objc_retainAutoreleasedReturnValue(i8*)
103 declare i8* @objc_unsafeClaimAutoreleasedReturnValue(i8*)
104 declare void @llvm.assume(i1)
106 attributes #0 = { noreturn }