llvm.org GIT mirror llvm / 1de43ed
Fix the remaining TCL-style quotes found in the testsuite. This is another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 7 years ago
124 changed file(s) with 312 addition(s) and 312 deletion(s). Raw diff Collapse all Expand all
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep {/u 3}
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep "/u 3"
11 ; XFAIL: *
22
33 ; This is a tricky testcase for unsigned wrap detection which ScalarEvolution
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | \
1 ; RUN: grep {(((-1 \\* %i0) + (100005 smax %i0)) /u 5)}
1 ; RUN: grep "(((-1 * %i0) + (100005 smax %i0)) /u 5)"
22 ; XFAIL: *
33
44 define i32 @foo0(i32 %i0) nounwind {
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep {/u 5}
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep "/u 5"
11 ; XFAIL: *
22
33 define i8 @foo0(i8 %i0) nounwind {
None ; RUN: opt < %s -analyze -scalar-evolution | not grep {/u -1}
0 ; RUN: opt < %s -analyze -scalar-evolution | not grep "/u -1"
11 ; PR3275
22
33 @g_16 = external global i16 ; [#uses=3]
0 ; RUN: llvm-as < %s | llvm-dis | \
1 ; RUN: not grep {getelementptr.*getelementptr}
1 ; RUN: not grep "getelementptr.*getelementptr"
22
33 %struct.TTriangleItem = type { i8*, i8*, [3 x %struct.TUVVertex] }
44 %struct.TUVVertex = type { i16, i16, i16, i16 }
8383 (*===-- Constants ---------------------------------------------------------===*)
8484
8585 let test_constants () =
86 (* RUN: grep {const_int.*i32.*-1} < %t.ll
86 (* RUN: grep "const_int.*i32.*-1" < %t.ll
8787 *)
8888 group "int";
8989 let c = const_int i32_type (-1) in
9191 insist (i32_type = type_of c);
9292 insist (is_constant c);
9393
94 (* RUN: grep {const_sext_int.*i64.*-1} < %t.ll
94 (* RUN: grep "const_sext_int.*i64.*-1" < %t.ll
9595 *)
9696 group "sext int";
9797 let c = const_int i64_type (-1) in
9898 ignore (define_global "const_sext_int" c m);
9999 insist (i64_type = type_of c);
100100
101 (* RUN: grep {const_zext_int64.*i64.*4294967295} < %t.ll
101 (* RUN: grep "const_zext_int64.*i64.*4294967295" < %t.ll
102102 *)
103103 group "zext int64";
104104 let c = const_of_int64 i64_type (Int64.of_string "4294967295") false in
105105 ignore (define_global "const_zext_int64" c m);
106106 insist (i64_type = type_of c);
107107
108 (* RUN: grep {const_int_string.*i32.*-1} < %t.ll
108 (* RUN: grep "const_int_string.*i32.*-1" < %t.ll
109109 *)
110110 group "int string";
111111 let c = const_int_of_string i32_type "-1" 10 in
112112 ignore (define_global "const_int_string" c m);
113113 insist (i32_type = type_of c);
114114
115 (* RUN: grep {const_string.*"cruel\\\\00world"} < %t.ll
115 (* RUN: grep 'const_string.*"cruel\00world"' < %t.ll
116116 *)
117117 group "string";
118118 let c = const_string context "cruel\000world" in
119119 ignore (define_global "const_string" c m);
120120 insist ((array_type i8_type 11) = type_of c);
121121
122 (* RUN: grep {const_stringz.*"hi\\\\00again\\\\00"} < %t.ll
122 (* RUN: grep 'const_stringz.*"hi\00again\00"' < %t.ll
123123 *)
124124 group "stringz";
125125 let c = const_stringz context "hi\000again" in
126126 ignore (define_global "const_stringz" c m);
127127 insist ((array_type i8_type 9) = type_of c);
128128
129 (* RUN: grep {const_single.*2.75} < %t.ll
130 * RUN: grep {const_double.*3.1459} < %t.ll
131 * RUN: grep {const_double_string.*1.25} < %t.ll
129 (* RUN: grep "const_single.*2.75" < %t.ll
130 * RUN: grep "const_double.*3.1459" < %t.ll
131 * RUN: grep "const_double_string.*1.25" < %t.ll
132132 *)
133133 begin group "real";
134134 let cs = const_float float_type 2.75 in
149149 let three = const_int i32_type 3 in
150150 let four = const_int i32_type 4 in
151151
152 (* RUN: grep {const_array.*\\\[i32 3, i32 4\\\]} < %t.ll
152 (* RUN: grep "const_array.*[i32 3, i32 4]" < %t.ll
153153 *)
154154 group "array";
155155 let c = const_array i32_type [| three; four |] in
156156 ignore (define_global "const_array" c m);
157157 insist ((array_type i32_type 2) = (type_of c));
158158
159 (* RUN: grep {const_vector.*} < %t.ll
159 (* RUN: grep "const_vector.*" < %t.ll
160160 *)
161161 group "vector";
162162 let c = const_vector [| one; two; one; two;
164164 ignore (define_global "const_vector" c m);
165165 insist ((vector_type i16_type 8) = (type_of c));
166166
167 (* RUN: grep {const_structure.*.i16 1, i16 2, i32 3, i32 4} < %t.ll
167 (* RUN: grep "const_structure.*.i16 1, i16 2, i32 3, i32 4" < %t.ll
168168 *)
169169 group "structure";
170170 let c = const_struct context [| one; two; three; four |] in
172172 insist ((struct_type context [| i16_type; i16_type; i32_type; i32_type |])
173173 = (type_of c));
174174
175 (* RUN: grep {const_null.*zeroinit} < %t.ll
175 (* RUN: grep "const_null.*zeroinit" < %t.ll
176176 *)
177177 group "null";
178178 let c = const_null (packed_struct_type context [| i1_type; i8_type; i64_type;
179179 double_type |]) in
180180 ignore (define_global "const_null" c m);
181181
182 (* RUN: grep {const_all_ones.*-1} < %t.ll
182 (* RUN: grep "const_all_ones.*-1" < %t.ll
183183 *)
184184 group "all ones";
185185 let c = const_all_ones i64_type in
186186 ignore (define_global "const_all_ones" c m);
187187
188188 group "pointer null"; begin
189 (* RUN: grep {const_pointer_null = global i64\\* null} < %t.ll
189 (* RUN: grep "const_pointer_null = global i64* null" < %t.ll
190190 *)
191191 let c = const_pointer_null (pointer_type i64_type) in
192192 ignore (define_global "const_pointer_null" c m);
193193 end;
194194
195 (* RUN: grep {const_undef.*undef} < %t.ll
195 (* RUN: grep "const_undef.*undef" < %t.ll
196196 *)
197197 group "undef";
198198 let c = undef i1_type in
201201 insist (is_undef c);
202202
203203 group "constant arithmetic";
204 (* RUN: grep {@const_neg = global i64 sub} < %t.ll
205 * RUN: grep {@const_nsw_neg = global i64 sub nsw } < %t.ll
206 * RUN: grep {@const_nuw_neg = global i64 sub nuw } < %t.ll
207 * RUN: grep {@const_fneg = global double fsub } < %t.ll
208 * RUN: grep {@const_not = global i64 xor } < %t.ll
209 * RUN: grep {@const_add = global i64 add } < %t.ll
210 * RUN: grep {@const_nsw_add = global i64 add nsw } < %t.ll
211 * RUN: grep {@const_nuw_add = global i64 add nuw } < %t.ll
212 * RUN: grep {@const_fadd = global double fadd } < %t.ll
213 * RUN: grep {@const_sub = global i64 sub } < %t.ll
214 * RUN: grep {@const_nsw_sub = global i64 sub nsw } < %t.ll
215 * RUN: grep {@const_nuw_sub = global i64 sub nuw } < %t.ll
216 * RUN: grep {@const_fsub = global double fsub } < %t.ll
217 * RUN: grep {@const_mul = global i64 mul } < %t.ll
218 * RUN: grep {@const_nsw_mul = global i64 mul nsw } < %t.ll
219 * RUN: grep {@const_nuw_mul = global i64 mul nuw } < %t.ll
220 * RUN: grep {@const_fmul = global double fmul } < %t.ll
221 * RUN: grep {@const_udiv = global i64 udiv } < %t.ll
222 * RUN: grep {@const_sdiv = global i64 sdiv } < %t.ll
223 * RUN: grep {@const_exact_sdiv = global i64 sdiv exact } < %t.ll
224 * RUN: grep {@const_fdiv = global double fdiv } < %t.ll
225 * RUN: grep {@const_urem = global i64 urem } < %t.ll
226 * RUN: grep {@const_srem = global i64 srem } < %t.ll
227 * RUN: grep {@const_frem = global double frem } < %t.ll
228 * RUN: grep {@const_and = global i64 and } < %t.ll
229 * RUN: grep {@const_or = global i64 or } < %t.ll
230 * RUN: grep {@const_xor = global i64 xor } < %t.ll
231 * RUN: grep {@const_icmp = global i1 icmp sle } < %t.ll
232 * RUN: grep {@const_fcmp = global i1 fcmp ole } < %t.ll
204 (* RUN: grep "@const_neg = global i64 sub" < %t.ll
205 * RUN: grep "@const_nsw_neg = global i64 sub nsw " < %t.ll
206 * RUN: grep "@const_nuw_neg = global i64 sub nuw " < %t.ll
207 * RUN: grep "@const_fneg = global double fsub " < %t.ll
208 * RUN: grep "@const_not = global i64 xor " < %t.ll
209 * RUN: grep "@const_add = global i64 add " < %t.ll
210 * RUN: grep "@const_nsw_add = global i64 add nsw " < %t.ll
211 * RUN: grep "@const_nuw_add = global i64 add nuw " < %t.ll
212 * RUN: grep "@const_fadd = global double fadd " < %t.ll
213 * RUN: grep "@const_sub = global i64 sub " < %t.ll
214 * RUN: grep "@const_nsw_sub = global i64 sub nsw " < %t.ll
215 * RUN: grep "@const_nuw_sub = global i64 sub nuw " < %t.ll
216 * RUN: grep "@const_fsub = global double fsub " < %t.ll
217 * RUN: grep "@const_mul = global i64 mul " < %t.ll
218 * RUN: grep "@const_nsw_mul = global i64 mul nsw " < %t.ll
219 * RUN: grep "@const_nuw_mul = global i64 mul nuw " < %t.ll
220 * RUN: grep "@const_fmul = global double fmul " < %t.ll
221 * RUN: grep "@const_udiv = global i64 udiv " < %t.ll
222 * RUN: grep "@const_sdiv = global i64 sdiv " < %t.ll
223 * RUN: grep "@const_exact_sdiv = global i64 sdiv exact " < %t.ll
224 * RUN: grep "@const_fdiv = global double fdiv " < %t.ll
225 * RUN: grep "@const_urem = global i64 urem " < %t.ll
226 * RUN: grep "@const_srem = global i64 srem " < %t.ll
227 * RUN: grep "@const_frem = global double frem " < %t.ll
228 * RUN: grep "@const_and = global i64 and " < %t.ll
229 * RUN: grep "@const_or = global i64 or " < %t.ll
230 * RUN: grep "@const_xor = global i64 xor " < %t.ll
231 * RUN: grep "@const_icmp = global i1 icmp sle " < %t.ll
232 * RUN: grep "@const_fcmp = global i1 fcmp ole " < %t.ll
233233 *)
234234 let void_ptr = pointer_type i8_type in
235235 let five = const_int i64_type 5 in
268268 ignore (define_global "const_fcmp" (const_fcmp Fcmp.Ole ffoldbomb ffive) m);
269269
270270 group "constant casts";
271 (* RUN: grep {const_trunc.*trunc} < %t.ll
272 * RUN: grep {const_sext.*sext} < %t.ll
273 * RUN: grep {const_zext.*zext} < %t.ll
274 * RUN: grep {const_fptrunc.*fptrunc} < %t.ll
275 * RUN: grep {const_fpext.*fpext} < %t.ll
276 * RUN: grep {const_uitofp.*uitofp} < %t.ll
277 * RUN: grep {const_sitofp.*sitofp} < %t.ll
278 * RUN: grep {const_fptoui.*fptoui} < %t.ll
279 * RUN: grep {const_fptosi.*fptosi} < %t.ll
280 * RUN: grep {const_ptrtoint.*ptrtoint} < %t.ll
281 * RUN: grep {const_inttoptr.*inttoptr} < %t.ll
282 * RUN: grep {const_bitcast.*bitcast} < %t.ll
271 (* RUN: grep "const_trunc.*trunc" < %t.ll
272 * RUN: grep "const_sext.*sext" < %t.ll
273 * RUN: grep "const_zext.*zext" < %t.ll
274 * RUN: grep "const_fptrunc.*fptrunc" < %t.ll
275 * RUN: grep "const_fpext.*fpext" < %t.ll
276 * RUN: grep "const_uitofp.*uitofp" < %t.ll
277 * RUN: grep "const_sitofp.*sitofp" < %t.ll
278 * RUN: grep "const_fptoui.*fptoui" < %t.ll
279 * RUN: grep "const_fptosi.*fptosi" < %t.ll
280 * RUN: grep "const_ptrtoint.*ptrtoint" < %t.ll
281 * RUN: grep "const_inttoptr.*inttoptr" < %t.ll
282 * RUN: grep "const_bitcast.*bitcast" < %t.ll
283283 *)
284284 let i128_type = integer_type context 128 in
285285 ignore (define_global "const_trunc" (const_trunc (const_add foldbomb five)
301301 ignore (define_global "const_bitcast" (const_bitcast ffoldbomb i64_type) m);
302302
303303 group "misc constants";
304 (* RUN: grep {const_size_of.*getelementptr.*null} < %t.ll
305 * RUN: grep {const_gep.*getelementptr} < %t.ll
306 * RUN: grep {const_select.*select} < %t.ll
307 * RUN: grep {const_extractelement.*extractelement} < %t.ll
308 * RUN: grep {const_insertelement.*insertelement} < %t.ll
309 * RUN: grep {const_shufflevector = global <4 x i32> } < %t.ll
304 (* RUN: grep "const_size_of.*getelementptr.*null" < %t.ll
305 * RUN: grep "const_gep.*getelementptr" < %t.ll
306 * RUN: grep "const_select.*select" < %t.ll
307 * RUN: grep "const_extractelement.*extractelement" < %t.ll
308 * RUN: grep "const_insertelement.*insertelement" < %t.ll
309 * RUN: grep "const_shufflevector = global <4 x i32> " < %t.ll
310310 *)
311311 ignore (define_global "const_size_of" (size_of (pointer_type i8_type)) m);
312312 ignore (define_global "const_gep" (const_gep foldbomb_gv [| five |]) m);
355355 let (++) x f = f x; x in
356356 let zero32 = const_null i32_type in
357357
358 (* RUN: grep {GVal01} < %t.ll
358 (* RUN: grep "GVal01" < %t.ll
359359 *)
360360 group "naming";
361361 let g = define_global "TEMPORARY" zero32 m in
363363 set_value_name "GVal01" g;
364364 insist ("GVal01" = value_name g);
365365
366 (* RUN: grep {GVal02.*linkonce} < %t.ll
366 (* RUN: grep "GVal02.*linkonce" < %t.ll
367367 *)
368368 group "linkage";
369369 let g = define_global "GVal02" zero32 m ++
370370 set_linkage Linkage.Link_once in
371371 insist (Linkage.Link_once = linkage g);
372372
373 (* RUN: grep {GVal03.*Hanalei} < %t.ll
373 (* RUN: grep "GVal03.*Hanalei" < %t.ll
374374 *)
375375 group "section";
376376 let g = define_global "GVal03" zero32 m ++
377377 set_section "Hanalei" in
378378 insist ("Hanalei" = section g);
379379
380 (* RUN: grep {GVal04.*hidden} < %t.ll
380 (* RUN: grep "GVal04.*hidden" < %t.ll
381381 *)
382382 group "visibility";
383383 let g = define_global "GVal04" zero32 m ++
384384 set_visibility Visibility.Hidden in
385385 insist (Visibility.Hidden = visibility g);
386386
387 (* RUN: grep {GVal05.*align 128} < %t.ll
387 (* RUN: grep "GVal05.*align 128" < %t.ll
388388 *)
389389 group "alignment";
390390 let g = define_global "GVal05" zero32 m ++
399399 let fourty_two32 = const_int i32_type 42 in
400400
401401 group "declarations"; begin
402 (* RUN: grep {GVar01.*external} < %t.ll
402 (* RUN: grep "GVar01.*external" < %t.ll
403403 *)
404404 insist (None == lookup_global "GVar01" m);
405405 let g = declare_global i32_type "GVar01" m in
421421 end;
422422
423423 group "definitions"; begin
424 (* RUN: grep {GVar02.*42} < %t.ll
425 * RUN: grep {GVar03.*42} < %t.ll
424 (* RUN: grep "GVar02.*42" < %t.ll
425 * RUN: grep "GVar03.*42" < %t.ll
426426 *)
427427 let g = define_global "GVar02" fourty_two32 m in
428428 let g2 = declare_global i32_type "GVar03" m ++
439439 insist ((global_initializer g) == (global_initializer g2));
440440 end;
441441
442 (* RUN: grep {GVar04.*thread_local} < %t.ll
442 (* RUN: grep "GVar04.*thread_local" < %t.ll
443443 *)
444444 group "threadlocal";
445445 let g = define_global "GVar04" fourty_two32 m ++
446446 set_thread_local true in
447447 insist (is_thread_local g);
448448
449 (* RUN: grep -v {GVar05} < %t.ll
449 (* RUN: grep -v "GVar05" < %t.ll
450450 *)
451451 group "delete";
452452 let g = define_global "GVar05" fourty_two32 m in
453453 delete_global g;
454454
455 (* RUN: grep -v {ConstGlobalVar.*constant} < %t.ll
455 (* RUN: grep -v "ConstGlobalVar.*constant" < %t.ll
456456 *)
457457 group "constant";
458458 let g = define_global "ConstGlobalVar" fourty_two32 m in
541541 (*===-- Aliases -----------------------------------------------------------===*)
542542
543543 let test_aliases () =
544 (* RUN: grep {@alias = alias i32\\* @aliasee} < %t.ll
544 (* RUN: grep "@alias = alias i32* @aliasee" < %t.ll
545545 *)
546546 let v = declare_global i32_type "aliasee" m in
547547 ignore (add_alias m (pointer_type i32_type) v "alias")
553553 let ty = function_type i32_type [| i32_type; i64_type |] in
554554 let ty2 = function_type i8_type [| i8_type; i64_type |] in
555555
556 (* RUN: grep {declare i32 @Fn1\(i32, i64\)} < %t.ll
556 (* RUN: grep "declare i32 @Fn1\(i32, i64\)" < %t.ll
557557 *)
558558 begin group "declare";
559559 insist (None = lookup_function "Fn1" m);
569569 insist (m == global_parent fn)
570570 end;
571571
572 (* RUN: grep -v {Fn2} < %t.ll
572 (* RUN: grep -v "Fn2" < %t.ll
573573 *)
574574 group "delete";
575575 let fn = declare_function "Fn2" ty m in
576576 delete_function fn;
577577
578 (* RUN: grep {define.*Fn3} < %t.ll
578 (* RUN: grep "define.*Fn3" < %t.ll
579579 *)
580580 group "define";
581581 let fn = define_function "Fn3" ty m in
583583 insist (1 = Array.length (basic_blocks fn));
584584 ignore (build_unreachable (builder_at_end context (entry_block fn)));
585585
586 (* RUN: grep {define.*Fn4.*Param1.*Param2} < %t.ll
586 (* RUN: grep "define.*Fn4.*Param1.*Param2" < %t.ll
587587 *)
588588 group "params";
589589 let fn = define_function "Fn4" ty m in
597597 set_value_name "Param2" params.(1);
598598 ignore (build_unreachable (builder_at_end context (entry_block fn)));
599599
600 (* RUN: grep {fastcc.*Fn5} < %t.ll
600 (* RUN: grep "fastcc.*Fn5" < %t.ll
601601 *)
602602 group "callconv";
603603 let fn = define_function "Fn5" ty m in
607607 ignore (build_unreachable (builder_at_end context (entry_block fn)));
608608
609609 begin group "gc";
610 (* RUN: grep {Fn6.*gc.*shadowstack} < %t.ll
610 (* RUN: grep "Fn6.*gc.*shadowstack" < %t.ll
611611 *)
612612 let fn = define_function "Fn6" ty m in
613613 insist (None = gc fn);
693693 let test_basic_blocks () =
694694 let ty = function_type void_type [| |] in
695695
696 (* RUN: grep {Bb1} < %t.ll
696 (* RUN: grep "Bb1" < %t.ll
697697 *)
698698 group "entry";
699699 let fn = declare_function "X" ty m in
824824
825825 group "ret void";
826826 begin
827 (* RUN: grep {ret void} < %t.ll
827 (* RUN: grep "ret void" < %t.ll
828828 *)
829829 let fty = function_type void_type [| |] in
830830 let fn = declare_function "X6" fty m in
834834
835835 group "ret aggregate";
836836 begin
837 (* RUN: grep {ret \{ i8, i64 \} \{ i8 4, i64 5 \}} < %t.ll
837 (* RUN: grep "ret { i8, i64 } { i8 4, i64 5 }" < %t.ll
838838 *)
839839 let sty = struct_type context [| i8_type; i64_type |] in
840840 let fty = function_type sty [| |] in
894894 end;
895895
896896 group "ret"; begin
897 (* RUN: grep {ret.*P1} < %t.ll
897 (* RUN: grep "ret.*P1" < %t.ll
898898 *)
899899 let ret = build_ret p1 atentry in
900900 position_before ret atentry
901901 end;
902902
903903 group "br"; begin
904 (* RUN: grep {br.*Bb02} < %t.ll
904 (* RUN: grep "br.*Bb02" < %t.ll
905905 *)
906906 let bb02 = append_block context "Bb02" fn in
907907 let b = builder_at_end context bb02 in
909909 end;
910910
911911 group "cond_br"; begin
912 (* RUN: grep {br.*build_br.*Bb03.*Bb00} < %t.ll
912 (* RUN: grep "br.*build_br.*Bb03.*Bb00" < %t.ll
913913 *)
914914 let bb03 = append_block context "Bb03" fn in
915915 let b = builder_at_end context bb03 in
918918 end;
919919
920920 group "switch"; begin
921 (* RUN: grep {switch.*P1.*SwiBlock3} < %t.ll
922 * RUN: grep {2,.*SwiBlock2} < %t.ll
921 (* RUN: grep "switch.*P1.*SwiBlock3" < %t.ll
922 * RUN: grep "2,.*SwiBlock2" < %t.ll
923923 *)
924924 let bb1 = append_block context "SwiBlock1" fn in
925925 let bb2 = append_block context "SwiBlock2" fn in
933933 end;
934934
935935 group "malloc/free"; begin
936 (* RUN: grep {call.*@malloc(i32 ptrtoint} < %t.ll
937 * RUN: grep {call.*@free(i8\*} < %t.ll
938 * RUN: grep {call.*@malloc(i32 %} < %t.ll
936 (* RUN: grep "call.*@malloc(i32 ptrtoint" < %t.ll
937 * RUN: grep "call.*@free(i8*" < %t.ll
938 * RUN: grep "call.*@malloc(i32 %" < %t.ll
939939 *)
940940 let bb1 = append_block context "MallocBlock1" fn in
941941 let m1 = (build_malloc (pointer_type i32_type) "m1"
946946 end;
947947
948948 group "indirectbr"; begin
949 (* RUN: grep {indirectbr i8\\* blockaddress(@X7, %IBRBlock2), \\\[label %IBRBlock2, label %IBRBlock3\\\]} < %t.ll
949 (* RUN: grep "indirectbr i8* blockaddress(@X7, %IBRBlock2), [label %IBRBlock2, label %IBRBlock3]" < %t.ll
950950 *)
951951 let bb1 = append_block context "IBRBlock1" fn in
952952
963963 end;
964964
965965 group "invoke"; begin
966 (* RUN: grep {build_invoke.*invoke.*P1.*P2} < %t.ll
967 * RUN: grep {to.*Bb04.*unwind.*Bblpad} < %t.ll
966 (* RUN: grep "build_invoke.*invoke.*P1.*P2" < %t.ll
967 * RUN: grep "to.*Bb04.*unwind.*Bblpad" < %t.ll
968968 *)
969969 let bb04 = append_block context "Bb04" fn in
970970 let b = builder_at_end context bb04 in
972972 end;
973973
974974 group "unreachable"; begin
975 (* RUN: grep {unreachable} < %t.ll
975 (* RUN: grep "unreachable" < %t.ll
976976 *)
977977 let bb06 = append_block context "Bb06" fn in
978978 let b = builder_at_end context bb06 in
983983 let bb07 = append_block context "Bb07" fn in
984984 let b = builder_at_end context bb07 in
985985
986 (* RUN: grep {%build_add = add i32 %P1, %P2} < %t.ll
987 * RUN: grep {%build_nsw_add = add nsw i32 %P1, %P2} < %t.ll
988 * RUN: grep {%build_nuw_add = add nuw i32 %P1, %P2} < %t.ll
989 * RUN: grep {%build_fadd = fadd float %F1, %F2} < %t.ll
990 * RUN: grep {%build_sub = sub i32 %P1, %P2} < %t.ll
991 * RUN: grep {%build_nsw_sub = sub nsw i32 %P1, %P2} < %t.ll
992 * RUN: grep {%build_nuw_sub = sub nuw i32 %P1, %P2} < %t.ll
993 * RUN: grep {%build_fsub = fsub float %F1, %F2} < %t.ll
994 * RUN: grep {%build_mul = mul i32 %P1, %P2} < %t.ll
995 * RUN: grep {%build_nsw_mul = mul nsw i32 %P1, %P2} < %t.ll
996 * RUN: grep {%build_nuw_mul = mul nuw i32 %P1, %P2} < %t.ll
997 * RUN: grep {%build_fmul = fmul float %F1, %F2} < %t.ll
998 * RUN: grep {%build_udiv = udiv i32 %P1, %P2} < %t.ll
999 * RUN: grep {%build_sdiv = sdiv i32 %P1, %P2} < %t.ll
1000 * RUN: grep {%build_exact_sdiv = sdiv exact i32 %P1, %P2} < %t.ll
1001 * RUN: grep {%build_fdiv = fdiv float %F1, %F2} < %t.ll
1002 * RUN: grep {%build_urem = urem i32 %P1, %P2} < %t.ll
1003 * RUN: grep {%build_srem = srem i32 %P1, %P2} < %t.ll
1004 * RUN: grep {%build_frem = frem float %F1, %F2} < %t.ll
1005 * RUN: grep {%build_shl = shl i32 %P1, %P2} < %t.ll
1006 * RUN: grep {%build_lshl = lshr i32 %P1, %P2} < %t.ll
1007 * RUN: grep {%build_ashl = ashr i32 %P1, %P2} < %t.ll
1008 * RUN: grep {%build_and = and i32 %P1, %P2} < %t.ll
1009 * RUN: grep {%build_or = or i32 %P1, %P2} < %t.ll
1010 * RUN: grep {%build_xor = xor i32 %P1, %P2} < %t.ll
1011 * RUN: grep {%build_neg = sub i32 0, %P1} < %t.ll
1012 * RUN: grep {%build_nsw_neg = sub nsw i32 0, %P1} < %t.ll
1013 * RUN: grep {%build_nuw_neg = sub nuw i32 0, %P1} < %t.ll
1014 * RUN: grep {%build_fneg = fsub float .*0.*, %F1} < %t.ll
1015 * RUN: grep {%build_not = xor i32 %P1, -1} < %t.ll
986 (* RUN: grep "%build_add = add i32 %P1, %P2" < %t.ll
987 * RUN: grep "%build_nsw_add = add nsw i32 %P1, %P2" < %t.ll
988 * RUN: grep "%build_nuw_add = add nuw i32 %P1, %P2" < %t.ll
989 * RUN: grep "%build_fadd = fadd float %F1, %F2" < %t.ll
990 * RUN: grep "%build_sub = sub i32 %P1, %P2" < %t.ll
991 * RUN: grep "%build_nsw_sub = sub nsw i32 %P1, %P2" < %t.ll
992 * RUN: grep "%build_nuw_sub = sub nuw i32 %P1, %P2" < %t.ll
993 * RUN: grep "%build_fsub = fsub float %F1, %F2" < %t.ll
994 * RUN: grep "%build_mul = mul i32 %P1, %P2" < %t.ll
995 * RUN: grep "%build_nsw_mul = mul nsw i32 %P1, %P2" < %t.ll
996 * RUN: grep "%build_nuw_mul = mul nuw i32 %P1, %P2" < %t.ll
997 * RUN: grep "%build_fmul = fmul float %F1, %F2" < %t.ll
998 * RUN: grep "%build_udiv = udiv i32 %P1, %P2" < %t.ll
999 * RUN: grep "%build_sdiv = sdiv i32 %P1, %P2" < %t.ll
1000 * RUN: grep "%build_exact_sdiv = sdiv exact i32 %P1, %P2" < %t.ll
1001 * RUN: grep "%build_fdiv = fdiv float %F1, %F2" < %t.ll
1002 * RUN: grep "%build_urem = urem i32 %P1, %P2" < %t.ll
1003 * RUN: grep "%build_srem = srem i32 %P1, %P2" < %t.ll
1004 * RUN: grep "%build_frem = frem float %F1, %F2" < %t.ll
1005 * RUN: grep "%build_shl = shl i32 %P1, %P2" < %t.ll
1006 * RUN: grep "%build_lshl = lshr i32 %P1, %P2" < %t.ll
1007 * RUN: grep "%build_ashl = ashr i32 %P1, %P2" < %t.ll
1008 * RUN: grep "%build_and = and i32 %P1, %P2" < %t.ll
1009 * RUN: grep "%build_or = or i32 %P1, %P2" < %t.ll
1010 * RUN: grep "%build_xor = xor i32 %P1, %P2" < %t.ll
1011 * RUN: grep "%build_neg = sub i32 0, %P1" < %t.ll
1012 * RUN: grep "%build_nsw_neg = sub nsw i32 0, %P1" < %t.ll
1013 * RUN: grep "%build_nuw_neg = sub nuw i32 0, %P1" < %t.ll
1014 * RUN: grep "%build_fneg = fsub float .*0.*, %F1" < %t.ll
1015 * RUN: grep "%build_not = xor i32 %P1, -1" < %t.ll
10161016 *)
10171017 ignore (build_add p1 p2 "build_add" b);
10181018 ignore (build_nsw_add p1 p2 "build_nsw_add" b);
10511051 let bb08 = append_block context "Bb08" fn in
10521052 let b = builder_at_end context bb08 in
10531053
1054 (* RUN: grep {%build_alloca = alloca i32} < %t.ll
1055 * RUN: grep {%build_array_alloca = alloca i32, i32 %P2} < %t.ll
1056 * RUN: grep {%build_load = load i32\\* %build_array_alloca} < %t.ll
1057 * RUN: grep {store i32 %P2, i32\\* %build_alloca} < %t.ll
1058 * RUN: grep {%build_gep = getelementptr i32\\* %build_array_alloca, i32 %P2} < %t.ll
1059 * RUN: grep {%build_in_bounds_gep = getelementptr inbounds i32\\* %build_array_alloca, i32 %P2} < %t.ll
1060 * RUN: grep {%build_struct_gep = getelementptr inbounds.*%build_alloca2, i32 0, i32 1} < %t.ll
1054 (* RUN: grep "%build_alloca = alloca i32" < %t.ll
1055 * RUN: grep "%build_array_alloca = alloca i32, i32 %P2" < %t.ll
1056 * RUN: grep "%build_load = load i32* %build_array_alloca" < %t.ll
1057 * RUN: grep "store i32 %P2, i32* %build_alloca" < %t.ll
1058 * RUN: grep "%build_gep = getelementptr i32* %build_array_alloca, i32 %P2" < %t.ll
1059 * RUN: grep "%build_in_bounds_gep = getelementptr inbounds i32* %build_array_alloca, i32 %P2" < %t.ll
1060 * RUN: grep "%build_struct_gep = getelementptr inbounds.*%build_alloca2, i32 0, i32 1" < %t.ll
10611061 *)
10621062 let alloca = build_alloca i32_type "build_alloca" b in
10631063 let array_alloca = build_array_alloca i32_type p2 "build_array_alloca" b in
10891089 group "casts"; begin
10901090 let void_ptr = pointer_type i8_type in
10911091
1092 (* RUN: grep {%build_trunc = trunc i32 %P1 to i8} < %t.ll
1093 * RUN: grep {%build_trunc2 = trunc i32 %P1 to i8} < %t.ll
1094 * RUN: grep {%build_trunc3 = trunc i32 %P1 to i8} < %t.ll
1095 * RUN: grep {%build_zext = zext i8 %build_trunc to i32} < %t.ll
1096 * RUN: grep {%build_zext2 = zext i8 %build_trunc to i32} < %t.ll
1097 * RUN: grep {%build_sext = sext i32 %build_zext to i64} < %t.ll
1098 * RUN: grep {%build_sext2 = sext i32 %build_zext to i64} < %t.ll
1099 * RUN: grep {%build_sext3 = sext i32 %build_zext to i64} < %t.ll
1100 * RUN: grep {%build_uitofp = uitofp i64 %build_sext to float} < %t.ll
1101 * RUN: grep {%build_sitofp = sitofp i32 %build_zext to double} < %t.ll
1102 * RUN: grep {%build_fptoui = fptoui float %build_uitofp to i32} < %t.ll
1103 * RUN: grep {%build_fptosi = fptosi double %build_sitofp to i64} < %t.ll
1104 * RUN: grep {%build_fptrunc = fptrunc double %build_sitofp to float} < %t.ll
1105 * RUN: grep {%build_fptrunc2 = fptrunc double %build_sitofp to float} < %t.ll
1106 * RUN: grep {%build_fpext = fpext float %build_fptrunc to double} < %t.ll
1107 * RUN: grep {%build_fpext2 = fpext float %build_fptrunc to double} < %t.ll
1108 * RUN: grep {%build_inttoptr = inttoptr i32 %P1 to i8\\*} < %t.ll
1109 * RUN: grep {%build_ptrtoint = ptrtoint i8\\* %build_inttoptr to i64} < %t.ll
1110 * RUN: grep {%build_ptrtoint2 = ptrtoint i8\\* %build_inttoptr to i64} < %t.ll
1111 * RUN: grep {%build_bitcast = bitcast i64 %build_ptrtoint to double} < %t.ll
1112 * RUN: grep {%build_bitcast2 = bitcast i64 %build_ptrtoint to double} < %t.ll
1113 * RUN: grep {%build_bitcast3 = bitcast i64 %build_ptrtoint to double} < %t.ll
1114 * RUN: grep {%build_bitcast4 = bitcast i64 %build_ptrtoint to double} < %t.ll
1115 * RUN: grep {%build_pointercast = bitcast i8\\* %build_inttoptr to i16\\*} < %t.ll
1092 (* RUN: grep "%build_trunc = trunc i32 %P1 to i8" < %t.ll
1093 * RUN: grep "%build_trunc2 = trunc i32 %P1 to i8" < %t.ll
1094 * RUN: grep "%build_trunc3 = trunc i32 %P1 to i8" < %t.ll
1095 * RUN: grep "%build_zext = zext i8 %build_trunc to i32" < %t.ll
1096 * RUN: grep "%build_zext2 = zext i8 %build_trunc to i32" < %t.ll
1097 * RUN: grep "%build_sext = sext i32 %build_zext to i64" < %t.ll
1098 * RUN: grep "%build_sext2 = sext i32 %build_zext to i64" < %t.ll
1099 * RUN: grep "%build_sext3 = sext i32 %build_zext to i64" < %t.ll
1100 * RUN: grep "%build_uitofp = uitofp i64 %build_sext to float" < %t.ll
1101 * RUN: grep "%build_sitofp = sitofp i32 %build_zext to double" < %t.ll
1102 * RUN: grep "%build_fptoui = fptoui float %build_uitofp to i32" < %t.ll
1103 * RUN: grep "%build_fptosi = fptosi double %build_sitofp to i64" < %t.ll
1104 * RUN: grep "%build_fptrunc = fptrunc double %build_sitofp to float" < %t.ll
1105 * RUN: grep "%build_fptrunc2 = fptrunc double %build_sitofp to float" < %t.ll
1106 * RUN: grep "%build_fpext = fpext float %build_fptrunc to double" < %t.ll
1107 * RUN: grep "%build_fpext2 = fpext float %build_fptrunc to double" < %t.ll
1108 * RUN: grep "%build_inttoptr = inttoptr i32 %P1 to i8*" < %t.ll
1109 * RUN: grep "%build_ptrtoint = ptrtoint i8* %build_inttoptr to i64" < %t.ll
1110 * RUN: grep "%build_ptrtoint2 = ptrtoint i8* %build_inttoptr to i64" < %t.ll
1111 * RUN: grep "%build_bitcast = bitcast i64 %build_ptrtoint to double" < %t.ll
1112 * RUN: grep "%build_bitcast2 = bitcast i64 %build_ptrtoint to double" < %t.ll
1113 * RUN: grep "%build_bitcast3 = bitcast i64 %build_ptrtoint to double" < %t.ll
1114 * RUN: grep "%build_bitcast4 = bitcast i64 %build_ptrtoint to double" < %t.ll
1115 * RUN: grep "%build_pointercast = bitcast i8* %build_inttoptr to i16*" < %t.ll
11161116 *)
11171117 let inst28 = build_trunc p1 i8_type "build_trunc" atentry in
11181118 let inst29 = build_zext inst28 i32_type "build_zext" atentry in
11421142 end;
11431143
11441144 group "comparisons"; begin
1145 (* RUN: grep {%build_icmp_ne = icmp ne i32 %P1, %P2} < %t.ll
1146 * RUN: grep {%build_icmp_sle = icmp sle i32 %P2, %P1} < %t.ll
1147 * RUN: grep {%build_fcmp_false = fcmp false float %F1, %F2} < %t.ll
1148 * RUN: grep {%build_fcmp_true = fcmp true float %F2, %F1} < %t.ll
1149 * RUN: grep {%build_is_null.*= icmp eq.*%X0,.*null} < %t.ll
1150 * RUN: grep {%build_is_not_null = icmp ne i8\\* %X1, null} < %t.ll
1151 * RUN: grep {%build_ptrdiff} < %t.ll
1145 (* RUN: grep "%build_icmp_ne = icmp ne i32 %P1, %P2" < %t.ll
1146 * RUN: grep "%build_icmp_sle = icmp sle i32 %P2, %P1" < %t.ll
1147 * RUN: grep "%build_fcmp_false = fcmp false float %F1, %F2" < %t.ll
1148 * RUN: grep "%build_fcmp_true = fcmp true float %F2, %F1" < %t.ll
1149 * RUN: grep "%build_is_null.*= icmp eq.*%X0,.*null" < %t.ll
1150 * RUN: grep "%build_is_not_null = icmp ne i8* %X1, null" < %t.ll
1151 * RUN: grep "%build_ptrdiff" < %t.ll
11521152 *)
11531153 ignore (build_icmp Icmp.Ne p1 p2 "build_icmp_ne" atentry);
11541154 ignore (build_icmp Icmp.Sle p2 p1 "build_icmp_sle" atentry);
11641164 end;
11651165
11661166 group "miscellaneous"; begin
1167 (* RUN: grep {%build_call = tail call cc63 i32 @.*(i32 signext %P2, i32 %P1)} < %t.ll
1168 * RUN: grep {%build_select = select i1 %build_icmp, i32 %P1, i32 %P2} < %t.ll
1169 * RUN: grep {%build_va_arg = va_arg i8\\*\\* null, i32} < %t.ll
1170 * RUN: grep {%build_extractelement = extractelement <4 x i32> %Vec1, i32 %P2} < %t.ll
1171 * RUN: grep {%build_insertelement = insertelement <4 x i32> %Vec1, i32 %P1, i32 %P2} < %t.ll
1172 * RUN: grep {%build_shufflevector = shufflevector <4 x i32> %Vec1, <4 x i32> %Vec2, <4 x i32> } < %t.ll
1173 * RUN: grep {%build_insertvalue0 = insertvalue.*%bl, i32 1, 0} < %t.ll
1174 * RUN: grep {%build_extractvalue = extractvalue.*%build_insertvalue1, 1} < %t.ll
1167 (* RUN: grep "%build_call = tail call cc63 i32 @.*(i32 signext %P2, i32 %P1)" < %t.ll
1168 * RUN: grep "%build_select = select i1 %build_icmp, i32 %P1, i32 %P2" < %t.ll
1169 * RUN: grep "%build_va_arg = va_arg i8** null, i32" < %t.ll
1170 * RUN: grep "%build_extractelement = extractelement <4 x i32> %Vec1, i32 %P2" < %t.ll
1171 * RUN: grep "%build_insertelement = insertelement <4 x i32> %Vec1, i32 %P1, i32 %P2" < %t.ll
1172 * RUN: grep "%build_shufflevector = shufflevector <4 x i32> %Vec1, <4 x i32> %Vec2, <4 x i32> " < %t.ll
1173 * RUN: grep "%build_insertvalue0 = insertvalue.*%bl, i32 1, 0" < %t.ll
1174 * RUN: grep "%build_extractvalue = extractvalue.*%build_insertvalue1, 1" < %t.ll
11751175 *)
11761176 let ci = build_call fn [| p2; p1 |] "build_call" atentry in
11771177 insist (CallConv.c = instruction_call_conv ci);
12141214 end;
12151215
12161216 group "metadata"; begin
1217 (* RUN: grep {%metadata = add i32 %P1, %P2, !test !0} < %t.ll
1218 * RUN: grep {!0 = metadata !\{i32 1, metadata !"metadata test"\}} < %t.ll
1217 (* RUN: grep '%metadata = add i32 %P1, %P2, !test !0' < %t.ll
1218 * RUN: grep '!0 = metadata !{i32 1, metadata !"metadata test"}' < %t.ll
12191219 *)
12201220 let i = build_add p1 p2 "metadata" atentry in
12211221 insist ((has_metadata i) = false);
12391239 end;
12401240
12411241 group "dbg"; begin
1242 (* RUN: grep {%dbg = add i32 %P1, %P2, !dbg !1} < %t.ll
1243 * RUN: grep {!1 = metadata !\{i32 2, i32 3, metadata !2, metadata !2\}} < %t.ll
1242 (* RUN: grep "%dbg = add i32 %P1, %P2, !dbg !1" < %t.ll
1243 * RUN: grep "!1 = metadata !{i32 2, i32 3, metadata !2, metadata !2}" < %t.ll
12441244 *)
12451245 insist ((current_debug_location atentry) = None);
12461246
12601260 end;
12611261
12621262 group "phi"; begin
1263 (* RUN: grep {PhiNode.*P1.*PhiBlock1.*P2.*PhiBlock2} < %t.ll
1263 (* RUN: grep "PhiNode.*P1.*PhiBlock1.*P2.*PhiBlock2" < %t.ll
12641264 *)
12651265 let b1 = append_block context "PhiBlock1" fn in
12661266 let b2 = append_block context "PhiBlock2" fn in
None ; RUN: llc < %s -march=arm | not grep {add.*#0}
0 ; RUN: llc < %s -march=arm | not grep "add.*#0"
11
22 define i32 @foo() {
33 entry:
None ; RUN: llc < %s -march=arm | not grep {str.*\\!}
0 ; RUN: llc < %s -march=arm | not grep "str.*\!"
11
22 %struct.shape_edge_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32 }
33 %struct.shape_path_t = type { %struct.shape_edge_t*, %struct.shape_edge_t*, i32, i32, i32, i32, i32, i32 }
0 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: not grep {bx lr}
1 ; RUN: not grep "bx lr"
22
33 %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
44 @r = external global [14 x i32] ; <[14 x i32]*> [#uses=4]
0 ; RUN: llc < %s -march=mips -o %t
1 ; RUN: grep {c\\..*\\.s} %t | count 3
2 ; RUN: grep {bc1\[tf\]} %t | count 3
1 ; RUN: grep "c\..*\.s" %t | count 3
2 ; RUN: grep "bc1[tf]" %t | count 3
33
44 ; FIXME: Disabled because branch instructions are generated where
55 ; conditional move instructions are expected.
None ; RUN: llc < %s -march=mips | grep {b\[ne\]\[eq\]} | count 1
0 ; RUN: llc < %s -march=mips | grep "b[ne][eq]" | count 1
11
22 ; FIXME: Disabled because branch instructions are generated where
33 ; conditional move instructions are expected.
None ; RUN: llc < %s | not grep {, f1}
0 ; RUN: llc < %s | not grep ", f1"
11
22 target datalayout = "E-p:32:32"
33 target triple = "powerpc-apple-darwin8.2.0"
0 ; RUN: llc < %s -march=ppc32 | grep cntlzw
11 ; RUN: llc < %s -march=ppc32 | not grep xori
2 ; RUN: llc < %s -march=ppc32 | not grep {li }
3 ; RUN: llc < %s -march=ppc32 | not grep {mr }
2 ; RUN: llc < %s -march=ppc32 | not grep "li "
3 ; RUN: llc < %s -march=ppc32 | not grep "mr "
44
55 define i1 @test(i64 %x) {
66 %tmp = icmp ult i64 %x, 4294967296
0 ; RUN: llc < %s -march=ppc32 | grep rlwimi
1 ; RUN: llc < %s -march=ppc32 | not grep {or }
1 ; RUN: llc < %s -march=ppc32 | not grep "or "
22
33 ; Make sure there is no register-register copies here.
44
0 ; RUN: llc < %s -mtriple=thumb-apple-darwin \
1 ; RUN: -disable-fp-elim | not grep {r11}
1 ; RUN: -disable-fp-elim | not grep "r11"
22 ; RUN: llc < %s -mtriple=thumb-linux-gnueabi \
3 ; RUN: -disable-fp-elim | not grep {r11}
3 ; RUN: -disable-fp-elim | not grep "r11"
44
55 define i32 @f() {
66 entry:
None ; RUN: llc -relocation-model=pic < %s | grep {:$} | sort | uniq -d | count 0
0 ; RUN: llc -relocation-model=pic < %s | grep ":$" | sort | uniq -d | count 0
11 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
22 target triple = "thumbv7-apple-darwin10"
33
0 ; XFAIL: *
11 ; fixme rev16 pattern is not matching
22
3 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep {rev16\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 1
3 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | grep "rev16\W*r[0-9]*,\W*r[0-9]*" | count 1
44
55 ; 0xff00ff00 = 4278255360
66 ; 0x00ff00ff = 16711935
0 ; RUN: llc < %s -march=x86 | \
1 ; RUN: not grep {.byte\[\[:space:\]\]*true}
1 ; RUN: not grep ".byte[[:space:]]*true"
22
33 @X = global i1 true ; [#uses=0]
None ; RUN: llc < %s -march=x86 -mcpu=yonah | not grep {j\[lgbe\]}
0 ; RUN: llc < %s -march=x86 -mcpu=yonah | not grep "j[lgbe]"
11
22 define i32 @max(i32 %A, i32 %B) nounwind {
33 %gt = icmp sgt i32 %A, %B ; [#uses=1]
None ; RUN: llc < %s -march=x86 | not grep {subl.*%esp}
0 ; RUN: llc < %s -march=x86 | not grep "subl.*%esp"
11
22 define i32 @f(i32 %a, i32 %b) {
33 %tmp.2 = mul i32 %a, %a ; [#uses=1]
0 ; RUN: llc < %s -march=x86 -mcpu=yonah -stats 2>&1 | \
1 ; RUN: not grep {Number of register spills}
1 ; RUN: not grep "Number of register spills"
22 ; END.
33
44
None ; RUN: llc < %s -march=x86 -relocation-model=static | not grep {subl.*%esp}
0 ; RUN: llc < %s -march=x86 -relocation-model=static | not grep "subl.*%esp"
11
22 @A = external global i16* ; [#uses=1]
33 @B = external global i32 ; [#uses=1]
0 ; RUN: llc < %s -march=x86 -mcpu=i386 | \
1 ; RUN: not grep {movl %eax, %edx}
1 ; RUN: not grep "movl %eax, %edx"
22
33 define i32 @foo(i32 %t, i32 %C) {
44 entry:
None ; RUN: llc < %s | not grep {bsrl.*10}
0 ; RUN: llc < %s | not grep "bsrl.*10"
11 ; PR1356
22
33 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
None ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -disable-fp-elim | not grep {addl .12, %esp}
0 ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -disable-fp-elim | not grep "addl .12, %esp"
11 ; PR1398
22
33 %struct.S = type { i32, i32 }
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -x86-asm-syntax=intel | not grep {lea\[\[:space:\]\]R}
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -x86-asm-syntax=intel | not grep "lea[[:space:]]R"
11
22 %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
33 %struct.AGenericManager = type <{ i8 }>
None ; RUN: llc < %s | grep {a:} | not grep ax
1 ; RUN: llc < %s | grep {b:} | not grep ax
0 ; RUN: llc < %s | grep "a:" | not grep ax
1 ; RUN: llc < %s | grep "b:" | not grep ax
22 ; PR2078
33 ; The clobber list says that "ax" is clobbered. Make sure that eax isn't
44 ; allocated to the input/output register.
None ; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose | grep {#} | not grep -v {##}
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -asm-verbose | grep "#" | not grep -v "##"
11
22 %struct.AGenericCall = type { %struct.AGenericManager*, %struct.ComponentParameters*, i32* }
33 %struct.AGenericManager = type <{ i8 }>
None ; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep {, %e}
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -disable-cgp-branch-opts | grep movw | not grep ", %e"
11
22 %struct.DBC_t = type { i32, i8*, i16, %struct.DBC_t*, i8*, i8*, i8*, i8*, i8*, %struct.DBC_t*, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i32*, i8, i16, %struct.DRVOPT*, i16 }
33 %struct.DRVOPT = type { i16, i32, i8, %struct.DRVOPT* }
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | grep movl > %t
1 ; RUN: not grep {r\[abcd\]x} %t
2 ; RUN: not grep {r\[ds\]i} %t
3 ; RUN: not grep {r\[bs\]p} %t
1 ; RUN: not grep "r[abcd]x" %t
2 ; RUN: not grep "r[ds]i" %t
3 ; RUN: not grep "r[bs]p" %t
44
55 %struct.BITMAP = type { i16, i16, i32, i32, i32, i32, i32, i32, i8*, i8* }
66 %struct.BltData = type { float, float, float, float }
None ; RUN: llc < %s -march=x86 -mattr=+sse2 -o - | not grep {ucomiss\[^,\]*esp}
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 -o - | not grep "ucomiss[^,]*esp"
11
22 define void @f(float %wt) {
33 entry:
None ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 | not grep {.space}
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 | not grep ".space"
11 ; rdar://6668548
22
33 declare double @llvm.sqrt.f64(double) nounwind readonly
0 ; RUN: llc < %s -mtriple=x86_64-linux -relocation-model=static -o /dev/null -stats -info-output-file - > %t
11 ; RUN: not grep spill %t
2 ; RUN: not grep {%rsp} %t
3 ; RUN: not grep {%rbp} %t
2 ; RUN: not grep "%rsp" %t
3 ; RUN: not grep "%rbp" %t
44
55 ; The register-pressure scheduler should be able to schedule this in a
66 ; way that does not require spills.
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats 2>&1 | grep {Number of modref unfolded}
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10.0 -relocation-model=pic -disable-fp-elim -stats 2>&1 | grep "Number of modref unfolded"
11 ; XFAIL: *
22 ; 69408 removed the opportunity for this optimization to work
33
None ; RUN: llc < %s -march=x86-64 | not grep {movzbl %\[abcd\]h,}
0 ; RUN: llc < %s -march=x86-64 | not grep "movzbl %[abcd]h,"
11
22 define void @BZ2_bzDecompress_bb5_2E_outer_bb35_2E_i_bb54_2E_i(i32*, i32 %c_nblock_used.2.i, i32 %.reload51, i32* %.out, i32* %.out1, i32* %.out2, i32* %.out3) nounwind {
33 newFuncRoot:
0 ; RUN: llc < %s -march=x86-64 -relocation-model=pic > %t
1 ; RUN: grep {movswl %ax, %edi} %t
2 ; RUN: grep {movw (%rax), %ax} %t
1 ; RUN: grep "movswl %ax, %edi" %t
2 ; RUN: grep "movw (%rax), %ax" %t
33 ; XFAIL: *
44
55 @x = common global i16 0
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -stats 2>&1 | \
1 ; RUN: not grep {Number of machine instructions hoisted out of loops post regalloc}
1 ; RUN: not grep "Number of machine instructions hoisted out of loops post regalloc"
22
33 ; rdar://11095580
44
66 ; Check that the shift gets turned into an LEA.
77
88 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
9 ; RUN: not grep {mov E.X, E.X}
9 ; RUN: not grep "mov E.X, E.X"
1010
1111 @G = external global i32 ; [#uses=1]
1212
None ; RUN: llc < %s -march=x86 -stats 2>&1 | not grep {instructions sunk}
0 ; RUN: llc < %s -march=x86 -stats 2>&1 | not grep "instructions sunk"
11 ; PR3522
22
33 target triple = "i386-pc-linux-gnu"
11 ;; neither of them should require spilling anything to the stack.
22
33 ; RUN: llc < %s -march=x86 -stats 2>&1 | \
4 ; RUN: not grep {Number of register spills}
4 ; RUN: not grep "Number of register spills"
55
66 ;; This can be compiled to use three registers if the loads are not
77 ;; folded into the multiplies, 2 registers otherwise.
22 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu > %t
33 ; RUN: not grep xor %t
44 ; RUN: not grep movap %t
5 ; RUN: grep {\\.quad.*0} %t
5 ; RUN: grep "\.quad.*0" %t
66
77 ; Remat should be able to fold the zero constant into the div instructions
88 ; as a constant-pool load.
44 ; RUN: not grep negq %t
55 ; RUN: not grep addq %t
66 ; RUN: not grep subq %t
7 ; RUN: not grep {movl %} %t
7 ; RUN: not grep "movl %" %t
88
99 ; Utilize implicit zero-extension on x86-64 to eliminate explicit
1010 ; zero-extensions. Shrink 64-bit adds to 32-bit when the high
None ; RUN: llc < %s -march=x86 -mcpu=yonah | not grep {sub.*esp}
0 ; RUN: llc < %s -march=x86 -mcpu=yonah | not grep "sub.*esp"
11 ; RUN: llc < %s -march=x86 -mcpu=yonah | grep cvtsi2ss
22 ; rdar://6034396
33
None ; RUN: llc < %s -march=x86 | grep {jc} | count 1
0 ; RUN: llc < %s -march=x86 | grep "jc" | count 1
11 ; XFAIL: *
22
33 ; FIXME: umul-with-overflow not supported yet.
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # LDR_PRE/POST has encoding Inst{4} = 0.
None # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=737 Name=VLD1DUPq8_UPD Format=ARM_FORMAT_NLdSt(30)
None # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=1225 Name=VQADDsv16i8 Format=ARM_FORMAT_N3Reg(37)
None # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=armv7-unknown-unknwon -mcpu=cortex-a8 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=1641 Name=VST2b32_UPD Format=ARM_FORMAT_NLdSt(30)
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=1934 Name=t2LDREXD Format=ARM_FORMAT_THUMBFRM(25)
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=2124 Name=t2STRD_PRE Format=ARM_FORMAT_THUMBFRM(25)
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 2>&1 | grep "invalid instruction encoding"
11 # XFAIL: *
22
33 # Opcode=2127 Name=t2STREXB Format=ARM_FORMAT_THUMBFRM(25)
None ; RUN: llvm-as < %s | llvm-dis | not grep {void@}
0 ; RUN: llvm-as < %s | llvm-dis | not grep "void@"
11 ; PR2894
22 declare void @g()
33 define void @f() {
0 ; RUN: opt < %s -argpromotion -S | \
1 ; RUN: not grep {load i32\* null}
1 ; RUN: not grep "load i32* null"
22
33 define internal i32 @callee(i1 %C, i32* %P) {
44 br i1 %C, label %T, label %F
44 ; Fix #2: The unary not instruction now no longer exists. Change to xor.
55
66 ; RUN: opt < %s -constprop -S | \
7 ; RUN: not grep {i32 0}
7 ; RUN: not grep "i32 0"
88
99 define i32 @test1() {
1010 %R = xor i32 123, -1 ; [#uses=1]
0 ; RUN: opt < %s -constprop -S | \
1 ; RUN: not grep {ret i1 false}
1 ; RUN: not grep "ret i1 false"
22
33 @b = external global [2 x { }] ; <[2 x { }]*> [#uses=2]
44
None ; RUN: opt < %s -deadargelim -S | not grep {ret i32 0}
0 ; RUN: opt < %s -deadargelim -S | not grep "ret i32 0"
11 ; PR1735
22
33 define internal i32 @test(i32 %A, ...) {
None ; RUN: opt < %s -basicaa -gvn -S | not grep {tmp10 =}
0 ; RUN: opt < %s -basicaa -gvn -S | not grep "tmp10 ="
11
22 %struct.INT2 = type { i32, i32 }
33 @blkshifts = external global %struct.INT2* ; <%struct.INT2**> [#uses=2]
None ; RUN: opt < %s -basicaa -gvn -S | not grep {tmp701 =}
0 ; RUN: opt < %s -basicaa -gvn -S | not grep "tmp701 ="
11
22 @img_width = external global i16 ; [#uses=2]
33
None ; RUN: opt < %s -gvn -S | not grep {%z2 =}
0 ; RUN: opt < %s -gvn -S | not grep "%z2 ="
11
22 define i32 @main() {
33 block1:
0 ; PR1015
1 ; RUN: opt < %s -indvars -S | not grep {ret i32 0}
1 ; RUN: opt < %s -indvars -S | not grep "ret i32 0"
22
33 target datalayout = "e-p:32:32"
44 target triple = "i686-apple-darwin8"
None ; RUN: opt < %s -indvars -S | not grep {sext}
0 ; RUN: opt < %s -indvars -S | not grep "sext"
11 ; ModuleID = ''
22 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n32:64"
33 target triple = "x86_64-apple-darwin9.6"
None ; RUN: opt < %s -indvars -instcombine -S | not grep {\[sz\]ext}
0 ; RUN: opt < %s -indvars -instcombine -S | not grep "[sz]ext"
11 ; ModuleID = ''
22 ;extern int *a, *b, *c, *d, *e, *f; /* 64 bit */
33 ;extern int K[256];
0 ; RUN: opt < %s -indvars -S \
1 ; RUN: | grep {%b.1 = phi i32 \\\[ 2, %bb \\\], \\\[ 1, %bb2 \\\]}
1 ; RUN: | grep "%b.1 = phi i32 [ 2, %bb ], [ 1, %bb2 ]"
22 ;
33 ; This loop has multiple exits, and the value of %b1 depends on which
44 ; exit is taken. Indvars should correctly compute the exit values.
0 ; RUN: opt < %s -indvars -S > %t
1 ; RUN: grep {\[%\]tmp7 = icmp eq i8 -28, -28} %t
2 ; RUN: grep {\[%\]tmp8 = icmp eq i8 63, 63} %t
1 ; RUN: grep "[%]tmp7 = icmp eq i8 -28, -28" %t
2 ; RUN: grep "[%]tmp8 = icmp eq i8 63, 63" %t
33 ; PR4477
44 ; Indvars should compute the exit values in loop.
55 ;
None ; RUN: opt < %s -inline -S | not grep {invoke void asm}
0 ; RUN: opt < %s -inline -S | not grep "invoke void asm"
11 ; PR1335
22
33 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
None ; RUN: opt < %s -inline -S | not grep {tail call void @llvm.memcpy.i32}
0 ; RUN: opt < %s -inline -S | not grep "tail call void @llvm.memcpy.i32"
11 ; PR3550
22
33 define internal void @foo(i32* %p, i32* %q) {
11 ; instructions
22
33 ; RUN: opt < %s -inline -S | \
4 ; RUN: not grep {call\[^e\]}
4 ; RUN: not grep "call[^e]"
55
66 declare void @might_throw()
77
0 ; RUN: opt < %s -instcombine -mem2reg -S | \
1 ; RUN: not grep {i32 1}
1 ; RUN: not grep "i32 1"
22
33 ; When propagating the load through the select, make sure that the load is
44 ; inserted where the original load was, not where the select is. Not doing
0 ; RUN: opt < %s -instcombine -mem2reg -simplifycfg | \
1 ; RUN: llvm-dis | grep -v store | not grep {i32 1}
1 ; RUN: llvm-dis | grep -v store | not grep "i32 1"
22
33 ; Test to make sure that instcombine does not accidentally propagate the load
44 ; into the PHI, which would break the program.
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: not grep {ret i1 false}
1 ; RUN: not grep "ret i1 false"
22
33 define i1 @test(i64 %tmp.169) {
44 %tmp.1710 = lshr i64 %tmp.169, 1 ; [#uses=1]
0 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
11 target triple = "i686-pc-linux-gnu"
2 ; RUN: opt < %s -instcombine -S | not grep {ret i1 0}
2 ; RUN: opt < %s -instcombine -S | not grep "ret i1 0"
33 ; PR1850
44
55 define i1 @test() {
None ; RUN: opt < %s -instcombine -S | not grep {a.off}
0 ; RUN: opt < %s -instcombine -S | not grep "a.off"
11 ; PR1949
22
33 define i1 @test1(i32 %a) {
None ; RUN: opt < %s -instcombine -S | not grep {sub i32 0}
0 ; RUN: opt < %s -instcombine -S | not grep "sub i32 0"
11 ; PR2330
22
33 define i32 @foo(i32 %a) nounwind {
None ; RUN: opt < %s -instcombine -S | not grep {store }
0 ; RUN: opt < %s -instcombine -S | not grep "store "
11 ; PR2296
22
33 @G = common global double 0.000000e+00, align 16
None ; RUN: opt < %s -instcombine -scalarrepl -S | not grep { = alloca}
0 ; RUN: opt < %s -instcombine -scalarrepl -S | not grep " = alloca"
11 ; rdar://6417724
22 ; Instcombine shouldn't do anything to this function that prevents promoting the allocas inside it.
33
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: grep select | not grep {i32\\*}
1 ; RUN: grep select | not grep 'i32\*'
22
33 ; This testcase corresponds to PR362, which notices that this horrible code
44 ; is generated by the C++ front-end and LLVM optimizers, which has lots of
99 ; Which corresponds to test1.
1010
1111 ; RUN: opt < %s -instcombine -S | \
12 ; RUN: not grep {or }
12 ; RUN: not grep "or "
1313
1414 define i32 @test1(i32 %X, i32 %Y) {
1515 %A = and i32 %X, 7 ; [#uses=1]
0 ; RUN: opt < %s -instcombine -S | grep xor | count 4
11 ; RUN: opt < %s -instcombine -S | not grep and
2 ; RUN: opt < %s -instcombine -S | not grep { or}
2 ; RUN: opt < %s -instcombine -S | not grep " or"
33
44 ; PR1510
55
1010 ;
1111 ; This tests arbitrary precision integers.
1212
13 ; RUN: opt < %s -instcombine -S | not grep {or }
13 ; RUN: opt < %s -instcombine -S | not grep "or "
1414 ; END.
1515
1616 define i17 @test1(i17 %X, i17 %Y) {
0 ; This test makes sure that and instructions are properly eliminated.
11 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
22
3 ; RUN: opt < %s -instcombine -S | not grep {and }
3 ; RUN: opt < %s -instcombine -S | not grep "and "
44 ; END.
55
66 define i39 @test0(i39 %A) {
0 ; This test makes sure that and instructions are properly eliminated.
11 ; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
22
3 ; RUN: opt < %s -instcombine -S | not grep {and }
3 ; RUN: opt < %s -instcombine -S | not grep "and "
44 ; END.
55
66
22 ;
33
44 ; RUN: opt < %s -instcombine -S | \
5 ; RUN: grep -v {sub i19 %Cok, %Bok} | grep -v {sub i25 0, %Aok} | not grep sub
5 ; RUN: grep -v "sub i19 %Cok, %Bok" | grep -v "sub i25 0, %Aok" | not grep sub
66 ; END.
77
88 define i23 @test1(i23 %A) {
0 ; This test makes sure that xor instructions are properly eliminated.
11 ; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
22
3 ; RUN: opt < %s -instcombine -S | not grep {xor }
3 ; RUN: opt < %s -instcombine -S | not grep "xor "
44
55
66 define i47 @test1(i47 %A, i47 %B) {
0 ; This test makes sure that xor instructions are properly eliminated.
11 ; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
22
3 ; RUN: opt < %s -instcombine -S | not grep {xor }
3 ; RUN: opt < %s -instcombine -S | not grep "xor "
44 ; END.
55
66
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22 ; RUN: opt < %s -instcombine -S | \
3 ; RUN: not grep {tobool}
3 ; RUN: not grep "tobool"
44 ; END.
55 define i32 @main(i32 %argc, i8** %argv) nounwind ssp {
66 entry:
0 ; RUN: opt < %s -instcombine -simplifycfg -S |\
1 ; RUN: not grep {call void @abort}
1 ; RUN: not grep "call void @abort"
22
33 @b_rec.0 = external global i32 ; [#uses=2]
44
0 ; This test makes sure that memmove instructions are properly eliminated.
11 ;
2 ; RUN: opt < %s -instcombine -S | not grep {call void @llvm.memmove}
2 ; RUN: opt < %s -instcombine -S | not grep "call void @llvm.memmove"
33
44 @S = internal constant [33 x i8] c"panic: restorelist inconsistency\00" ; <[33 x i8]*> [#uses=1]
55 @h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
None ; RUN: opt < %s -instcombine -S | not grep {call.*llvm.memset}
0 ; RUN: opt < %s -instcombine -S | not grep "call.*llvm.memset"
11
22 define i32 @main() {
33 %target = alloca [1024 x i8]
22 ; into equivalent setne,eq instructions.
33 ;
44 ; RUN: opt < %s -instcombine -S | \
5 ; RUN: grep -v {icmp eq} | grep -v {icmp ne} | not grep icmp
5 ; RUN: grep -v "icmp eq" | grep -v "icmp ne" | not grep icmp
66 ; END.
77
88 define i1 @test1(i32 %A) {
None ; RUN: opt < %s -instcombine -S | not grep {shufflevector.\*i32 8}
0 ; RUN: opt < %s -instcombine -S | not grep "shufflevector.*i32 8"
11
22 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
33 target triple = "i386-apple-darwin9"
0 ; This test makes sure that these instructions are properly eliminated.
11 ;
22 ; RUN: opt < %s -instcombine -S | \
3 ; RUN: not grep {xor }
3 ; RUN: not grep "xor "
44 ; END.
55 @G1 = global i32 0 ; [#uses=1]
66 @G2 = global i32 0 ; [#uses=1]
0 ; There should be no phi nodes left.
1 ; RUN: opt < %s -jump-threading -S | not grep {phi i32}
1 ; RUN: opt < %s -jump-threading -S | not grep "phi i32"
22
33 declare i32 @f1()
44 declare i32 @f2()
33 ; case... bad.
44
55 ; RUN: opt < %s -licm -loop-deletion -simplifycfg -S | \
6 ; RUN: not grep {br }
6 ; RUN: not grep "br "
77
88 define i32 @main(i32 %argc) {
99 ;
None ; RUN: opt < %s -loop-rotate -verify-dom-info -verify-loop-info -S | not grep {\\\[ .tmp224}
0 ; RUN: opt < %s -loop-rotate -verify-dom-info -verify-loop-info -S | not grep "[ .tmp224"
11 ; END.
22 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
33
0 ; RUN: opt < %s -loop-reduce -S | \
1 ; RUN: not grep {bitcast i32 1 to i32}
1 ; RUN: not grep "bitcast i32 1 to i32"
22 ; END.
33 ; The setlt wants to use a value that is incremented one more than the dominant
44 ; IV. Don't insert the 1 outside the loop, preventing folding it into the add.
0 ; Check that the index of 'P[outer]' is pulled out of the loop.
11 ; RUN: opt < %s -loop-reduce -S | \
2 ; RUN: not grep {getelementptr.*%outer.*%INDVAR}
2 ; RUN: not grep "getelementptr.*%outer.*%INDVAR"
33
44 target datalayout = "e-p:32:32:32-n8:16:32"
55 declare i1 @pred()
0 ; Check that the index of 'P[outer]' is pulled out of the loop.
11 ; RUN: opt < %s -loop-reduce -S | \
2 ; RUN: not grep {getelementptr.*%outer.*%INDVAR}
2 ; RUN: not grep "getelementptr.*%outer.*%INDVAR"
33
44 target datalayout = "e-p:32:32:32-n32"
55 declare i1 @pred()
0 ; Base should not be i*3, it should be i*2.
11 ; RUN: opt < %s -loop-reduce -S | \
2 ; RUN: not grep {mul.*%i, 3}
2 ; RUN: not grep "mul.*%i, 3"
33
44 ; Indvar should not start at zero:
55 ; RUN: opt < %s -loop-reduce -S | \
6 ; RUN: not grep {phi i32 .* 0}
6 ; RUN: not grep "phi i32 .* 0"
77 ; END.
88
99 ; mul uint %i, 3
None ; RUN: opt < %s -basicaa -memcpyopt -dse -S | grep {call.*initialize} | not grep memtmp
0 ; RUN: opt < %s -basicaa -memcpyopt -dse -S | grep "call.*initialize" | not grep memtmp
11 ; PR2077
22
33 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
None ; RUN: opt < %s -basicaa -memcpyopt -S | not grep {call.*memcpy.}
0 ; RUN: opt < %s -basicaa -memcpyopt -S | not grep "call.*memcpy."
11 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
22
33 %a = type { i32 }
None ; RUN: opt < %s -basicaa -memcpyopt -S | not grep {call.*memcpy}
0 ; RUN: opt < %s -basicaa -memcpyopt -S | not grep "call.*memcpy"
11
22 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
33 target triple = "i686-apple-darwin9"
0 ; RUN: opt < %s -mergefunc -S > %t
1 ; RUN: grep {define weak} %t | count 2
2 ; RUN: grep {call} %t | count 2
1 ; RUN: grep "define weak" %t | count 2
2 ; RUN: grep "call" %t | count 2
33 ; XFAIL: *
44
55 ; This test is off for a bit as we change this particular sort of folding to
None ; RUN: opt < %s -mergefunc -stats -disable-output 2>&1 | not grep {functions merged}
0 ; RUN: opt < %s -mergefunc -stats -disable-output 2>&1 | not grep "functions merged"
11
22 define i32 @foo1(i32 %x) {
33 entry:
None ; RUN: opt < %s -prune-eh -S | not grep {ret i32}
0 ; RUN: opt < %s -prune-eh -S | not grep "ret i32"
11
22 declare void @noreturn() noreturn
33
None ; RUN: opt < %s -sccp -S | not grep {ret i32 undef}
0 ; RUN: opt < %s -sccp -S | not grep "ret i32 undef"
11 ; PR2358
22 target datalayout =
33 "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
None ; RUN: opt < %s -ipsccp -S | grep -v {ret i101 0} | \
1 ; RUN: grep -v {ret i101 undef} | not grep ret
0 ; RUN: opt < %s -ipsccp -S | grep -v "ret i101 0" | \
1 ; RUN: grep -v "ret i101 undef" | not grep ret
22
33
44 define internal i101 @bar(i101 %A) {
0 ; PR1226
11 ; RUN: opt < %s -scalarrepl -S | \
2 ; RUN: not grep {call void @llvm.memcpy.i32}
2 ; RUN: not grep "call void @llvm.memcpy.i32"
33 ; RUN: opt < %s -scalarrepl -S | grep getelementptr
44 ; END.
55
11 ; 'br Dest'
22
33 ; RUN: opt < %s -simplifycfg -S | \
4 ; RUN: not grep {br i1 %c2}
4 ; RUN: not grep "br i1 %c2"
55
66 declare void @noop()
77
33 ; the ConstantFoldTerminator function.
44
55 ; RUN: opt < %s -simplifycfg -S | \
6 ; RUN: not grep {br i1 %c2}
6 ; RUN: not grep "br i1 %c2"
77
88 declare void @noop()
99
0 ; RUN: opt < %s -simplifycfg -S | \
1 ; RUN: not grep {br label}
1 ; RUN: not grep "br label"
22
33 define void @test(i1 %C) {
44 br i1 %C, label %A, label %B
0 ; RUN: opt < %s -simplifycfg -S | \
1 ; RUN: not grep {icmp eq}
1 ; RUN: not grep "icmp eq"
22
33 ; Check that simplifycfg deletes a dead 'seteq' instruction when it
44 ; folds a conditional branch into a switch instruction.
22 ; important case. This is basically the most trivial form of tail-duplication.
33
44 ; RUN: opt < %s -simplifycfg -S | \
5 ; RUN: not grep {br label}
5 ; RUN: not grep "br label"
66
77 define i32 @test(i1 %B, i32 %A, i32 %B.upgrd.1) {
88 br i1 %B, label %T, label %F
0 ; RUN: opt < %s -simplifycfg -adce -S | \
1 ; RUN: not grep {call void @f1}
1 ; RUN: not grep "call void @f1"
22 ; END.
33
44 declare void @f1()
0 ; RUN: opt < %s -simplifycfg -S | \
1 ; RUN: not grep {call void @DEAD}
1 ; RUN: not grep "call void @DEAD"
22
33 ; Test that we can thread a simple known condition through switch statements.
44
0 ; Test that the ToAsciiOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*@ffs}
2 ; RUN: not grep "call.*@ffs"
33
44 @non_const = external global i32 ; [#uses=1]
55
0 ; Test that the FPrintFOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*fprintf}
2 ; RUN: not grep "call.*fprintf"
33
44 ; This transformation requires the pointer size, as it assumes that size_t is
55 ; the size of a pointer.
0 ; Test that the FPutsOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*fputs}
2 ; RUN: not grep "call.*fputs"
33
44 ; This transformation requires the pointer size, as it assumes that size_t is
55 ; the size of a pointer.
None ; RUN: opt < %s -constprop -instcombine -S | not grep {call.*llvm.memcpy.i32}
0 ; RUN: opt < %s -constprop -instcombine -S | not grep "call.*llvm.memcpy.i32"
11
22 @h = constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
33 @hel = constant [4 x i8] c"hel\00" ; <[4 x i8]*> [#uses=1]
0 ; Test that the SPrintFOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*sprintf}
2 ; RUN: not grep "call.*sprintf"
33
44 ; This transformation requires the pointer size, as it assumes that size_t is
55 ; the size of a pointer.
0 ; Test that the StrCatOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*strlen}
2 ; RUN: not grep "call.*strlen"
33
44 target datalayout = "e-p:32:32"
55 @hello = constant [6 x i8] c"hello\00" ; <[6 x i8]*> [#uses=3]
0 ; Test that the StrNCpyOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*strncpy}
2 ; RUN: not grep "call.*strncpy"
33
44 ; This transformation requires the pointer size, as it assumes that size_t is
55 ; the size of a pointer.
0 ; Test that the ToAsciiOptimizer works correctly
11 ; RUN: opt < %s -simplify-libcalls -S | \
2 ; RUN: not grep {call.*toascii}
2 ; RUN: not grep "call.*toascii"
33
44 declare i32 @toascii(i32)
55
0 ; Testcase for calls to the standard C "pow" function
11 ;
2 ; RUN: opt < %s -simplify-libcalls -S | not grep {call .pow}
2 ; RUN: opt < %s -simplify-libcalls -S | not grep "call .pow"
33
44
55 declare double @pow(double, double)
None ; RUN: llvm-as < %s 2>&1 | not grep {Instruction operands must be first-class}
0 ; RUN: llvm-as < %s 2>&1 | not grep "Instruction operands must be first-class"
11
22 ; This previously was for PR826, but structs are now first-class so
33 ; the following is now valid.