llvm.org GIT mirror llvm / 3c3ee1f
FileCheck-ize tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188971 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 6 years ago
26 changed file(s) with 98 addition(s) and 35 deletion(s). Raw diff Collapse all Expand all
0 ; This testcase was incorrectly computing that the loopentry.7 loop was
11 ; not a child of the loopentry.6 loop.
22 ;
3 ; RUN: opt < %s -analyze -loops | \
4 ; RUN: grep "^ Loop at depth 4 containing: %loopentry.7
"
3 ; RUN: opt < %s -analyze -loops | FileCheck %s
4
5 ; CHECK: Loop at depth 4 containing: %loopentry.7
56
67 define void @getAndMoveToFrontDecode() {
78 br label %endif.2
None ; RUN: opt < %s -postdomtree -analyze | grep entry
0 ; RUN: opt < %s -postdomtree -analyze | FileCheck %s
11 ; PR932
22
33 define void @foo(i1 %x) {
4 ; CHECK: entry
45 entry:
56 br i1 %x, label %bb1, label %bb0
67 bb0: ; preds = %entry, bb0
None ; RUN: opt < %s -indvars -adce -simplifycfg -S | grep "icmp s"
0 ; RUN: opt < %s -indvars -adce -simplifycfg -S | FileCheck %s
11 ; PR1598
2
3 ; CHECK: icmp s
24
35 define i32 @f(i32 %a, i32 %b, i32 %x, i32 %y) {
46 entry:
None ; RUN: opt < %s -scalar-evolution -analyze | grep "Loop %bb: backedge-taken count is (-1 + (-1 \* %x) + %y)"
0 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
11 ; PR1597
2
3 ; CHECK: Loop %bb: backedge-taken count is (-1 + (-1 * %x) + %y)
24
35 define i32 @f(i32 %x, i32 %y) {
46 entry:
None ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 13"
0 ; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
21 ; PR1706
2
3 ; CHECK: backedge-taken count is 13
34
45 define i32 @f() {
56 entry:
None ; RUN: opt < %s -indvars -S | grep printd | grep 1206807378
0 ; RUN: opt < %s -indvars -S | FileCheck %s
11 ; PR1798
2
3 ; CHECK: printd(i32 1206807378)
24
35 declare void @printd(i32)
46
None ; RUN: opt < %s -scalar-evolution -analyze | grep "Loop %header: backedge-taken count is (0 smax %n)"
0 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
1
2 ; CHECK: Loop %header: backedge-taken count is (0 smax %n)
13
24 define void @foo(i32 %n) {
35 entry:
None ; RUN: opt < %s -analyze -scalar-evolution | grep umax
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
11 ; PR2003
2
3 ; CHECK: umax
24
35 define i32 @foo(i32 %n) {
46 entry:
None ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 61"
0 ; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
21 ; PR2364
2
3 ; CHECK: backedge-taken count is 61
34
45 define i32 @func_6() nounwind {
56 entry:
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | not grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
11 ; PR2261
2
3 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'foo'
4 ; CHECK-NOT: smax
25
36 @lut = common global [256 x i8] zeroinitializer, align 32 ; <[256 x i8]*> [#uses=1]
47
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | not grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
11 ; PR2070
2
3 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'a'
4 ; CHECK-NOT: smax
25
36 define i32 @a(i32 %x) nounwind {
47 entry:
None ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep Unpredictable
0 ; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
21 ; PR2088
2
3 ; CHECK: Unpredictable
34
45 define void @fun() {
56 entry:
None ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 113"
0 ; RUN: opt < %s -analyze -scalar-evolution -scalar-evolution-max-iterations=0 | FileCheck %s
21 ; PR2088
2
3 ; CHECK: backedge-taken count is 113
34
45 define void @fun() {
56 entry:
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | \
1 ; RUN: grep "Loop %bb: backedge-taken count is (7 + (-1 \* %argc))"
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
1
2 ; CHECK: Loop %bb: backedge-taken count is (7 + (-1 * %argc))
23
34 define i32 @main(i32 %argc, i8** %argv) nounwind {
45 entry:
None ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep "Loop %bb: Unpredictable backedge-taken count\."
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
1
2 ; CHECK: Loop %bb: Unpredictable backedge-taken count.
23
34 ; ScalarEvolution can't compute a trip count because it doesn't know if
45 ; dividing by the stride will have a remainder. This could theoretically
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep "/u 3"
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
11 ; XFAIL: *
2
3 ; CHECK: /u 3
24
35 ; This is a tricky testcase for unsigned wrap detection which ScalarEvolution
46 ; doesn't yet know how to do.
None ; RUN: opt < %s -analyze -scalar-evolution | grep "backedge-taken count is 255"
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
1
2 ; CHECK: backedge-taken count is 255
13
24 define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind {
35 bb1.thread:
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | \
1 ; RUN: grep "(((-1 * %i0) + (100005 smax %i0)) /u 5)"
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
21 ; XFAIL: *
2
3 ; CHECK: (((-1 * %i0) + (100005 smax %i0)) /u 5)
34
45 define i32 @foo0(i32 %i0) nounwind {
56 entry:
None ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | grep "/u 5"
0 ; RUN: opt < %s -analyze -scalar-evolution 2>&1 | FileCheck %s
11 ; XFAIL: *
2
3 ; CHECK: /u 5
24
35 define i8 @foo0(i8 %i0) nounwind {
46 entry:
None ; RUN: opt < %s -analyze -scalar-evolution | not grep "/u -1"
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
11 ; PR3275
2
3 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'func_15'
4 ; CHECK-NOT: /u -1
25
36 @g_16 = external global i16 ; [#uses=3]
47 @.str = external constant [4 x i8] ; <[4 x i8]*> [#uses=0]
0 ; RUN: opt < %s -analyze -scalar-evolution | grep "(trunc i" | not grep ext
1
2 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test1'
3 ; CHECK-NOT: (trunc i{{.*}}ext
14
25 define i16 @test1(i8 %x) {
36 %A = sext i8 %x to i32
58 ret i16 %B
69 }
710
11 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test2'
12 ; CHECK-NOT: (trunc i{{.*}}ext
13
814 define i8 @test2(i16 %x) {
915 %A = sext i16 %x to i32
1016 %B = trunc i32 %A to i8
1117 ret i8 %B
1218 }
19
20 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test3'
21 ; CHECK-NOT: (trunc i{{.*}}ext
1322
1423 define i16 @test3(i16 %x) {
1524 %A = sext i16 %x to i32
1726 ret i16 %B
1827 }
1928
29 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test4'
30 ; CHECK-NOT: (trunc i{{.*}}ext
31
2032 define i16 @test4(i8 %x) {
2133 %A = zext i8 %x to i32
2234 %B = trunc i32 %A to i16
2335 ret i16 %B
2436 }
37
38 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test5'
39 ; CHECK-NOT: (trunc i{{.*}}ext
2540
2641 define i8 @test5(i16 %x) {
2742 %A = zext i16 %x to i32
2944 ret i8 %B
3045 }
3146
47 ; CHECK: Printing analysis 'Scalar Evolution Analysis' for function 'test6'
48 ; CHECK-NOT: (trunc i{{.*}}ext
49
3250 define i16 @test6(i16 %x) {
3351 %A = zext i16 %x to i32
3452 %B = trunc i32 %A to i16
None ; RUN: opt < %s -analyze -scalar-evolution | grep "count is 2"
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
11 ; PR3171
2
3 ; CHECK: count is 2
4
25 target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
36
47 %struct.Foo = type { i32 }
None ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep "\--> (zext" | count 2
0 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
1
2 ; CHECK: --> (zext
3 ; CHECK: --> (zext
4 ; CHECK-NOT: --> (zext
25
36 define i32 @foo(i32 %x) {
47 %n = and i32 %x, 255
None ; RUN: opt < %s -scalar-evolution -analyze | grep "Loop %bb3: backedge-taken count is (-1 + %n)"
0 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
1
2 ; CHECK: Loop %bb3: backedge-taken count is (-1 + %n)
13
24 ; We don't want to use a max in the trip count expression in
35 ; this testcase.
None ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep "\--> ((-128 \* %a) /u -128)"
0 ; RUN: opt < %s -scalar-evolution -analyze | FileCheck %s
1
2 ; CHECK: --> ((-128 * %a) /u -128)
23
34 ; Don't let ScalarEvolution fold this div away.
45
None ; RUN: opt < %s -analyze -scalar-evolution | grep smax
0 ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s
11 ; PR1614
2
3 ; CHECK: smax
24
35 define i32 @f(i32 %x, i32 %y) {
46 entry: