miscInstructions.3.2.ll 5.1 KB

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