Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 1 | ; RUN: llvm-dis < %s.bc| FileCheck %s |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 2 | |
| 3 | ; miscInstructions.3.2.ll.bc was generated by passing this file to llvm-as-3.2. |
| 4 | ; The test checks that LLVM does not misread miscellaneous instructions of |
| 5 | ; older bitcode files. |
| 6 | |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 7 | @X = global i8 1 |
| 8 | @_ZTIi = global i8* @X |
| 9 | @_ZTId = global i8* @X |
| 10 | |
| 11 | define i32 @__gxx_personality_v0(...){ |
| 12 | entry: |
| 13 | ret i32 0 |
| 14 | } |
| 15 | |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 16 | ; CHECK-LABEL: define void @landingpadInstr1 |
| 17 | ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 18 | define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ |
| 19 | entry: |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 20 | ; CHECK: %res = landingpad { i8*, i32 } |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 21 | %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 |
| 22 | ; CHECK: catch i8** @_ZTIi |
| 23 | catch i8** @_ZTIi |
| 24 | ret void |
| 25 | } |
| 26 | |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 27 | ; CHECK-LABEL: define void @landingpadInstr2 |
| 28 | ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 29 | define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ |
| 30 | entry: |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 31 | ; CHECK: %res = landingpad { i8*, i32 } |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 32 | %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 |
| 33 | ; CHECK: cleanup |
| 34 | cleanup |
| 35 | ret void |
| 36 | } |
| 37 | |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 38 | ; CHECK-LABEL: define void @landingpadInstr3 |
| 39 | ; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 40 | define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ |
| 41 | entry: |
David Majnemer | cc714e2 | 2015-06-17 20:52:32 +0000 | [diff] [blame] | 42 | ; CHECK: %res = landingpad { i8*, i32 } |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 43 | %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 |
| 44 | ; CHECK: catch i8** @_ZTIi |
| 45 | catch i8** @_ZTIi |
| 46 | ; CHECK: filter [1 x i8**] [i8** @_ZTId] |
| 47 | filter [1 x i8**] [i8** @_ZTId] |
| 48 | ret void |
| 49 | } |
| 50 | |
| 51 | define void @phiInstr(){ |
| 52 | LoopHeader: |
| 53 | %x = add i32 0, 0 |
| 54 | br label %Loop |
| 55 | Loop: |
| 56 | ; CHECK: %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ] |
| 57 | %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ] |
| 58 | %nextindvar = add i32 %indvar, 1 |
| 59 | br label %Loop |
| 60 | ret void |
| 61 | } |
| 62 | |
| 63 | define void @selectInstr(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){ |
| 64 | entry: |
| 65 | ; CHECK: %res1 = select i1 %cond1, i8 1, i8 0 |
| 66 | %res1 = select i1 %cond1, i8 1, i8 0 |
| 67 | ; CHECK-NEXT: %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2 |
| 68 | %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2 |
| 69 | |
| 70 | ret void |
| 71 | } |
| 72 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 73 | define void @icmp(i32 %x1, i32 %x2, i32* %ptr1, i32* %ptr2, <2 x i32> %vec1, <2 x i32> %vec2){ |
| 74 | entry: |
| 75 | ; CHECK: %res1 = icmp eq i32 %x1, %x2 |
| 76 | %res1 = icmp eq i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 77 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 78 | ; CHECK-NEXT: %res2 = icmp ne i32 %x1, %x2 |
| 79 | %res2 = icmp ne i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 80 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 81 | ; CHECK-NEXT: %res3 = icmp ugt i32 %x1, %x2 |
| 82 | %res3 = icmp ugt i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 83 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 84 | ; CHECK-NEXT: %res4 = icmp uge i32 %x1, %x2 |
| 85 | %res4 = icmp uge i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 86 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 87 | ; CHECK-NEXT: %res5 = icmp ult i32 %x1, %x2 |
| 88 | %res5 = icmp ult i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 89 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 90 | ; CHECK-NEXT: %res6 = icmp ule i32 %x1, %x2 |
| 91 | %res6 = icmp ule i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 92 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 93 | ; CHECK-NEXT: %res7 = icmp sgt i32 %x1, %x2 |
| 94 | %res7 = icmp sgt i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 95 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 96 | ; CHECK-NEXT: %res8 = icmp sge i32 %x1, %x2 |
| 97 | %res8 = icmp sge i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 98 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 99 | ; CHECK-NEXT: %res9 = icmp slt i32 %x1, %x2 |
| 100 | %res9 = icmp slt i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 101 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 102 | ; CHECK-NEXT: %res10 = icmp sle i32 %x1, %x2 |
| 103 | %res10 = icmp sle i32 %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 104 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 105 | ; CHECK-NEXT: %res11 = icmp eq i32* %ptr1, %ptr2 |
| 106 | %res11 = icmp eq i32* %ptr1, %ptr2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 107 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 108 | ; CHECK-NEXT: %res12 = icmp eq <2 x i32> %vec1, %vec2 |
| 109 | %res12 = icmp eq <2 x i32> %vec1, %vec2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 110 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 111 | ret void |
| 112 | } |
| 113 | |
| 114 | |
| 115 | define void @fcmp(float %x1, float %x2, <2 x float> %vec1, <2 x float> %vec2){ |
| 116 | entry: |
| 117 | ; CHECK: %res1 = fcmp oeq float %x1, %x2 |
| 118 | %res1 = fcmp oeq float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 119 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 120 | ; CHECK-NEXT: %res2 = fcmp one float %x1, %x2 |
| 121 | %res2 = fcmp one float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 122 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 123 | ; CHECK-NEXT: %res3 = fcmp ugt float %x1, %x2 |
| 124 | %res3 = fcmp ugt float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 125 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 126 | ; CHECK-NEXT: %res4 = fcmp uge float %x1, %x2 |
| 127 | %res4 = fcmp uge float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 128 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 129 | ; CHECK-NEXT: %res5 = fcmp ult float %x1, %x2 |
| 130 | %res5 = fcmp ult float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 131 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 132 | ; CHECK-NEXT: %res6 = fcmp ule float %x1, %x2 |
| 133 | %res6 = fcmp ule float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 134 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 135 | ; CHECK-NEXT: %res7 = fcmp ogt float %x1, %x2 |
| 136 | %res7 = fcmp ogt float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 137 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 138 | ; CHECK-NEXT: %res8 = fcmp oge float %x1, %x2 |
| 139 | %res8 = fcmp oge float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 140 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 141 | ; CHECK-NEXT: %res9 = fcmp olt float %x1, %x2 |
| 142 | %res9 = fcmp olt float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 143 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 144 | ; CHECK-NEXT: %res10 = fcmp ole float %x1, %x2 |
| 145 | %res10 = fcmp ole float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 146 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 147 | ; CHECK-NEXT: %res11 = fcmp ord float %x1, %x2 |
| 148 | %res11 = fcmp ord float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 149 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 150 | ; CHECK-NEXT: %res12 = fcmp ueq float %x1, %x2 |
| 151 | %res12 = fcmp ueq float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 152 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 153 | ; CHECK-NEXT: %res13 = fcmp une float %x1, %x2 |
| 154 | %res13 = fcmp une float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 155 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 156 | ; CHECK-NEXT: %res14 = fcmp uno float %x1, %x2 |
| 157 | %res14 = fcmp uno float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 158 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 159 | ; CHECK-NEXT: %res15 = fcmp true float %x1, %x2 |
| 160 | %res15 = fcmp true float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 161 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 162 | ; CHECK-NEXT: %res16 = fcmp false float %x1, %x2 |
| 163 | %res16 = fcmp false float %x1, %x2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 164 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 165 | ; CHECK-NEXT: %res17 = fcmp oeq <2 x float> %vec1, %vec2 |
| 166 | %res17 = fcmp oeq <2 x float> %vec1, %vec2 |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 167 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 168 | ret void |
| 169 | } |
| 170 | |
| 171 | declare i32 @printf(i8* noalias nocapture, ...) |
| 172 | |
| 173 | define void @call(i32 %x, i8* %msg ){ |
| 174 | entry: |
| 175 | |
| 176 | ; CHECK: %res1 = call i32 @test(i32 %x) |
| 177 | %res1 = call i32 @test(i32 %x) |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 178 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 179 | ; CHECK-NEXT: %res2 = tail call i32 @test(i32 %x) |
| 180 | %res2 = tail call i32 @test(i32 %x) |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 181 | |
David Blaikie | 32b845d | 2015-04-16 23:24:18 +0000 | [diff] [blame] | 182 | ; CHECK-NEXT: %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42) |
| 183 | %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42) |
Michael Kuperstein | 5f84303 | 2014-09-23 08:48:01 +0000 | [diff] [blame] | 184 | |
Duncan P. N. Exon Smith | 8dc3e30 | 2014-07-30 17:49:00 +0000 | [diff] [blame] | 185 | ret void |
| 186 | } |
| 187 | |
| 188 | define i32 @test(i32 %x){ |
| 189 | entry: |
| 190 | |
| 191 | ret i32 %x |
| 192 | } |