Sanjoy Das | f70eb72 | 2015-09-24 23:34:52 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | llvm-dis | FileCheck %s |
| 2 | |
| 3 | declare void @callee0() |
| 4 | declare void @callee1(i32,i32) |
| 5 | |
| 6 | define 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 | |
| 16 | define 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 | |
| 31 | define 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 | |
| 39 | define 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 | |
| 49 | define 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 | |
| 62 | define 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 | |
| 70 | exception: |
| 71 | %cleanup = landingpad i8 cleanup |
| 72 | br label %normal |
| 73 | normal: |
| 74 | ret void |
| 75 | } |
| 76 | |
| 77 | define 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 | |
| 86 | exception: |
| 87 | %cleanup = landingpad i8 cleanup |
| 88 | br label %normal |
| 89 | |
| 90 | normal: |
| 91 | invoke void @callee0() [ "foo"() ] to label %normal1 unwind label %exception1 |
| 92 | ; CHECK: invoke void @callee0() [ "foo"() ] |
| 93 | |
| 94 | exception1: |
| 95 | %cleanup1 = landingpad i8 cleanup |
| 96 | br label %normal1 |
| 97 | |
| 98 | normal1: |
| 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 | |
| 102 | exception2: |
| 103 | %cleanup2 = landingpad i8 cleanup |
| 104 | br label %normal2 |
| 105 | |
| 106 | normal2: |
| 107 | ret void |
| 108 | } |
| 109 | |
| 110 | define 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 | |
| 116 | exception: |
| 117 | %cleanup = landingpad i8 cleanup |
| 118 | br label %normal |
| 119 | normal: |
| 120 | ret void |
| 121 | } |
| 122 | |
| 123 | define 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 | |
| 131 | exception: |
| 132 | %cleanup = landingpad i8 cleanup |
| 133 | br label %normal |
| 134 | normal: |
| 135 | ret void |
| 136 | } |
| 137 | |
| 138 | define 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 | |
| 147 | exception: |
| 148 | %cleanup = landingpad i8 cleanup |
| 149 | br label %normal |
| 150 | normal: |
| 151 | ret void |
| 152 | } |