llvm.org GIT mirror llvm / 2aabd07
For PR1319: Upgrade to use new Tcl exec based test harness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36062 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
54 changed file(s) with 114 addition(s) and 87 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep '@test(' &&
0 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | grep {@test(}
11 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep dead
22
33 define internal i32 @test(i32 %X, i32 %dead) {
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None ; RUN: llvm-upgrade < %s | llvm-as | opt -dse -scalarrepl -instcombine | llvm-dis | not grep 'ret int undef'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -dse -scalarrepl -instcombine | \
1 ; RUN: llvm-dis | not grep {ret int undef}
12
23 int %test(double %__x) {
34 %__u = alloca { [3 x int] }
None ; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | grep 'store i32 1234567'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | \
1 ; RUN: grep {store i32 1234567}
12
23 ; Do not delete stores that are only partially killed.
34
None ; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | not grep 'store sbyte'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -dse | llvm-dis | \
1 ; RUN: not grep {store sbyte}
12 ; Ensure that the dead store is deleted in this case. It is wholely
23 ; overwritten by the second store.
34 int %test() {
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
0 ; This entire chain of computation should be optimized away, but
11 ; wasn't because the two multiplies were not detected as being identical.
22 ;
3 ; RUN: llvm-as < %s | opt -gcse -instcombine -dce | llvm-dis | not grep sub
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -gcse -instcombine -dce | \
4 ; RUN: llvm-dis | not grep sub
45
56 implementation ; Functions:
67
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None ; RUN: llvm-as < %s | opt -instcombine -globalopt | llvm-dis | grep 'internal fastcc float @foo'
0 ; RUN: llvm-as < %s | opt -instcombine -globalopt | llvm-dis | \
1 ; RUN: grep {internal fastcc float @foo}
2
13 define internal float @foo() {
24 ret float 0.000000e+00
35 }
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt -instcombine | \
1 ; RUN: llvm-dis | grep 'ret i1 true'
1 ; RUN: llvm-dis | grep {ret i1 true}
22
33 ;; check that global opt turns integers that only hold 0 or 1 into bools.
44
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \
1 ; RUN: grep 'G1 = internal constant'
1 ; RUN: grep {G1 = internal constant}
22
33 %G1 = internal global [58 x sbyte] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00"
44
None ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | not grep internal
1 ; both globals are write only, delete them.
1
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \
3 ; RUN: not grep internal
24
35 %G0 = internal global [58 x sbyte] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00"
46
68
79 implementation ; Functions:
810
9 declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
10 declare void %llvm.memset(sbyte*, ubyte, uint, uint)
11 declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
12 declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint)
1113
1214 void %foo() {
1315 %Blah = alloca [58 x sbyte] ; <[58 x sbyte]*> [#uses=2]
1416 %tmp3 = cast [58 x sbyte]* %Blah to sbyte*
15 call void %llvm.memcpy( sbyte* cast ([4 x int]* %G1 to sbyte*), sbyte* %tmp3, uint 16, uint 1)
16 call void %llvm.memset( sbyte* getelementptr ([58 x sbyte]* %G0, int 0, int 0), uint 17, uint 58, uint 1)
17 call void %llvm.memcpy.i32( sbyte* cast ([4 x int]* %G1 to sbyte*), sbyte* %tmp3, uint 16, uint 1)
18 call void %llvm.memset.i32( sbyte* getelementptr ([58 x sbyte]* %G0, int 0, int 0), uint 17, uint 58, uint 1)
1719 ret void
1820 }
1921
None ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | grep 'call void @Actual'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -globalopt | llvm-dis | \
1 ; RUN: grep {call void @Actual}
12
23 ; Check that a comparison does not prevent an indirect call from being made
34 ; direct. The global will still remain, but indirect call elim is still good.
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -ipconstprop -instcombine | \
1 ; RUN: llvm-dis | grep 'ret i1 true'
1 ; RUN: llvm-dis | grep {ret i1 true}
22 implementation
33
44 internal int %foo(bool %C) {
None ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret i32 152'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | \
1 ; RUN: grep {ret i32 152}
12
23 int %main() {
34 entry:
None ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | grep 'ret i32 27'
0 ; PR726
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars | llvm-dis | \
2 ; RUN: grep {ret i32 27}
13
24 ; Make sure to compute the right exit value based on negative strides.
3 ; PR726
45
56 int %test() {
67 entry:
None ; RUN: llvm-as < %s | opt -indvars -disable-output &&
1 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep 'ret i32 0'
2 ; PR1015
1 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep {ret i32 0}
32
43 target datalayout = "e-p:32:32"
54 target triple = "i686-apple-darwin8"
None ; RUN: llvm-as < %s | llc -march=x86-64 | grep '(%rdi,%rax,8)' &&
1 ; RUN: llvm-as < %s | llc -march=x86-64 | not grep 'addq.*8'
0 ; RUN: llvm-as < %s | llc -march=x86-64 | grep {(%rdi,%rax,8)}
1 ; RUN: llvm-as < %s | llc -march=x86-64 | not grep {addq.*8}
22
33 define void @foo(double* %y) {
44 entry:
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
11 ; these loops all have predictable exit values we can replace the use outside
22 ; of the loop with a closed-form computation, making the loop dead.
33 ;
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -adce -simplifycfg | llvm-dis | not grep br
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -adce -simplifycfg | \
5 ; RUN: llvm-dis | not grep br
56
67 int %polynomial_constant() {
78 br label %Loop
None ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep 'ret i32 600000'
0 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 600000}
11 ; PR1179
22
33 define i32 @foo() {
None ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep 'ret i32 9900'
0 ; RUN: llvm-as < %s | opt -indvars | llvm-dis | grep {ret i32 9900}
11 ; PR1179
22
33 define i32 @test4() {
None ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -instcombine | llvm-dis | grep 'store i32 0'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -indvars -instcombine | llvm-dis | \
1 ; RUN: grep {store i32 0}
2 ; END.
13 ; Test that -indvars can reduce variable stride IVs. If it can reduce variable
24 ; stride iv's, it will make %iv. and %m.0.0 isomorphic to each other without
35 ; cycles, allowing the tmp.21 subtraction to be eliminated.
None ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep 'ret i32 1'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | grep {ret i32 1}
11 ; ModuleID = 'short.opt.bc'
22
33 implementation ; Functions:
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
0 ; Test that the inliner doesn't leave around dead allocas, and that it folds
11 ; uncond branches away after it is done specializing.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline -disable-output &&
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep 'alloca.*uses=0' &&
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep 'br label'
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
4 ; RUN: not grep {alloca.*uses=0}
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
6 ; RUN: not grep {br label}
67
78 %A = weak global int 0 ; [#uses=1]
89 %B = weak global int 0 ; [#uses=1]
None ; RUN: llvm-upgrade < %s | llvm-as | opt -inline -disable-output &&
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee &&
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep callee
21 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep div
32
43 implementation
0 ; This checks to ensure that the inline pass deletes functions if they get
11 ; inlined into all of their callers.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep %reallysmall
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
4 ; RUN: not grep %reallysmall
45
56 implementation
67
None ; RUN: llvm-upgrade < %s | llvm-as | opt -inline -disable-output &&
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep 'callee[12](' &&
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
1 ; RUN: not grep {callee\[12\](}
22 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep mul
33
44 implementation
0 ; Test that we can inline a simple function, turning the calls in it into invoke
11 ; instructions
22
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | not grep 'call[^e]'
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline | llvm-dis | \
4 ; RUN: not grep {call\[^e\]}
45
56 declare void %might_throw()
67
0 ; Test that if an invoked function is inlined, and if that function cannot
11 ; throw, that the dead handler is now unreachable.
22
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline -simplifycfg | llvm-dis | not grep UnreachableExceptionHandler
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -inline -simplifycfg | llvm-dis | \
4 ; RUN: not grep UnreachableExceptionHandler
45
56 declare void %might_throw()
67
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
22 ; happens because preheader insertion doesn't insert a preheader for this
33 ; case... bad.
44
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm -adce -simplifycfg | llvm-dis | not grep 'br '
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm -adce -simplifycfg | llvm-dis | \
6 ; RUN: not grep {br }
67
78 int %main(int %argc) {
89 br label %bb5
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
22 ; instructions from the loop. Instead they got hoisted, which is better than
33 ; leaving them in the loop, but increases register pressure pointlessly.
44
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | %prcontext getelementptr 1 | grep Out:
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | \
6 ; RUN: %prcontext getelementptr 1 | grep Out:
67
78 %Ty = type { int, int }
89 %X = external global %Ty
0 ; This testcase ensures that we can sink instructions from loops with
11 ; multiple exits.
22 ;
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | %prcontext mul 1 | grep 'Out[12]:'
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | \
4 ; RUN: %prcontext mul 1 | grep {Out\[12\]:}
45
56 int %test(int %N, bool %C) {
67 Entry:
11 ; some exits out of the loop, and that we can do so without breaking dominator
22 ; info.
33 ;
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | %prcontext add 1 | grep exit2:
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -licm | llvm-dis | \
5 ; RUN: %prcontext add 1 | grep exit2:
56
67 implementation ; Functions:
78
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None ; RUN: llvm-upgrade < %s | llvm-as | opt -std-compile-opts | llvm-dis | %prcontext strstr 2 | grep -v declare |grep "bb36.outer:"
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -std-compile-opts | llvm-dis | \
1 ; RUN: %prcontext strstr 2 | grep -v declare | grep bb36.outer:
2 ; END.
3
14 @str = internal constant [68 x i8] c"Dot. date. datum. 123. Some more doubtful demonstration dummy data.\00" ; <[68 x i8]*> [#uses=1]
25 @str1 = internal constant [5 x i8] c"ummy\00" ; <[5 x i8]*> [#uses=1]
36 @str2 = internal constant [6 x i8] c" data\00" ; <[6 x i8]*> [#uses=1]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'cast uint 1 to uint'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
1 ; RUN: not grep {cast uint 1 to uint}
2 ; END.
13 ; The setlt wants to use a value that is incremented one more than the dominant
24 ; IV. Don't insert the 1 outside the loop, preventing folding it into the add.
35
22 ; instruction immediately before the conditional branch.
33 ;
44 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
5 ; RUN: %prcontext 'br i1' 1 | grep icmp
5 ; RUN: %prcontext {br i1} 1 | grep icmp
66
77 void %foo(float* %D, uint %E) {
88 entry:
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | grep 'add i32 %iv.*inc, 1'
0 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
1 ; RUN: grep {add i32 %iv.*inc, 1}
12 ;
23 ; Make sure that the use of the IV outside of the loop (the store) uses the
34 ; post incremented value of the IV, not the preincremented value. This
None ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis &&
1
2 ; Base should not be i*3, it should be i*2.
3 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'mul.*%i, 3' &&
1 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
2 ; RUN: not grep {mul.*%i, 3}
43
54 ; Indvar should not start at zero:
6 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | not grep 'phi uint .* 0'
5 ; RUN: llvm-upgrade < %s | llvm-as | opt -loop-reduce | llvm-dis | \
6 ; RUN: not grep {phi uint .* 0}
7 ; END.
78
89 ; mul uint %i, 3
910
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
None load_lib llvm-dg.exp
0 load_lib llvm.exp
11
2 llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
2 RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]