llvm.org GIT mirror llvm / 43b4003
For PR1319: Fix syntax of tests to ensure grep pattern is properly quoted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36134 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
51 changed file(s) with 81 addition(s) and 65 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-upgrade < %s | llvm-as | \
1 ; RUN: opt -aa-eval -disable-output |& grep '2 no alias respon'
1 ; RUN: opt -aa-eval -disable-output |& grep {2 no alias respon}
22
33 ;; TEST that A[1][0] may alias A[0][i].
44
0 ; Make sure we don't get an assertion failure, even though this is a parse
11 ; error
2 ; RUN: llvm-as < %s -o /dev/null -f |& grep 'No arguments'
2 ; RUN: llvm-as < %s -o /dev/null -f |& grep {No arguments}
33
44 %ty = type void (i32)
55
None ; RUN: llvm-as < %s >/dev/null |& grep "Expected type 'i32' for element #0"
0 ; RUN: llvm-as < %s >/dev/null |& grep {Expected type 'i32' for element #0}
11 ; Test the case of a misformed constant initializer
22 ; This should cause an assembler error, not an assertion failure!
33 constant { i32 } { float 1.0 }
None ; RUN: llvm-as < %s -o /dev/null -f |& grep 'Undefined type remains'
0 ; RUN: llvm-as < %s -o /dev/null -f |& grep {Undefined type remains}
11 ; END.
22
33 @d_reduction_0_dparser_gram = global {
0 ; This test checks to make sure that constant exprs fold in some simple
11 ; situations
22
3 ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep '(' &&
4 ; RUN: llvm-upgrade < %s | llvm-as
3 ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | not grep {(}
54
65 %A = global long 0
76
None // RUN: %llvmgxx %s -S -o - | not grep 'llvm.global_ctor'
0 // RUN: %llvmgxx %s -S -o - | not grep llvm.global_ctor
11
22 struct S {
33 int A[2];
None // RUN: %llvmgxx %s -emit-llvm -S -o - &&
1 // RUN: %llvmgxx %s -emit-llvm -S -o - | not grep 'gnu.linkonce.'
0 // RUN: %llvmgxx %s -emit-llvm -S -o - | not grep gnu.linkonce.
21 // PR1085
32
43 class
None // RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep 'warning'
0 // RUN: %llvmgcc -xc %s -S -o /dev/null |& not grep warning
11
22 struct item {
33 short delta[4];
None // RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep 'call.*__builtin'
0 // RUN: %llvmgcc %s -S -o - | llvm-as | llvm-dis | not grep call.*__builtin
11
22 int G, H, I;
33 void foo(int P) {
66 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mcpu=ev56 | \
77 ; RUN: not grep -i ctpop
88 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=alpha -mattr=-CIX | \
9 ; RUN: not grep -i 'ctpop'
9 ; RUN: not grep -i ctpop
1010 ; XFAIL: *
1111
1212 declare long %llvm.ctpop.i64(long)
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep 'extern.*msg'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=c | not grep extern.*msg
11
22 ; This is PR472
33
None ; RUN: llvm-as < %s | llc -march=x86 | grep '8388635' &&
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep '4294981120'
0 ; RUN: llvm-as < %s | llc -march=x86 | grep 8388635 &&
1 ; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120
22 ; PR 1325
33
44 ; FIXME: this is xfailed until we figure out ppc bootstrap
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep '.comm.*X,0'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep .comm.*X,0
11
22 %X = linkonce global {} {}
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep 'ori\|lis'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | not grep {ori\\|lis}
11
22 int %test(int %X) {
33 %Y = and int %X, 32769 ; andi. r3, r3, 32769
None ; RUN: llvm-as < %s | llc -march=ppc32 &&
1 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'extsh\|rlwinm'
0 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep {extsh\\|rlwinm}
21
32 declare i16 @foo() sext
43
22 ; is invalid code (there is no correct way to order the instruction). Check
33 ; that we do not fold the load into the sub.
44
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'sub.*GLOBAL'
5 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep sub.*GLOBAL
66
77 %GLOBAL = external global int
88
0 ; XFAIL: *
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep 'jmp \*ecx'
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep {jmp \\*ecx}
22 declare int %putchar(int)
33
44 int %main(){
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'subl.*%esp'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep {subl.*%esp}
11
22 int %f(int %a, int %b) {
33 %tmp.2 = mul int %a, %a
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -relocation-model=static | not grep 'subl.*%esp'
0 ; RUN: llvm-upgrade < %s | llvm-as | \
1 ; RUN: llc -march=x86 -relocation-model=static | not grep {subl.*%esp}
12
23 %A = external global ushort*
34 %B = external global uint
None ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | grep leaq &&
1 ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | not grep ',%rsp)'
0 ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | grep leaq
1 ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | not grep {,%rsp)}
22 ; PR1103
33
44 target datalayout = "e-p:64:64"
0 ; RUN: llvm-as < %s | llc -march=x86 | grep {orl \$1, %eax}
1 ; RUN: llvm-as < %s | llc -march=x86 | grep {leal 3(,%eax,8)'
1 ; RUN: llvm-as < %s | llc -march=x86 | grep {leal 3(,%eax,8)}
22
33 ;; This example can't fold the or into an LEA.
44 define i32 @test(float ** %tmp2, i32 %tmp12) {
66 ; Check that the shift gets turned into an LEA.
77
88 ; RUN: llvm-upgrade < %s | llvm-as | llc -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 ; FIXME: We need live variable information about flags to do this xform safely. :(
1212 ; XFAIL: *
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'set'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep set
11
22 declare bool %llvm.isunordered.f32(float, float)
33
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep 'leal'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | not grep leal
11
22 %x = external global int
33
0 ; An integer truncation to i1 should be done with an and instruction to make
11 ; sure only the LSBit survives. Test that this is the case both for a returned
22 ; value and as the operand of a branch.
3 ; RUN: llvm-as < %s | llc -march=x86 &&
4 ; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | \
3 ; RUN: llvm-as < %s | llc -march=x86 | grep {\\(and\\)\\|\\(test.*\\\$1\\)} | \
54 ; RUN: wc -l | grep 6
65
76 define i1 @test1(i32 %X) zext {
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 &&
1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 &&
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | grep unpckhps | wc -l | grep 1 &&
3 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | not grep 'sub.*esp'
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
1 ; RUN: grep unpcklps | wc -l | grep 1
2 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
3 ; RUN: grep unpckhps | wc -l | grep 1
4 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 | \
5 ; RUN: not grep {sub.*esp}
46
57 void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B) {
68 %tmp = load <4 x float>* %B ; <<4 x float>> [#uses=2]
None // RUN: tblgen %s | grep 'dag d = (X Y)' &&
1 // RUN: tblgen %s | grep 'dag e = (Y X)'
0 // RUN: tblgen %s | grep {dag d = (X Y)}
1 // RUN: tblgen %s | grep {dag e = (Y X)}
22 def X;
33
44 class yclass;
None // RUN: tblgen %s | grep 'dag d = (X 13)'
0 // RUN: tblgen %s | grep {dag d = (X 13)}
11 def X;
22
33 class C {
0 ; SetCC on boolean values was not implemented!
11
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | not grep 'set'
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | \
3 ; RUN: not grep set
34
45 bool "test1"() {
56 %A = setle bool true, false
0 ; Ensure constant propogation of logical instructions is working correctly.
11
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | not egrep 'and|or|xor'
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -die | llvm-dis | \
3 ; RUN: not egrep {and|or|xor}
34
45
56 int "test1"() { %R = and int 4,1234 ret int %R }
0 ; The induction variable canonicalization pass shouldn't leave dead
11 ; instructions laying around!
22 ;
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | not grep '#uses=0'
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | \
4 ; RUN: not grep {#uses=0}
45
56 int %mul(int %x, int %y) {
67 entry:
0 ; Check that the index of 'P[outer]' is pulled out of the loop.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'getelementptr.*%outer.*%INDVAR'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
2 ; RUN: not grep {getelementptr.*%outer.*%INDVAR}
23
34 declare bool %pred()
45 declare int %foo()
0 ; Check that the index of 'P[outer]' is pulled out of the loop.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'getelementptr.*%outer.*%INDVAR'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
2 ; RUN: not grep {getelementptr.*%outer.*%INDVAR}
23
34 declare bool %pred()
45
0 ; Check that variable strides are reduced to adds instead of multiplies.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'mul'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep mul
22
33 declare bool %pred(int)
44
0 ; Simple sanity check testcase. Both alloca's should be eliminated.
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep 'alloca'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg | llvm-dis | not grep alloca
22
33 implementation
44
None ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -dce | llvm-dis | not grep '\(and\|sub\)'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -reassociate -dce | llvm-dis | \
1 ; RUN: not grep {\\(and\\|sub\\)}
12
23 int %test1(int %a, int %b) {
34 %tmp.2 = and int %b, %a
0 ; Test that the ToAsciiOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*%ffs'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*%ffs}
23
34 declare int %ffs(int)
45 declare int %ffsl(int)
0 ; Test that the FPrintFOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*fprintf'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*fprintf}
23 ;
34
45 %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [52 x sbyte] }
0 ; Test that the StrCatOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memcpy.i32'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | \
2 ; RUN: llvm-dis | not grep {call.*llvm.memcpy.i32}
33
44 declare void %llvm.memcpy.i32(sbyte*,sbyte*,uint,uint)
55 %h = constant [2 x sbyte] c"h\00"
0 ; Test that the StrCatOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memmove.i32'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | \
2 ; RUN: llvm-dis | not grep {call.*llvm.memmove.i32}
33
44 declare void %llvm.memmove.i32(sbyte*,sbyte*,uint,uint)
55 %h = constant [2 x sbyte] c"h\00"
None ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar &&
1 ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*printf'
0 ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep putchar
1 ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*printf}
23
34 @str = internal constant [13 x i8] c"hello world\0A\00" ; <[13 x i8]*> [#uses=1]
45 @str1 = internal constant [2 x i8] c"h\00" ; <[2 x i8]*> [#uses=1]
0 ; Test that the PutsCatOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*fputs'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*fputs}
23 ;
34 %struct._IO_FILE = type { int, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, sbyte*, %struct._IO_marker*, %struct._IO_FILE*, int, int, int, ushort, sbyte, [1 x sbyte], sbyte*, long, sbyte*, sbyte*, int, [52 x sbyte] }
45 %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, int }
0 ; Test that the SPrintFOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls -disable-output &&
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*sprintf'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*sprintf}
33
44 declare int %sprintf(sbyte*,sbyte*,...)
55 declare int %puts(sbyte*)
0 ; Test that the StrCatOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcat'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*strcat}
23
34 declare sbyte* %strcat(sbyte*,sbyte*)
45 declare int %puts(sbyte*)
0 ; Test that the StrChrOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*%strchr'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*%strchr}
23
34 declare sbyte* %strchr(sbyte*,int)
45 declare int %puts(sbyte*)
0 ; Test that the StrCmpOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcmp'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*strcmp}
23
34 declare int %strcmp(sbyte*,sbyte*)
45 declare int %puts(sbyte*)
0 ; Test that the StrCpyOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strcpy'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*strcpy}
23
34 declare sbyte* %strcpy(sbyte*,sbyte*)
45 declare int %puts(sbyte*)
0 ; Test that the StrCatOptimizer works correctly
11 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep 'call.*strlen'
2 ; RUN: not grep {call.*strlen}
33
44 target datalayout = "e-p:32:32"
55
0 ; Test that the StrNCmpOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*strncmp'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*strncmp}
23
34 declare int %strncmp(sbyte*,sbyte*,int)
45 declare int %puts(sbyte*)
0 ; Test that the ToAsciiOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*toascii'
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*toascii}
23
34 declare int %toascii(int)
45
0 ; Test that the memcmpOptimizer works correctly
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | not grep 'call.*memcmp' &&
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
2 ; RUN: not grep {call.*memcmp}
23 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls -disable-output
34
45 declare int %memcmp(sbyte*,sbyte*,int)