1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3 declare void @callee0()
4 declare void @callee1(i32,i32)
6 define void @f0(i32* %ptr) {
9 %l = load i32, i32* %ptr
11 call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
12 ; CHECK: call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
16 define void @f1(i32* %ptr) {
19 %l = load i32, i32* %ptr
23 call void @callee0() [ "foo"() ]
24 call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
25 ; CHECK: @callee0(){{$}}
26 ; CHECK-NEXT: call void @callee0() [ "foo"() ]
27 ; CHECK-NEXT: call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
31 define void @f2(i32* %ptr) {
34 call void @callee0() [ "foo"() ]
35 ; CHECK: call void @callee0() [ "foo"() ]
39 define void @f3(i32* %ptr) {
42 %l = load i32, i32* %ptr
44 call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
45 ; CHECK: call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
49 define void @f4(i32* %ptr) {
52 %l = load i32, i32* %ptr
54 call void @callee1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
55 ; CHECK: call void @callee1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
59 ; Invoke versions of the above tests:
62 define void @g0(i32* %ptr) personality i8 3 {
65 %l = load i32, i32* %ptr
67 invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ] to label %normal unwind label %exception
68 ; CHECK: invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
71 %cleanup = landingpad i8 cleanup
77 define void @g1(i32* %ptr) personality i8 3 {
80 %l = load i32, i32* %ptr
83 invoke void @callee0() to label %normal unwind label %exception
84 ; CHECK: invoke void @callee0(){{$}}
87 %cleanup = landingpad i8 cleanup
91 invoke void @callee0() [ "foo"() ] to label %normal1 unwind label %exception1
92 ; CHECK: invoke void @callee0() [ "foo"() ]
95 %cleanup1 = landingpad i8 cleanup
99 invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal2 unwind label %exception2
100 ; CHECK: invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
103 %cleanup2 = landingpad i8 cleanup
110 define void @g2(i32* %ptr) personality i8 3 {
113 invoke void @callee0() [ "foo"() ] to label %normal unwind label %exception
114 ; CHECK: invoke void @callee0() [ "foo"() ]
117 %cleanup = landingpad i8 cleanup
123 define void @g3(i32* %ptr) personality i8 3 {
126 %l = load i32, i32* %ptr
128 invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ] to label %normal unwind label %exception
129 ; CHECK: invoke void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
132 %cleanup = landingpad i8 cleanup
138 define void @g4(i32* %ptr) personality i8 3 {
141 %l = load i32, i32* %ptr
143 invoke void @callee1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
144 to label %normal unwind label %exception
145 ; CHECK: invoke void @callee1(i32 10, i32 %x) [ "foo"(i32 42, i64 100, i32 %x), "foo"(i32 42, float 0.000000e+00, i32 %l) ]
148 %cleanup = landingpad i8 cleanup