brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.1 KiB · a1fb366 Raw
193 lines · plain
1; RUN:  llvm-dis < %s.bc| FileCheck %s2 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 of5; older bitcode files.6 7@X = global i8 18@_ZTIi = global i8* @X 9@_ZTId = global i8* @X 10 11define i32 @__gxx_personality_v0(...){12entry:13  ret i32 014}15 16; CHECK-LABEL: define void @landingpadInstr117; CHECK-SAME: personality ptr @__gxx_personality_v018define void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){19entry:20; CHECK: %res = landingpad { ptr, i32 }21  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0 22; CHECK: catch ptr @_ZTIi23  catch i8** @_ZTIi24  ret void25}26 27; CHECK-LABEL: define void @landingpadInstr228; CHECK-SAME: personality ptr @__gxx_personality_v029define void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){30entry:31; CHECK: %res = landingpad { ptr, i32 }32  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v033; CHECK: cleanup34  cleanup35  ret void36}37 38; CHECK-LABEL: define void @landingpadInstr339; CHECK-SAME: personality ptr @__gxx_personality_v040define void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){41entry:42; CHECK: %res = landingpad { ptr, i32 }43  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v044; CHECK: catch ptr @_ZTIi45  catch i8** @_ZTIi46; CHECK: filter [1 x ptr] [ptr @_ZTId]47  filter [1 x i8**] [i8** @_ZTId]48  ret void49}50 51define void @phiInstr(){52LoopHeader: 53  %x = add i32 0, 054  br label %Loop55Loop:56; CHECK:  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]57  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]58  %nextindvar = add i32 %indvar, 159  br label %Loop60  ret void61}62 63define void @selectInstr(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){64entry:65; CHECK: %res1 = select i1 %cond1, i8 1, i8 0 66  %res1 = select i1 %cond1, i8 1, i8 067; CHECK-NEXT: %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x268  %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x269 70  ret void71}72 73define void @icmp(i32 %x1, i32 %x2, i32* %ptr1, i32* %ptr2, <2 x i32> %vec1, <2 x i32> %vec2){74entry:75; CHECK: %res1 = icmp eq i32 %x1, %x276  %res1 = icmp eq i32 %x1, %x277  78; CHECK-NEXT: %res2 = icmp ne i32 %x1, %x279  %res2 = icmp ne i32 %x1, %x280  81; CHECK-NEXT: %res3 = icmp ugt i32 %x1, %x282  %res3 = icmp ugt i32 %x1, %x283  84; CHECK-NEXT: %res4 = icmp uge i32 %x1, %x285  %res4 = icmp uge i32 %x1, %x286  87; CHECK-NEXT: %res5 = icmp ult i32 %x1, %x288  %res5 = icmp ult i32 %x1, %x289  90; CHECK-NEXT: %res6 = icmp ule i32 %x1, %x291  %res6 = icmp ule i32 %x1, %x292  93; CHECK-NEXT: %res7 = icmp sgt i32 %x1, %x294  %res7 = icmp sgt i32 %x1, %x295  96; CHECK-NEXT: %res8 = icmp sge i32 %x1, %x297  %res8 = icmp sge i32 %x1, %x298  99; CHECK-NEXT: %res9 = icmp slt i32 %x1, %x2100  %res9 = icmp slt i32 %x1, %x2101  102; CHECK-NEXT: %res10 = icmp sle i32 %x1, %x2103  %res10 = icmp sle i32 %x1, %x2104  105; CHECK-NEXT: %res11 = icmp eq ptr %ptr1, %ptr2106  %res11 = icmp eq i32* %ptr1, %ptr2107  108; CHECK-NEXT: %res12 = icmp eq <2 x i32> %vec1, %vec2109  %res12 = icmp eq <2 x i32> %vec1, %vec2110  111  ret void112}113 114 115define void @fcmp(float %x1, float %x2, <2 x float> %vec1, <2 x float> %vec2){116entry:117; CHECK: %res1 = fcmp oeq float %x1, %x2118  %res1 = fcmp oeq float %x1, %x2119  120; CHECK-NEXT: %res2 = fcmp one float %x1, %x2121  %res2 = fcmp one float %x1, %x2122  123; CHECK-NEXT: %res3 = fcmp ugt float %x1, %x2124  %res3 = fcmp ugt float %x1, %x2125  126; CHECK-NEXT: %res4 = fcmp uge float %x1, %x2127  %res4 = fcmp uge float %x1, %x2128  129; CHECK-NEXT: %res5 = fcmp ult float %x1, %x2130  %res5 = fcmp ult float %x1, %x2131  132; CHECK-NEXT: %res6 = fcmp ule float %x1, %x2133  %res6 = fcmp ule float %x1, %x2134  135; CHECK-NEXT: %res7 = fcmp ogt float %x1, %x2136  %res7 = fcmp ogt float %x1, %x2137  138; CHECK-NEXT: %res8 = fcmp oge float %x1, %x2139  %res8 = fcmp oge float %x1, %x2140  141; CHECK-NEXT: %res9 = fcmp olt float %x1, %x2142  %res9 = fcmp olt float %x1, %x2143  144; CHECK-NEXT: %res10 = fcmp ole float %x1, %x2145  %res10 = fcmp ole float %x1, %x2146  147; CHECK-NEXT: %res11 = fcmp ord float %x1, %x2148  %res11 = fcmp ord float %x1, %x2149  150; CHECK-NEXT: %res12 = fcmp ueq float %x1, %x2151  %res12 = fcmp ueq float %x1, %x2152  153; CHECK-NEXT: %res13 = fcmp une float %x1, %x2154  %res13 = fcmp une float %x1, %x2155  156; CHECK-NEXT: %res14 = fcmp uno float %x1, %x2157  %res14 = fcmp uno float %x1, %x2158  159; CHECK-NEXT: %res15 = fcmp true float %x1, %x2160  %res15 = fcmp true float %x1, %x2161  162; CHECK-NEXT: %res16 = fcmp false float %x1, %x2163  %res16 = fcmp false float %x1, %x2164  165; CHECK-NEXT: %res17 = fcmp oeq <2 x float> %vec1, %vec2166  %res17 = fcmp oeq <2 x float> %vec1, %vec2167  168  ret void169}170 171declare i32 @printf(i8* noalias nocapture, ...)172 173define void @call(i32 %x, i8* %msg ){174entry:175 176; CHECK: %res1 = call i32 @test(i32 %x)177  %res1 = call i32 @test(i32 %x)178  179; CHECK-NEXT: %res2 = tail call i32 @test(i32 %x)180  %res2 = tail call i32 @test(i32 %x)181  182; CHECK-NEXT: %res3 = call i32 (ptr, ...) @printf(ptr %msg, i32 12, i8 42)183  %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42)184  185  ret void186}187 188define i32 @test(i32 %x){189entry:190 191  ret i32 %x192}193