1; RUN: llvm-as < %s | llvm-dis | FileCheck %s 2 3declare void @callee0() 4declare void @callee1(i32,i32) 5 6define void @f0(i32* %ptr) { 7; CHECK-LABEL: @f0( 8 entry: 9 %l = load i32, i32* %ptr 10 %x = add i32 42, 1 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) ] 13 ret void 14} 15 16define void @f1(i32* %ptr) { 17; CHECK-LABEL: @f1( 18 entry: 19 %l = load i32, i32* %ptr 20 %x = add i32 42, 1 21 22 call void @callee0() 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) ] 28 ret void 29} 30 31define void @f2(i32* %ptr) { 32; CHECK-LABEL: @f2( 33 entry: 34 call void @callee0() [ "foo"() ] 35; CHECK: call void @callee0() [ "foo"() ] 36 ret void 37} 38 39define void @f3(i32* %ptr) { 40; CHECK-LABEL: @f3( 41 entry: 42 %l = load i32, i32* %ptr 43 %x = add i32 42, 1 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) ] 46 ret void 47} 48 49define void @f4(i32* %ptr) { 50; CHECK-LABEL: @f4( 51 entry: 52 %l = load i32, i32* %ptr 53 %x = add i32 42, 1 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) ] 56 ret void 57} 58 59; Invoke versions of the above tests: 60 61 62define void @g0(i32* %ptr) personality i8 3 { 63; CHECK-LABEL: @g0( 64 entry: 65 %l = load i32, i32* %ptr 66 %x = add i32 42, 1 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) ] 69 70exception: 71 %cleanup = landingpad i8 cleanup 72 br label %normal 73normal: 74 ret void 75} 76 77define void @g1(i32* %ptr) personality i8 3 { 78; CHECK-LABEL: @g1( 79 entry: 80 %l = load i32, i32* %ptr 81 %x = add i32 42, 1 82 83 invoke void @callee0() to label %normal unwind label %exception 84; CHECK: invoke void @callee0(){{$}} 85 86exception: 87 %cleanup = landingpad i8 cleanup 88 br label %normal 89 90normal: 91 invoke void @callee0() [ "foo"() ] to label %normal1 unwind label %exception1 92; CHECK: invoke void @callee0() [ "foo"() ] 93 94exception1: 95 %cleanup1 = landingpad i8 cleanup 96 br label %normal1 97 98normal1: 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) ] 101 102exception2: 103 %cleanup2 = landingpad i8 cleanup 104 br label %normal2 105 106normal2: 107 ret void 108} 109 110define void @g2(i32* %ptr) personality i8 3 { 111; CHECK-LABEL: @g2( 112 entry: 113 invoke void @callee0() [ "foo"() ] to label %normal unwind label %exception 114; CHECK: invoke void @callee0() [ "foo"() ] 115 116exception: 117 %cleanup = landingpad i8 cleanup 118 br label %normal 119normal: 120 ret void 121} 122 123define void @g3(i32* %ptr) personality i8 3 { 124; CHECK-LABEL: @g3( 125 entry: 126 %l = load i32, i32* %ptr 127 %x = add i32 42, 1 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) ] 130 131exception: 132 %cleanup = landingpad i8 cleanup 133 br label %normal 134normal: 135 ret void 136} 137 138define void @g4(i32* %ptr) personality i8 3 { 139; CHECK-LABEL: @g4( 140 entry: 141 %l = load i32, i32* %ptr 142 %x = add i32 42, 1 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) ] 146 147exception: 148 %cleanup = landingpad i8 cleanup 149 br label %normal 150normal: 151 ret void 152} 153