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