Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: tests_lit/llvm2ice_tests/undef.ll

Issue 1387963002: Make sure that all globals are internal, except for "start" functions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix new tests. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/switch-opt.ll ('k') | tests_lit/llvm2ice_tests/vector-align.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This test checks that undef values are represented as zero. 1 ; This test checks that undef values are represented as zero.
2 2
3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ 3 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \
4 ; RUN: | FileCheck %s 4 ; RUN: | FileCheck %s
5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \
6 ; RUN: | FileCheck %s 6 ; RUN: | FileCheck %s
7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -mattr=sse4.1 \ 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 -mattr=sse4.1 \
8 ; RUN: | FileCheck %s 8 ; RUN: | FileCheck %s
9 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -mattr=sse4.1 \ 9 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 -mattr=sse4.1 \
10 ; RUN: | FileCheck %s 10 ; RUN: | FileCheck %s
11 11
12 define i32 @undef_i32() { 12 define internal i32 @undef_i32() {
13 entry: 13 entry:
14 ret i32 undef 14 ret i32 undef
15 ; CHECK-LABEL: undef_i32 15 ; CHECK-LABEL: undef_i32
16 ; CHECK: mov eax,0x0 16 ; CHECK: mov eax,0x0
17 } 17 }
18 18
19 define i64 @undef_i64() { 19 define internal i64 @undef_i64() {
20 entry: 20 entry:
21 ret i64 undef 21 ret i64 undef
22 ; CHECK-LABEL: undef_i64 22 ; CHECK-LABEL: undef_i64
23 ; CHECK-DAG: mov eax,0x0 23 ; CHECK-DAG: mov eax,0x0
24 ; CHECK-DAG: mov edx,0x0 24 ; CHECK-DAG: mov edx,0x0
25 ; CHECK: ret 25 ; CHECK: ret
26 } 26 }
27 27
28 define i32 @trunc_undef_i64() { 28 define internal i32 @trunc_undef_i64() {
29 entry: 29 entry:
30 %ret = trunc i64 undef to i32 30 %ret = trunc i64 undef to i32
31 ret i32 %ret 31 ret i32 %ret
32 ; CHECK-LABEL: trunc_undef_i64 32 ; CHECK-LABEL: trunc_undef_i64
33 ; CHECK: mov eax,0x0 33 ; CHECK: mov eax,0x0
34 ; CHECK: ret 34 ; CHECK: ret
35 } 35 }
36 36
37 define float @undef_float() { 37 define internal float @undef_float() {
38 entry: 38 entry:
39 ret float undef 39 ret float undef
40 ; CHECK-LABEL: undef_float 40 ; CHECK-LABEL: undef_float
41 ; CHECK: fld DWORD PTR {{.*}} .L$float$00000000 41 ; CHECK: fld DWORD PTR {{.*}} .L$float$00000000
42 } 42 }
43 43
44 define <4 x i1> @undef_v4i1() { 44 define internal <4 x i1> @undef_v4i1() {
45 entry: 45 entry:
46 ret <4 x i1> undef 46 ret <4 x i1> undef
47 ; CHECK-LABEL: undef_v4i1 47 ; CHECK-LABEL: undef_v4i1
48 ; CHECK: pxor 48 ; CHECK: pxor
49 } 49 }
50 50
51 define <8 x i1> @undef_v8i1() { 51 define internal <8 x i1> @undef_v8i1() {
52 entry: 52 entry:
53 ret <8 x i1> undef 53 ret <8 x i1> undef
54 ; CHECK-LABEL: undef_v8i1 54 ; CHECK-LABEL: undef_v8i1
55 ; CHECK: pxor 55 ; CHECK: pxor
56 } 56 }
57 57
58 define <16 x i1> @undef_v16i1() { 58 define internal <16 x i1> @undef_v16i1() {
59 entry: 59 entry:
60 ret <16 x i1> undef 60 ret <16 x i1> undef
61 ; CHECK-LABEL: undef_v16i1 61 ; CHECK-LABEL: undef_v16i1
62 ; CHECK: pxor 62 ; CHECK: pxor
63 } 63 }
64 64
65 define <16 x i8> @undef_v16i8() { 65 define internal <16 x i8> @undef_v16i8() {
66 entry: 66 entry:
67 ret <16 x i8> undef 67 ret <16 x i8> undef
68 ; CHECK-LABEL: undef_v16i8 68 ; CHECK-LABEL: undef_v16i8
69 ; CHECK: pxor 69 ; CHECK: pxor
70 } 70 }
71 71
72 define <8 x i16> @undef_v8i16() { 72 define internal <8 x i16> @undef_v8i16() {
73 entry: 73 entry:
74 ret <8 x i16> undef 74 ret <8 x i16> undef
75 ; CHECK-LABEL: undef_v8i16 75 ; CHECK-LABEL: undef_v8i16
76 ; CHECK: pxor 76 ; CHECK: pxor
77 } 77 }
78 78
79 define <4 x i32> @undef_v4i32() { 79 define internal <4 x i32> @undef_v4i32() {
80 entry: 80 entry:
81 ret <4 x i32> undef 81 ret <4 x i32> undef
82 ; CHECK-LABEL: undef_v4i32 82 ; CHECK-LABEL: undef_v4i32
83 ; CHECK: pxor 83 ; CHECK: pxor
84 } 84 }
85 85
86 define <4 x float> @undef_v4f32() { 86 define internal <4 x float> @undef_v4f32() {
87 entry: 87 entry:
88 ret <4 x float> undef 88 ret <4 x float> undef
89 ; CHECK-LABEL: undef_v4f32 89 ; CHECK-LABEL: undef_v4f32
90 ; CHECK: pxor 90 ; CHECK: pxor
91 } 91 }
92 92
93 define <4 x i32> @vector_arith(<4 x i32> %arg) { 93 define internal <4 x i32> @vector_arith(<4 x i32> %arg) {
94 entry: 94 entry:
95 %val = add <4 x i32> undef, %arg 95 %val = add <4 x i32> undef, %arg
96 ret <4 x i32> %val 96 ret <4 x i32> %val
97 ; CHECK-LABEL: vector_arith 97 ; CHECK-LABEL: vector_arith
98 ; CHECK: pxor 98 ; CHECK: pxor
99 } 99 }
100 100
101 define <4 x float> @vector_bitcast() { 101 define internal <4 x float> @vector_bitcast() {
102 entry: 102 entry:
103 %val = bitcast <4 x i32> undef to <4 x float> 103 %val = bitcast <4 x i32> undef to <4 x float>
104 ret <4 x float> %val 104 ret <4 x float> %val
105 ; CHECK-LABEL: vector_bitcast 105 ; CHECK-LABEL: vector_bitcast
106 ; CHECK: pxor 106 ; CHECK: pxor
107 } 107 }
108 108
109 define <4 x i32> @vector_sext() { 109 define internal <4 x i32> @vector_sext() {
110 entry: 110 entry:
111 %val = sext <4 x i1> undef to <4 x i32> 111 %val = sext <4 x i1> undef to <4 x i32>
112 ret <4 x i32> %val 112 ret <4 x i32> %val
113 ; CHECK-LABEL: vector_sext 113 ; CHECK-LABEL: vector_sext
114 ; CHECK: pxor 114 ; CHECK: pxor
115 } 115 }
116 116
117 define <4 x i32> @vector_zext() { 117 define internal <4 x i32> @vector_zext() {
118 entry: 118 entry:
119 %val = zext <4 x i1> undef to <4 x i32> 119 %val = zext <4 x i1> undef to <4 x i32>
120 ret <4 x i32> %val 120 ret <4 x i32> %val
121 ; CHECK-LABEL: vector_zext 121 ; CHECK-LABEL: vector_zext
122 ; CHECK: pxor 122 ; CHECK: pxor
123 } 123 }
124 124
125 define <4 x i1> @vector_trunc() { 125 define internal <4 x i1> @vector_trunc() {
126 entry: 126 entry:
127 %val = trunc <4 x i32> undef to <4 x i1> 127 %val = trunc <4 x i32> undef to <4 x i1>
128 ret <4 x i1> %val 128 ret <4 x i1> %val
129 ; CHECK-LABEL: vector_trunc 129 ; CHECK-LABEL: vector_trunc
130 ; CHECK: pxor 130 ; CHECK: pxor
131 } 131 }
132 132
133 define <4 x i1> @vector_icmp(<4 x i32> %arg) { 133 define internal <4 x i1> @vector_icmp(<4 x i32> %arg) {
134 entry: 134 entry:
135 %val = icmp eq <4 x i32> undef, %arg 135 %val = icmp eq <4 x i32> undef, %arg
136 ret <4 x i1> %val 136 ret <4 x i1> %val
137 ; CHECK-LABEL: vector_icmp 137 ; CHECK-LABEL: vector_icmp
138 ; CHECK: pxor 138 ; CHECK: pxor
139 } 139 }
140 140
141 define <4 x i1> @vector_fcmp(<4 x float> %arg) { 141 define internal <4 x i1> @vector_fcmp(<4 x float> %arg) {
142 entry: 142 entry:
143 %val = fcmp ueq <4 x float> undef, %arg 143 %val = fcmp ueq <4 x float> undef, %arg
144 ret <4 x i1> %val 144 ret <4 x i1> %val
145 ; CHECK-LABEL: vector_fcmp 145 ; CHECK-LABEL: vector_fcmp
146 ; CHECK: pxor 146 ; CHECK: pxor
147 } 147 }
148 148
149 define <4 x i32> @vector_fptosi() { 149 define internal <4 x i32> @vector_fptosi() {
150 entry: 150 entry:
151 %val = fptosi <4 x float> undef to <4 x i32> 151 %val = fptosi <4 x float> undef to <4 x i32>
152 ret <4 x i32> %val 152 ret <4 x i32> %val
153 ; CHECK-LABEL: vector_fptosi 153 ; CHECK-LABEL: vector_fptosi
154 ; CHECK: pxor 154 ; CHECK: pxor
155 } 155 }
156 156
157 define <4 x i32> @vector_fptoui() { 157 define internal <4 x i32> @vector_fptoui() {
158 entry: 158 entry:
159 %val = fptoui <4 x float> undef to <4 x i32> 159 %val = fptoui <4 x float> undef to <4 x i32>
160 ret <4 x i32> %val 160 ret <4 x i32> %val
161 ; CHECK-LABEL: vector_fptoui 161 ; CHECK-LABEL: vector_fptoui
162 ; CHECK: pxor 162 ; CHECK: pxor
163 } 163 }
164 164
165 define <4 x float> @vector_sitofp() { 165 define internal <4 x float> @vector_sitofp() {
166 entry: 166 entry:
167 %val = sitofp <4 x i32> undef to <4 x float> 167 %val = sitofp <4 x i32> undef to <4 x float>
168 ret <4 x float> %val 168 ret <4 x float> %val
169 ; CHECK-LABEL: vector_sitofp 169 ; CHECK-LABEL: vector_sitofp
170 ; CHECK: pxor 170 ; CHECK: pxor
171 } 171 }
172 172
173 define <4 x float> @vector_uitofp() { 173 define internal <4 x float> @vector_uitofp() {
174 entry: 174 entry:
175 %val = uitofp <4 x i32> undef to <4 x float> 175 %val = uitofp <4 x i32> undef to <4 x float>
176 ret <4 x float> %val 176 ret <4 x float> %val
177 ; CHECK-LABEL: vector_uitofp 177 ; CHECK-LABEL: vector_uitofp
178 ; CHECK: pxor 178 ; CHECK: pxor
179 } 179 }
180 180
181 define <4 x float> @vector_insertelement_arg1() { 181 define internal <4 x float> @vector_insertelement_arg1() {
182 entry: 182 entry:
183 %val = insertelement <4 x float> undef, float 1.0, i32 0 183 %val = insertelement <4 x float> undef, float 1.0, i32 0
184 ret <4 x float> %val 184 ret <4 x float> %val
185 ; CHECK-LABEL: vector_insertelement_arg1 185 ; CHECK-LABEL: vector_insertelement_arg1
186 ; CHECK: pxor 186 ; CHECK: pxor
187 } 187 }
188 188
189 define <4 x float> @vector_insertelement_arg2(<4 x float> %arg) { 189 define internal <4 x float> @vector_insertelement_arg2(<4 x float> %arg) {
190 entry: 190 entry:
191 %val = insertelement <4 x float> %arg, float undef, i32 0 191 %val = insertelement <4 x float> %arg, float undef, i32 0
192 ret <4 x float> %val 192 ret <4 x float> %val
193 ; CHECK-LABEL: vector_insertelement_arg2 193 ; CHECK-LABEL: vector_insertelement_arg2
194 ; CHECK: {{movss|insertps}} {{.*}},DWORD PTR {{.*}} .L$float$00000000 194 ; CHECK: {{movss|insertps}} {{.*}},DWORD PTR {{.*}} .L$float$00000000
195 } 195 }
196 196
197 define float @vector_extractelement_v4f32_index_0() { 197 define internal float @vector_extractelement_v4f32_index_0() {
198 entry: 198 entry:
199 %val = extractelement <4 x float> undef, i32 0 199 %val = extractelement <4 x float> undef, i32 0
200 ret float %val 200 ret float %val
201 ; CHECK-LABEL: vector_extractelement_v4f32_index_0 201 ; CHECK-LABEL: vector_extractelement_v4f32_index_0
202 ; CHECK: pxor 202 ; CHECK: pxor
203 } 203 }
204 204
205 define float @vector_extractelement_v4f32_index_1() { 205 define internal float @vector_extractelement_v4f32_index_1() {
206 entry: 206 entry:
207 %val = extractelement <4 x float> undef, i32 1 207 %val = extractelement <4 x float> undef, i32 1
208 ret float %val 208 ret float %val
209 ; CHECK-LABEL: vector_extractelement_v4f32_index_1 209 ; CHECK-LABEL: vector_extractelement_v4f32_index_1
210 ; CHECK: pxor 210 ; CHECK: pxor
211 } 211 }
212 212
213 define i32 @vector_extractelement_v16i1_index_7() { 213 define internal i32 @vector_extractelement_v16i1_index_7() {
214 entry: 214 entry:
215 %val.trunc = extractelement <16 x i1> undef, i32 7 215 %val.trunc = extractelement <16 x i1> undef, i32 7
216 %val = sext i1 %val.trunc to i32 216 %val = sext i1 %val.trunc to i32
217 ret i32 %val 217 ret i32 %val
218 ; CHECK-LABEL: vector_extractelement_v16i1_index_7 218 ; CHECK-LABEL: vector_extractelement_v16i1_index_7
219 ; CHECK: pxor 219 ; CHECK: pxor
220 } 220 }
221 221
222 define <4 x i32> @vector_select_v4i32_cond(<4 x i32> %a, <4 x i32> %b) { 222 define internal <4 x i32> @vector_select_v4i32_cond(<4 x i32> %a,
223 <4 x i32> %b) {
223 entry: 224 entry:
224 %val = select <4 x i1> undef, <4 x i32> %a, <4 x i32> %b 225 %val = select <4 x i1> undef, <4 x i32> %a, <4 x i32> %b
225 ret <4 x i32> %val 226 ret <4 x i32> %val
226 ; CHECK-LABEL: vector_select_v4i32_cond 227 ; CHECK-LABEL: vector_select_v4i32_cond
227 ; CHECK: pxor 228 ; CHECK: pxor
228 } 229 }
229 230
230 define <4 x i32> @vector_select_v4i32_arg1(<4 x i1> %cond, <4 x i32> %b) { 231 define internal <4 x i32> @vector_select_v4i32_arg1(<4 x i1> %cond,
232 <4 x i32> %b) {
231 entry: 233 entry:
232 %val = select <4 x i1> %cond, <4 x i32> undef, <4 x i32> %b 234 %val = select <4 x i1> %cond, <4 x i32> undef, <4 x i32> %b
233 ret <4 x i32> %val 235 ret <4 x i32> %val
234 ; CHECK-LABEL: vector_select_v4i32_arg1 236 ; CHECK-LABEL: vector_select_v4i32_arg1
235 ; CHECK: pxor 237 ; CHECK: pxor
236 } 238 }
237 239
238 define <4 x i32> @vector_select_v4i32_arg2(<4 x i1> %cond, <4 x i32> %a) { 240 define internal <4 x i32> @vector_select_v4i32_arg2(<4 x i1> %cond,
241 <4 x i32> %a) {
239 entry: 242 entry:
240 %val = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> undef 243 %val = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> undef
241 ret <4 x i32> %val 244 ret <4 x i32> %val
242 ; CHECK-LABEL: vector_select_v4i32_arg2 245 ; CHECK-LABEL: vector_select_v4i32_arg2
243 ; CHECK: pxor 246 ; CHECK: pxor
244 } 247 }
245 248
246 define <4 x i1> @vector_select_v4i1_cond(<4 x i1> %a, <4 x i1> %b) { 249 define internal <4 x i1> @vector_select_v4i1_cond(<4 x i1> %a,
250 <4 x i1> %b) {
247 entry: 251 entry:
248 %val = select <4 x i1> undef, <4 x i1> %a, <4 x i1> %b 252 %val = select <4 x i1> undef, <4 x i1> %a, <4 x i1> %b
249 ret <4 x i1> %val 253 ret <4 x i1> %val
250 ; CHECK-LABEL: vector_select_v4i1_cond 254 ; CHECK-LABEL: vector_select_v4i1_cond
251 ; CHECK: pxor 255 ; CHECK: pxor
252 } 256 }
253 257
254 define <4 x i1> @vector_select_v4i1_arg1(<4 x i1> %cond, <4 x i1> %b) { 258 define internal <4 x i1> @vector_select_v4i1_arg1(<4 x i1> %cond,
259 <4 x i1> %b) {
255 entry: 260 entry:
256 %val = select <4 x i1> %cond, <4 x i1> undef, <4 x i1> %b 261 %val = select <4 x i1> %cond, <4 x i1> undef, <4 x i1> %b
257 ret <4 x i1> %val 262 ret <4 x i1> %val
258 ; CHECK-LABEL: vector_select_v4i1_arg1 263 ; CHECK-LABEL: vector_select_v4i1_arg1
259 ; CHECK: pxor 264 ; CHECK: pxor
260 } 265 }
261 266
262 define <4 x i1> @vector_select_v4i1_arg2(<4 x i1> %cond, <4 x i1> %a) { 267 define internal <4 x i1> @vector_select_v4i1_arg2(<4 x i1> %cond,
268 <4 x i1> %a) {
263 entry: 269 entry:
264 %val = select <4 x i1> %cond, <4 x i1> %a, <4 x i1> undef 270 %val = select <4 x i1> %cond, <4 x i1> %a, <4 x i1> undef
265 ret <4 x i1> %val 271 ret <4 x i1> %val
266 ; CHECK-LABEL: vector_select_v4i1_arg2 272 ; CHECK-LABEL: vector_select_v4i1_arg2
267 ; CHECK: pxor 273 ; CHECK: pxor
268 } 274 }
269 275
270 define <4 x float> @vector_select_v4f32_cond(<4 x float> %a, <4 x float> %b) { 276 define internal <4 x float> @vector_select_v4f32_cond(<4 x float> %a,
277 <4 x float> %b) {
271 entry: 278 entry:
272 %val = select <4 x i1> undef, <4 x float> %a, <4 x float> %b 279 %val = select <4 x i1> undef, <4 x float> %a, <4 x float> %b
273 ret <4 x float> %val 280 ret <4 x float> %val
274 ; CHECK-LABEL: vector_select_v4f32_cond 281 ; CHECK-LABEL: vector_select_v4f32_cond
275 ; CHECK: pxor 282 ; CHECK: pxor
276 } 283 }
277 284
278 define <4 x float> @vector_select_v4f32_arg1(<4 x i1> %cond, <4 x float> %b) { 285 define internal <4 x float> @vector_select_v4f32_arg1(<4 x i1> %cond,
286 <4 x float> %b) {
279 entry: 287 entry:
280 %val = select <4 x i1> %cond, <4 x float> undef, <4 x float> %b 288 %val = select <4 x i1> %cond, <4 x float> undef, <4 x float> %b
281 ret <4 x float> %val 289 ret <4 x float> %val
282 ; CHECK-LABEL: vector_select_v4f32_arg1 290 ; CHECK-LABEL: vector_select_v4f32_arg1
283 ; CHECK: pxor 291 ; CHECK: pxor
284 } 292 }
285 293
286 define <4 x float> @vector_select_v4f32_arg2(<4 x i1> %cond, <4 x float> %a) { 294 define internal <4 x float> @vector_select_v4f32_arg2(<4 x i1> %cond,
295 <4 x float> %a) {
287 entry: 296 entry:
288 %val = select <4 x i1> %cond, <4 x float> %a, <4 x float> undef 297 %val = select <4 x i1> %cond, <4 x float> %a, <4 x float> undef
289 ret <4 x float> %val 298 ret <4 x float> %val
290 ; CHECK-LABEL: vector_select_v4f32_arg2 299 ; CHECK-LABEL: vector_select_v4f32_arg2
291 ; CHECK: pxor 300 ; CHECK: pxor
292 } 301 }
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/switch-opt.ll ('k') | tests_lit/llvm2ice_tests/vector-align.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698