1661e288aSMichael Kuperstein; RUN:  llvm-dis < %s.bc| FileCheck %s
2661e288aSMichael Kuperstein
3661e288aSMichael Kuperstein; miscInstructions.3.2.ll.bc was generated by passing this file to llvm-as-3.2.
4661e288aSMichael Kuperstein; The test checks that LLVM does not misread miscellaneous instructions of
5661e288aSMichael Kuperstein; older bitcode files.
6661e288aSMichael Kuperstein
7946b3b2eSMichael Kuperstein@X = global i8 1
8946b3b2eSMichael Kuperstein@_ZTIi = global i8* @X
9946b3b2eSMichael Kuperstein@_ZTId = global i8* @X
10946b3b2eSMichael Kuperstein
11946b3b2eSMichael Kupersteindefine i32 @__gxx_personality_v0(...){
12946b3b2eSMichael Kupersteinentry:
13946b3b2eSMichael Kuperstein  ret i32 0
14946b3b2eSMichael Kuperstein}
15946b3b2eSMichael Kuperstein
16*7fddeccbSDavid Majnemer; CHECK-LABEL: define void @landingpadInstr1
17*7fddeccbSDavid Majnemer; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
18946b3b2eSMichael Kupersteindefine void @landingpadInstr1(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
19946b3b2eSMichael Kupersteinentry:
20*7fddeccbSDavid Majnemer; CHECK: %res = landingpad { i8*, i32 }
21946b3b2eSMichael Kuperstein  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
22946b3b2eSMichael Kuperstein; CHECK: catch i8** @_ZTIi
23946b3b2eSMichael Kuperstein  catch i8** @_ZTIi
24946b3b2eSMichael Kuperstein  ret void
25946b3b2eSMichael Kuperstein}
26946b3b2eSMichael Kuperstein
27*7fddeccbSDavid Majnemer; CHECK-LABEL: define void @landingpadInstr2
28*7fddeccbSDavid Majnemer; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
29946b3b2eSMichael Kupersteindefine void @landingpadInstr2(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
30946b3b2eSMichael Kupersteinentry:
31*7fddeccbSDavid Majnemer; CHECK: %res = landingpad { i8*, i32 }
32946b3b2eSMichael Kuperstein  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
33946b3b2eSMichael Kuperstein; CHECK: cleanup
34946b3b2eSMichael Kuperstein  cleanup
35946b3b2eSMichael Kuperstein  ret void
36946b3b2eSMichael Kuperstein}
37946b3b2eSMichael Kuperstein
38*7fddeccbSDavid Majnemer; CHECK-LABEL: define void @landingpadInstr3
39*7fddeccbSDavid Majnemer; CHECK-SAME: personality i32 (...)* @__gxx_personality_v0
40946b3b2eSMichael Kupersteindefine void @landingpadInstr3(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
41946b3b2eSMichael Kupersteinentry:
42*7fddeccbSDavid Majnemer; CHECK: %res = landingpad { i8*, i32 }
43946b3b2eSMichael Kuperstein  %res = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0
44946b3b2eSMichael Kuperstein; CHECK: catch i8** @_ZTIi
45946b3b2eSMichael Kuperstein  catch i8** @_ZTIi
46946b3b2eSMichael Kuperstein; CHECK: filter [1 x i8**] [i8** @_ZTId]
47946b3b2eSMichael Kuperstein  filter [1 x i8**] [i8** @_ZTId]
48946b3b2eSMichael Kuperstein  ret void
49946b3b2eSMichael Kuperstein}
50946b3b2eSMichael Kuperstein
51946b3b2eSMichael Kupersteindefine void @phiInstr(){
52946b3b2eSMichael KupersteinLoopHeader:
53946b3b2eSMichael Kuperstein  %x = add i32 0, 0
54946b3b2eSMichael Kuperstein  br label %Loop
55946b3b2eSMichael KupersteinLoop:
56946b3b2eSMichael Kuperstein; CHECK:  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
57946b3b2eSMichael Kuperstein  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
58946b3b2eSMichael Kuperstein  %nextindvar = add i32 %indvar, 1
59946b3b2eSMichael Kuperstein  br label %Loop
60946b3b2eSMichael Kuperstein  ret void
61946b3b2eSMichael Kuperstein}
62946b3b2eSMichael Kuperstein
63946b3b2eSMichael Kupersteindefine void @selectInstr(i1 %cond1, <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2){
64946b3b2eSMichael Kupersteinentry:
65946b3b2eSMichael Kuperstein; CHECK: %res1 = select i1 %cond1, i8 1, i8 0
66946b3b2eSMichael Kuperstein  %res1 = select i1 %cond1, i8 1, i8 0
67946b3b2eSMichael Kuperstein; CHECK-NEXT: %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2
68946b3b2eSMichael Kuperstein  %res2 = select <2 x i1> %cond2, <2 x i8> %x1, <2 x i8> %x2
69946b3b2eSMichael Kuperstein
70946b3b2eSMichael Kuperstein  ret void
71946b3b2eSMichael Kuperstein}
72946b3b2eSMichael Kuperstein
73661e288aSMichael Kupersteindefine void @icmp(i32 %x1, i32 %x2, i32* %ptr1, i32* %ptr2, <2 x i32> %vec1, <2 x i32> %vec2){
74661e288aSMichael Kupersteinentry:
75661e288aSMichael Kuperstein; CHECK: %res1 = icmp eq i32 %x1, %x2
76661e288aSMichael Kuperstein  %res1 = icmp eq i32 %x1, %x2
77661e288aSMichael Kuperstein
78661e288aSMichael Kuperstein; CHECK-NEXT: %res2 = icmp ne i32 %x1, %x2
79661e288aSMichael Kuperstein  %res2 = icmp ne i32 %x1, %x2
80661e288aSMichael Kuperstein
81661e288aSMichael Kuperstein; CHECK-NEXT: %res3 = icmp ugt i32 %x1, %x2
82661e288aSMichael Kuperstein  %res3 = icmp ugt i32 %x1, %x2
83661e288aSMichael Kuperstein
84661e288aSMichael Kuperstein; CHECK-NEXT: %res4 = icmp uge i32 %x1, %x2
85661e288aSMichael Kuperstein  %res4 = icmp uge i32 %x1, %x2
86661e288aSMichael Kuperstein
87661e288aSMichael Kuperstein; CHECK-NEXT: %res5 = icmp ult i32 %x1, %x2
88661e288aSMichael Kuperstein  %res5 = icmp ult i32 %x1, %x2
89661e288aSMichael Kuperstein
90661e288aSMichael Kuperstein; CHECK-NEXT: %res6 = icmp ule i32 %x1, %x2
91661e288aSMichael Kuperstein  %res6 = icmp ule i32 %x1, %x2
92661e288aSMichael Kuperstein
93661e288aSMichael Kuperstein; CHECK-NEXT: %res7 = icmp sgt i32 %x1, %x2
94661e288aSMichael Kuperstein  %res7 = icmp sgt i32 %x1, %x2
95661e288aSMichael Kuperstein
96661e288aSMichael Kuperstein; CHECK-NEXT: %res8 = icmp sge i32 %x1, %x2
97661e288aSMichael Kuperstein  %res8 = icmp sge i32 %x1, %x2
98661e288aSMichael Kuperstein
99661e288aSMichael Kuperstein; CHECK-NEXT: %res9 = icmp slt i32 %x1, %x2
100661e288aSMichael Kuperstein  %res9 = icmp slt i32 %x1, %x2
101661e288aSMichael Kuperstein
102661e288aSMichael Kuperstein; CHECK-NEXT: %res10 = icmp sle i32 %x1, %x2
103661e288aSMichael Kuperstein  %res10 = icmp sle i32 %x1, %x2
104661e288aSMichael Kuperstein
105661e288aSMichael Kuperstein; CHECK-NEXT: %res11 = icmp eq i32* %ptr1, %ptr2
106661e288aSMichael Kuperstein  %res11 = icmp eq i32* %ptr1, %ptr2
107661e288aSMichael Kuperstein
108661e288aSMichael Kuperstein; CHECK-NEXT: %res12 = icmp eq <2 x i32> %vec1, %vec2
109661e288aSMichael Kuperstein  %res12 = icmp eq <2 x i32> %vec1, %vec2
110661e288aSMichael Kuperstein
111661e288aSMichael Kuperstein  ret void
112661e288aSMichael Kuperstein}
113661e288aSMichael Kuperstein
114661e288aSMichael Kuperstein
115661e288aSMichael Kupersteindefine void @fcmp(float %x1, float %x2, <2 x float> %vec1, <2 x float> %vec2){
116661e288aSMichael Kupersteinentry:
117661e288aSMichael Kuperstein; CHECK: %res1 = fcmp oeq float %x1, %x2
118661e288aSMichael Kuperstein  %res1 = fcmp oeq float %x1, %x2
119661e288aSMichael Kuperstein
120661e288aSMichael Kuperstein; CHECK-NEXT: %res2 = fcmp one float %x1, %x2
121661e288aSMichael Kuperstein  %res2 = fcmp one float %x1, %x2
122661e288aSMichael Kuperstein
123661e288aSMichael Kuperstein; CHECK-NEXT: %res3 = fcmp ugt float %x1, %x2
124661e288aSMichael Kuperstein  %res3 = fcmp ugt float %x1, %x2
125661e288aSMichael Kuperstein
126661e288aSMichael Kuperstein; CHECK-NEXT: %res4 = fcmp uge float %x1, %x2
127661e288aSMichael Kuperstein  %res4 = fcmp uge float %x1, %x2
128661e288aSMichael Kuperstein
129661e288aSMichael Kuperstein; CHECK-NEXT: %res5 = fcmp ult float %x1, %x2
130661e288aSMichael Kuperstein  %res5 = fcmp ult float %x1, %x2
131661e288aSMichael Kuperstein
132661e288aSMichael Kuperstein; CHECK-NEXT: %res6 = fcmp ule float %x1, %x2
133661e288aSMichael Kuperstein  %res6 = fcmp ule float %x1, %x2
134661e288aSMichael Kuperstein
135661e288aSMichael Kuperstein; CHECK-NEXT: %res7 = fcmp ogt float %x1, %x2
136661e288aSMichael Kuperstein  %res7 = fcmp ogt float %x1, %x2
137661e288aSMichael Kuperstein
138661e288aSMichael Kuperstein; CHECK-NEXT: %res8 = fcmp oge float %x1, %x2
139661e288aSMichael Kuperstein  %res8 = fcmp oge float %x1, %x2
140661e288aSMichael Kuperstein
141661e288aSMichael Kuperstein; CHECK-NEXT: %res9 = fcmp olt float %x1, %x2
142661e288aSMichael Kuperstein  %res9 = fcmp olt float %x1, %x2
143661e288aSMichael Kuperstein
144661e288aSMichael Kuperstein; CHECK-NEXT: %res10 = fcmp ole float %x1, %x2
145661e288aSMichael Kuperstein  %res10 = fcmp ole float %x1, %x2
146661e288aSMichael Kuperstein
147661e288aSMichael Kuperstein; CHECK-NEXT: %res11 = fcmp ord float %x1, %x2
148661e288aSMichael Kuperstein  %res11 = fcmp ord float %x1, %x2
149661e288aSMichael Kuperstein
150661e288aSMichael Kuperstein; CHECK-NEXT: %res12 = fcmp ueq float %x1, %x2
151661e288aSMichael Kuperstein  %res12 = fcmp ueq float %x1, %x2
152661e288aSMichael Kuperstein
153661e288aSMichael Kuperstein; CHECK-NEXT: %res13 = fcmp une float %x1, %x2
154661e288aSMichael Kuperstein  %res13 = fcmp une float %x1, %x2
155661e288aSMichael Kuperstein
156661e288aSMichael Kuperstein; CHECK-NEXT: %res14 = fcmp uno float %x1, %x2
157661e288aSMichael Kuperstein  %res14 = fcmp uno float %x1, %x2
158661e288aSMichael Kuperstein
159661e288aSMichael Kuperstein; CHECK-NEXT: %res15 = fcmp true float %x1, %x2
160661e288aSMichael Kuperstein  %res15 = fcmp true float %x1, %x2
161661e288aSMichael Kuperstein
162661e288aSMichael Kuperstein; CHECK-NEXT: %res16 = fcmp false float %x1, %x2
163661e288aSMichael Kuperstein  %res16 = fcmp false float %x1, %x2
164661e288aSMichael Kuperstein
165661e288aSMichael Kuperstein; CHECK-NEXT: %res17 = fcmp oeq <2 x float> %vec1, %vec2
166661e288aSMichael Kuperstein  %res17 = fcmp oeq <2 x float> %vec1, %vec2
167661e288aSMichael Kuperstein
168661e288aSMichael Kuperstein  ret void
169661e288aSMichael Kuperstein}
170661e288aSMichael Kuperstein
171661e288aSMichael Kupersteindeclare i32 @printf(i8* noalias nocapture, ...)
172661e288aSMichael Kuperstein
173661e288aSMichael Kupersteindefine void @call(i32 %x, i8* %msg ){
174661e288aSMichael Kupersteinentry:
175661e288aSMichael Kuperstein
176661e288aSMichael Kuperstein; CHECK: %res1 = call i32 @test(i32 %x)
177661e288aSMichael Kuperstein  %res1 = call i32 @test(i32 %x)
178661e288aSMichael Kuperstein
179661e288aSMichael Kuperstein; CHECK-NEXT: %res2 = tail call i32 @test(i32 %x)
180661e288aSMichael Kuperstein  %res2 = tail call i32 @test(i32 %x)
181661e288aSMichael Kuperstein
18223af6484SDavid Blaikie; CHECK-NEXT: %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42)
18323af6484SDavid Blaikie  %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42)
184661e288aSMichael Kuperstein
185661e288aSMichael Kuperstein  ret void
186661e288aSMichael Kuperstein}
187661e288aSMichael Kuperstein
188661e288aSMichael Kupersteindefine i32 @test(i32 %x){
189661e288aSMichael Kupersteinentry:
190661e288aSMichael Kuperstein
191661e288aSMichael Kuperstein  ret i32 %x
192661e288aSMichael Kuperstein}
193