llvm.org GIT mirror llvm / 4177e6f
Convert all tests using TCL-style quoting to use shell-style quoting. This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 7 years ago
443 changed file(s) with 611 addition(s) and 609 deletion(s). Raw diff Collapse all Expand all
11 ; not a child of the loopentry.6 loop.
22 ;
33 ; RUN: opt < %s -analyze -loops | \
4 ; RUN: grep {^ Loop at depth 4 containing: %loopentry.7
}
4 ; RUN: grep "^ Loop at depth 4 containing: %loopentry.7
"
55
66 define void @getAndMoveToFrontDecode() {
77 br label %endif.2
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep {Loop %bb: backedge-taken count is 100}
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "Loop %bb: backedge-taken count is 100"
22 ; PR1533
33
44 @array = weak global [101 x i32] zeroinitializer, align 32 ; <[100 x i32]*> [#uses=1]
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 | grep "Loop %bb: backedge-taken count is (-1 + (-1 \* %x) + %y)"
11 ; PR1597
22
33 define i32 @f(i32 %x, i32 %y) {
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 13}
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 13"
22 ; PR1706
33
44 define i32 @f() {
None ; RUN: opt < %s -scalar-evolution -analyze | grep {Loop %header: backedge-taken count is (0 smax %n)}
0 ; RUN: opt < %s -scalar-evolution -analyze | grep "Loop %header: backedge-taken count is (0 smax %n)"
11
22 define void @foo(i32 %n) {
33 entry:
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 61}
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 61"
22 ; PR2364
33
44 define i32 @func_6() nounwind {
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 113}
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 113"
22 ; PR2088
33
44 define void @fun() {
0 ; RUN: opt < %s -analyze -scalar-evolution |& \
1 ; RUN: grep {Loop %bb: backedge-taken count is (7 + (-1 \\* %argc))}
1 ; RUN: grep "Loop %bb: backedge-taken count is (7 + (-1 \* %argc))"
22
33 define i32 @main(i32 %argc, i8** %argv) nounwind {
44 entry:
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep {Loop %bb: Unpredictable backedge-taken count\\.}
1 ; RUN: | grep "Loop %bb: Unpredictable backedge-taken count\."
22
33 ; ScalarEvolution can't compute a trip count because it doesn't know if
44 ; dividing by the stride will have a remainder. This could theoretically
None ; RUN: opt < %s -analyze -scalar-evolution | grep {backedge-taken count is 255}
0 ; RUN: opt < %s -analyze -scalar-evolution | grep "backedge-taken count is 255"
11
22 define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind {
33 bb1.thread:
None ; RUN: opt < %s -analyze -scalar-evolution | grep {(trunc i} | not grep ext
0 ; RUN: opt < %s -analyze -scalar-evolution | grep "(trunc i" | not grep ext
11
22 define i16 @test1(i8 %x) {
33 %A = sext i8 %x to i32
None ; RUN: opt < %s -analyze -scalar-evolution | grep {count is 2}
0 ; RUN: opt < %s -analyze -scalar-evolution | grep "count is 2"
11 ; PR3171
22 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"
33
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep {\\--> (zext} | count 2
1 ; RUN: | grep "\--> (zext" | count 2
22
33 define i32 @foo(i32 %x) {
44 %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 | grep "Loop %bb3: backedge-taken count is (-1 + %n)"
11
22 ; We don't want to use a max in the trip count expression in
33 ; this testcase.
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep {\\--> ((-128 \\* %a) /u -128)}
1 ; RUN: | grep "\--> ((-128 \* %a) /u -128)"
22
33 ; Don't let ScalarEvolution fold this div away.
44
0 ; RUN: opt < %s -analyze -scalar-evolution > %t
1 ; RUN: grep {sext i57 \{0,+,199\}<%bb> to i64} %t | count 1
2 ; RUN: grep {sext i59 \{0,+,199\}<%bb> to i64} %t | count 1
1 ; RUN: grep "sext i57 {0,+,199}<%bb> to i64" %t | count 1
2 ; RUN: grep "sext i59 {0,+,199}<%bb> to i64" %t | count 1
33
44 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"
55 target triple = "i386-apple-darwin9.6"
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep { --> (sext i. \{.\*,+,.\*\}<%bb1> to i64)} | count 5
1 ; RUN: | grep " --> (sext i. {.*,+,.*}<%bb1> to i64)" | count 5
22
33 ; Don't convert (sext {...,+,...}) to {sext(...),+,sext(...)} in cases
44 ; where the trip count is not within range.
0 ; RUN: opt < %s -analyze -scalar-evolution | grep smax | count 2
11 ; RUN: opt < %s -analyze -scalar-evolution | grep \
2 ; RUN: {%. smax %. smax %.}
2 ; RUN: "%. smax %. smax %."
33 ; PR1614
44
55 define i32 @x(i32 %a, i32 %b, i32 %c) {
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: -scalar-evolution-max-iterations=0 | grep {backedge-taken count is 10000}
1 ; RUN: -scalar-evolution-max-iterations=0 | grep "backedge-taken count is 10000"
22 ; PR1101
33
44 @A = weak global [1000 x i32] zeroinitializer, align 32
0 ; RUN: opt < %s -analyze -scalar-evolution | \
1 ; RUN: grep {backedge-taken count is 4}
1 ; RUN: grep "backedge-taken count is 4"
22 ; PR1101
33
44 @A = weak global [1000 x i32] zeroinitializer, align 32
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep {Loop %bb3\\.i: Unpredictable backedge-taken count\\.}
1 ; RUN: | grep "Loop %bb3\.i: Unpredictable backedge-taken count\."
22
33 ; ScalarEvolution can't compute a trip count because it doesn't know if
44 ; dividing by the stride will have a remainder. This could theoretically
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep {sext.*trunc.*Exits: 11}
1 ; RUN: | grep "sext.*trunc.*Exits: 11"
22
33 ; ScalarEvolution should be able to compute a loop exit value for %indvar.i8.
44
0 ; RUN: opt < %s -analyze -scalar-evolution > %t
11 ; RUN: grep sext %t | count 2
2 ; RUN: not grep {(sext} %t
2 ; RUN: not grep "(sext" %t
33
44 ; ScalarEvolution should be able to compute a maximum trip count
55 ; value sufficient to fold away both sext casts.
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep {max backedge-taken count is 1\$}
1 ; RUN: | grep "max backedge-taken count is 1$"
22
33 @mode_table = global [4 x i32] zeroinitializer ; <[4 x i32]*> [#uses=1]
44
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep {Loop %bb7.i: Unpredictable backedge-taken count\\.}
1 ; RUN: | grep "Loop %bb7.i: Unpredictable backedge-taken count\."
22
33 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"
44
0 ; RUN: opt < %s -analyze -scalar-evolution \
1 ; RUN: | grep {Loop %for\\.body: backedge-taken count is (-1 + \[%\]ecx)}
1 ; RUN: | grep "Loop %for\.body: backedge-taken count is (-1 + [%]ecx)"
22 ; PR4599
33
44 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"
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep {\\--> (zext i4 (-8 + (trunc i64 (8 \\* %x) to i4)) to i64)}
1 ; RUN: | grep "\--> (zext i4 (-8 + (trunc i64 (8 \* %x) to i4)) to i64)"
22
33 ; ScalarEvolution shouldn't try to analyze %z into something like
44 ; --> (zext i4 (-1 + (-1 * (trunc i64 (8 * %x) to i4))) to i64)
None ; RUN: llvm-as < %s | llvm-dis | not grep { bitcast (}
0 ; RUN: llvm-as < %s | llvm-dis | not grep " bitcast ("
11
22 @.Base64_1 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
33
None ; RUN: not llvm-as < %s |& grep {multiple definition}
0 ; RUN: not llvm-as < %s |& grep "multiple definition"
11
22 define void @test() {
33 %tmp.1 = add i32 0, 1
None ; RUN: not llvm-as %s |& grep {found end of file when expecting more instructions}
0 ; RUN: not llvm-as %s |& grep "found end of file when expecting more instructions"
11
22 define void @foo() {
0 ; Test for PR463. This program is erroneous, but should not crash llvm-as.
1 ; RUN: not llvm-as %s -o /dev/null |& grep {use of undefined type named 'struct.none'}
1 ; RUN: not llvm-as %s -o /dev/null |& grep "use of undefined type named 'struct.none'"
22
33 @.FOO = internal global %struct.none zeroinitializer
0 ; The assembler should catch an undefined argument type .
1 ; RUN: not llvm-as %s -o /dev/null |& grep {use of undefined type named 'typedef.bc_struct'}
1 ; RUN: not llvm-as %s -o /dev/null |& grep "use of undefined type named 'typedef.bc_struct'"
22
33 ; %typedef.bc_struct = type opaque
44
0 ; PR1117
1 ; RUN: not llvm-as %s -o /dev/null |& grep {invalid cast opcode for cast from}
1 ; RUN: not llvm-as %s -o /dev/null |& grep "invalid cast opcode for cast from"
22
33 define i8* @nada(i64 %X) {
44 %result = trunc i64 %X to i8*
0 ; PR1117
1 ; RUN: not llvm-as %s -o /dev/null |& grep {invalid cast opcode for cast from}
1 ; RUN: not llvm-as %s -o /dev/null |& grep "invalid cast opcode for cast from"
22
33 @X = constant i8* trunc (i64 0 to i8*)
0 ; Test whether negative values > 64 bits retain their negativeness.
1 ; RUN: llvm-as < %s | llvm-dis | grep {add i65.*, -1}
1 ; RUN: llvm-as < %s | llvm-dis | grep "add i65.*, -1"
22
33 define i65 @testConsts(i65 %N) {
44 %a = add i65 %N, -1
None ; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
0 ; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
11
22 define i32 @test(i32* %arg) {
33 entry:
None ; RUN: llvm-as < %s | llvm-dis | grep {align 1024}
0 ; RUN: llvm-as < %s | llvm-dis | grep "align 1024"
11
22 define void @test(i32* %arg) {
33 entry:
None ; RUN: llvm-as < %s | llvm-dis | grep {icmp.*test_weak.*null}
0 ; RUN: llvm-as < %s | llvm-dis | grep "icmp.*test_weak.*null"
11 ; PR1358
22 @G = global i1 icmp ne (i32 (...)* @test_weak, i32 (...)* null)
33
None ; RUN: llvm-as < %s | llvm-dis | grep {@f.*gc.*shadowstack}
1 ; RUN: llvm-as < %s | llvm-dis | grep {@g.*gc.*java}
0 ; RUN: llvm-as < %s | llvm-dis | grep "@f.*gc.*shadowstack"
1 ; RUN: llvm-as < %s | llvm-dis | grep "@g.*gc.*java"
22
33 define void @f() gc "shadowstack" {
44 entry:
None ; RUN: llvm-as < %s | llvm-dis | grep {addrspace(33)} | count 7
1 ; RUN: llvm-as < %s | llvm-dis | grep {addrspace(42)} | count 2
2 ; RUN: llvm-as < %s | llvm-dis | grep {addrspace(66)} | count 2
3 ; RUN: llvm-as < %s | llvm-dis | grep {addrspace(11)} | count 6
4 ; RUN: llvm-as < %s | llvm-dis | grep {addrspace(22)} | count 5
0 ; RUN: llvm-as < %s | llvm-dis | grep "addrspace(33)" | count 7
1 ; RUN: llvm-as < %s | llvm-dis | grep "addrspace(42)" | count 2
2 ; RUN: llvm-as < %s | llvm-dis | grep "addrspace(66)" | count 2
3 ; RUN: llvm-as < %s | llvm-dis | grep "addrspace(11)" | count 6
4 ; RUN: llvm-as < %s | llvm-dis | grep "addrspace(22)" | count 5
55
66 %struct.mystruct = type { i32, i32 addrspace(33)*, i32, i32 addrspace(33)* }
77 @input = weak addrspace(42) global %struct.mystruct zeroinitializer ; <%struct.mystruct addrspace(42)*> [#uses=1]
None ; RUN: not llvm-as %s |& grep {integer constant must have integer type}
0 ; RUN: not llvm-as %s |& grep "integer constant must have integer type"
11 ; PR2060
22
33 define i8* @foo() {
0 ; This test checks to make sure that constant exprs fold in some simple
11 ; situations
22
3 ; RUN: llvm-as < %s | llvm-dis | not grep {(}
3 ; RUN: llvm-as < %s | llvm-dis | not grep "("
44
55 @A = global i64 0
66
None ; RUN: llc < %s -march=arm | grep {swi 107}
0 ; RUN: llc < %s -march=arm | grep "swi 107"
11
22 define i32 @_swilseek(i32) nounwind {
33 entry:
0 ; RUN: llc < %s -mtriple=arm-linux-gnueabi -o %t
1 ; RUN: grep { = } %t | count 5
1 ; RUN: grep " = " %t | count 5
22 ; RUN: grep globl %t | count 4
33 ; RUN: grep weak %t | count 1
44
None ; RUN: llc < %s -march=arm | grep {bl.\*__ltdf} | count 1
0 ; RUN: llc < %s -march=arm | grep "bl.*__ltdf" | count 1
11 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"
22 target triple = "i386-apple-darwin8"
33
None ; RUN: llc < %s -march=arm | grep lsl | grep -F {lsl #2\]}
0 ; RUN: llc < %s -march=arm | grep lsl | grep -F "lsl #2]"
11 ; Should use scaled addressing mode.
22
33 define void @sintzero(i32* %a) nounwind {
0 ; RUN: llc < %s -march=arm | \
1 ; RUN: grep {str.*\\!} | count 2
1 ; RUN: grep "str.*\!" | count 2
22
33 define void @test1(i32* %X, i32* %A, i32** %dest) {
44 %B = load i32* %A ; [#uses=1]
0 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {__aeabi_read_tp}
1 ; RUN: grep "__aeabi_read_tp"
22
33 define i8* @test() {
44 entry:
0 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {i(tpoff)}
1 ; RUN: grep "i(tpoff)"
22 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
3 ; RUN: grep {__aeabi_read_tp}
3 ; RUN: grep "__aeabi_read_tp"
44 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi \
5 ; RUN: -relocation-model=pic | grep {__tls_get_addr}
5 ; RUN: -relocation-model=pic | grep "__tls_get_addr"
66
77
88 @i = thread_local global i32 15 ; [#uses=2]
0 ; RUN: llc < %s -march=arm -mtriple=arm-linux-gnueabi | \
1 ; RUN: grep {tbss}
1 ; RUN: grep "tbss"
22
33 %struct.anon = type { i32, i32 }
44 @teste = internal thread_local global %struct.anon zeroinitializer ; <%struct.anon*> [#uses=1]
0 ; RUN: llc < %s -march=cellspu > %t1.s
1 ; RUN: grep {shlh } %t1.s | count 10
2 ; RUN: grep {shlhi } %t1.s | count 3
3 ; RUN: grep {shl } %t1.s | count 10
4 ; RUN: grep {shli } %t1.s | count 3
5 ; RUN: grep {xshw } %t1.s | count 5
6 ; RUN: grep {and } %t1.s | count 15
7 ; RUN: grep {andi } %t1.s | count 4
8 ; RUN: grep {rotmi } %t1.s | count 4
9 ; RUN: grep {rotqmbyi } %t1.s | count 1
10 ; RUN: grep {rotqmbii } %t1.s | count 2
11 ; RUN: grep {rotqmby } %t1.s | count 1
12 ; RUN: grep {rotqmbi } %t1.s | count 2
13 ; RUN: grep {rotqbyi } %t1.s | count 1
14 ; RUN: grep {rotqbii } %t1.s | count 2
15 ; RUN: grep {rotqbybi } %t1.s | count 1
16 ; RUN: grep {sfi } %t1.s | count 6
1 ; RUN: grep "shlh " %t1.s | count 10
2 ; RUN: grep "shlhi " %t1.s | count 3
3 ; RUN: grep "shl " %t1.s | count 10
4 ; RUN: grep "shli " %t1.s | count 3
5 ; RUN: grep "xshw " %t1.s | count 5
6 ; RUN: grep "and " %t1.s | count 15
7 ; RUN: grep "andi " %t1.s | count 4
8 ; RUN: grep "rotmi " %t1.s | count 4
9 ; RUN: grep "rotqmbyi " %t1.s | count 1
10 ; RUN: grep "rotqmbii " %t1.s | count 2
11 ; RUN: grep "rotqmby " %t1.s | count 1
12 ; RUN: grep "rotqmbi " %t1.s | count 2
13 ; RUN: grep "rotqbyi " %t1.s | count 1
14 ; RUN: grep "rotqbii " %t1.s | count 2
15 ; RUN: grep "rotqbybi " %t1.s | count 1
16 ; RUN: grep "sfi " %t1.s | count 6
1717 ; RUN: cat %t1.s | FileCheck %s
1818
1919 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
0 ; RUN: llc < %s -march=cellspu > %t1.s
1 ; RUN: grep {stqd.*0(\$3)} %t1.s | count 4
2 ; RUN: grep {stqd.*16(\$3)} %t1.s | count 4
1 ; RUN: grep 'stqd.*0($3)' %t1.s | count 4
2 ; RUN: grep 'stqd.*16($3)' %t1.s | count 4
33 ; RUN: grep 16256 %t1.s | count 2
44 ; RUN: grep 16384 %t1.s | count 1
55 ; RUN: grep 771 %t1.s | count 4
77 ; RUN: grep 1799 %t1.s | count 2
88 ; RUN: grep 1543 %t1.s | count 5
99 ; RUN: grep 1029 %t1.s | count 3
10 ; RUN: grep {shli.*, 4} %t1.s | count 4
10 ; RUN: grep 'shli.*, 4' %t1.s | count 4
1111 ; RUN: grep stqx %t1.s | count 4
1212 ; RUN: grep ilhu %t1.s | count 11
1313 ; RUN: grep iohl %t1.s | count 8
0 ; RUN: llc < %s -march=cellspu > %t1.s
11 ; RUN: grep shufb %t1.s | count 19
2 ; RUN: grep {ilhu.*1799} %t1.s | count 1
3 ; RUN: grep {ilhu.*771} %t1.s | count 2
4 ; RUN: grep {ilhu.*1543} %t1.s | count 1
5 ; RUN: grep {ilhu.*1029} %t1.s | count 1
6 ; RUN: grep {ilhu.*515} %t1.s | count 1
7 ; RUN: grep {ilhu.*3855} %t1.s | count 1
8 ; RUN: grep {ilhu.*3599} %t1.s | count 1
9 ; RUN: grep {ilhu.*3085} %t1.s | count 1
10 ; RUN: grep {iohl.*3855} %t1.s | count 1
11 ; RUN: grep {iohl.*3599} %t1.s | count 2
12 ; RUN: grep {iohl.*1543} %t1.s | count 2
13 ; RUN: grep {iohl.*771} %t1.s | count 2
14 ; RUN: grep {iohl.*515} %t1.s | count 1
15 ; RUN: grep {iohl.*1799} %t1.s | count 1
2 ; RUN: grep "ilhu.*1799" %t1.s | count 1
3 ; RUN: grep "ilhu.*771" %t1.s | count 2
4 ; RUN: grep "ilhu.*1543" %t1.s | count 1
5 ; RUN: grep "ilhu.*1029" %t1.s | count 1
6 ; RUN: grep "ilhu.*515" %t1.s | count 1
7 ; RUN: grep "ilhu.*3855" %t1.s | count 1
8 ; RUN: grep "ilhu.*3599" %t1.s | count 1
9 ; RUN: grep "ilhu.*3085" %t1.s | count 1
10 ; RUN: grep "iohl.*3855" %t1.s | count 1
11 ; RUN: grep "iohl.*3599" %t1.s | count 2
12 ; RUN: grep "iohl.*1543" %t1.s | count 2
13 ; RUN: grep "iohl.*771" %t1.s | count 2
14 ; RUN: grep "iohl.*515" %t1.s | count 1
15 ; RUN: grep "iohl.*1799" %t1.s | count 1
1616 ; RUN: grep lqa %t1.s | count 1
1717 ; RUN: grep cbd %t1.s | count 4
1818 ; RUN: grep chd %t1.s | count 3
0 ; This function should have exactly one call to fixdfdi, no more!
11
22 ; RUN: llc < %s -march=ppc32 -mattr=-64bit | \
3 ; RUN: grep {bl .*fixdfdi} | count 1
3 ; RUN: grep "bl .*fixdfdi" | count 1
44
55 define double @test2(double %tmp.7705) {
66 %mem_tmp.2.0.in = fptosi double %tmp.7705 to i64 ; [#uses=1]
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
1 ; RUN: grep {vspltish v.*, 10}
1 ; RUN: grep "vspltish v.*, 10"
22
33 define void @test(<8 x i16>* %P) {
44 %tmp = load <8 x i16>* %P ; <<8 x i16>> [#uses=1]
None ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {foo r3, r4}
1 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep {bari r3, 47}
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep "foo r3, r4"
1 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8.8.0 | grep "bari r3, 47"
22
33 ; PR1351
44
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"
11 target triple = "powerpc-apple-darwin8.8.0"
22
3 ; RUN: llc < %s -march=ppc32 | grep {rlwinm r3, r3, 23, 30, 30}
3 ; RUN: llc < %s -march=ppc32 | grep "rlwinm r3, r3, 23, 30, 30"
44 ; PR1473
55
66 define zeroext i8 @foo(i16 zeroext %a) {
0 ; RUN: llc < %s -march=ppc32 | \
1 ; RUN: not grep {stw r31, 20(r1)}
1 ; RUN: not grep "stw r31, 20(r1)"
22 ; RUN: llc < %s -march=ppc32 | \
3 ; RUN: not grep {stwu r1, -.*(r1)}
3 ; RUN: not grep "stwu r1, -.*(r1)"
44 ; RUN: llc < %s -march=ppc32 | \
5 ; RUN: not grep {addi r1, r1, }
5 ; RUN: not grep "addi r1, r1, "
66 ; RUN: llc < %s -march=ppc32 | \
7 ; RUN: not grep {lwz r31, 20(r1)}
7 ; RUN: not grep "lwz r31, 20(r1)"
88 ; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
9 ; RUN: not grep {stw r31, 20(r1)}
9 ; RUN: not grep "stw r31, 20(r1)"
1010 ; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
11 ; RUN: not grep {stwu r1, -.*(r1)}
11 ; RUN: not grep "stwu r1, -.*(r1)"
1212 ; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
13 ; RUN: not grep {addi r1, r1, }
13 ; RUN: not grep "addi r1, r1, "
1414 ; RUN: llc < %s -march=ppc32 -disable-fp-elim | \
15 ; RUN: not grep {lwz r31, 20(r1)}
15 ; RUN: not grep "lwz r31, 20(r1)"
1616 ; RUN: llc < %s -march=ppc64 | \
17 ; RUN: not grep {std r31, 40(r1)}
17 ; RUN: not grep "std r31, 40(r1)"
1818 ; RUN: llc < %s -march=ppc64 | \
19 ; RUN: not grep {stdu r1, -.*(r1)}
19 ; RUN: not grep "stdu r1, -.*(r1)"
2020 ; RUN: llc < %s -march=ppc64 | \
21 ; RUN: not grep {addi r1, r1, }
21 ; RUN: not grep "addi r1, r1, "
2222 ; RUN: llc < %s -march=ppc64 | \
23 ; RUN: not grep {ld r31, 40(r1)}
23 ; RUN: not grep "ld r31, 40(r1)"
2424 ; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
25 ; RUN: not grep {stw r31, 40(r1)}
25 ; RUN: not grep "stw r31, 40(r1)"
2626 ; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
27 ; RUN: not grep {stdu r1, -.*(r1)}
27 ; RUN: not grep "stdu r1, -.*(r1)"
2828 ; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
29 ; RUN: not grep {addi r1, r1, }
29 ; RUN: not grep "addi r1, r1, "
3030 ; RUN: llc < %s -march=ppc64 -disable-fp-elim | \
31 ; RUN: not grep {ld r31, 40(r1)}
31 ; RUN: not grep "ld r31, 40(r1)"
3232
3333 define i32* @f1() {
3434 %tmp = alloca i32, i32 2 ; [#uses=1]
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -o %t1
1 ; RUN: not grep {stw r31, -4(r1)} %t1
2 ; RUN: grep {stwu r1, -16448(r1)} %t1
3 ; RUN: grep {addi r1, r1, 16448} %t1
1 ; RUN: not grep "stw r31, -4(r1)" %t1
2 ; RUN: grep "stwu r1, -16448(r1)" %t1
3 ; RUN: grep "addi r1, r1, 16448" %t1
44 ; RUN: llc < %s -march=ppc32 | \
5 ; RUN: not grep {lwz r31, -4(r1)}
5 ; RUN: not grep "lwz r31, -4(r1)"
66 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
77 ; RUN: -o %t2
8 ; RUN: grep {stw r31, -4(r1)} %t2
9 ; RUN: grep {stwu r1, -16448(r1)} %t2
10 ; RUN: grep {addi r1, r1, 16448} %t2
11 ; RUN: grep {lwz r31, -4(r1)} %t2
8 ; RUN: grep "stw r31, -4(r1)" %t2
9 ; RUN: grep "stwu r1, -16448(r1)" %t2
10 ; RUN: grep "addi r1, r1, 16448" %t2
11 ; RUN: grep "lwz r31, -4(r1)" %t2
1212 ; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin8 -o %t3
13 ; RUN: not grep {std r31, -8(r1)} %t3
14 ; RUN: grep {stdu r1, -16496(r1)} %t3
15 ; RUN: grep {addi r1, r1, 16496} %t3
16 ; RUN: not grep {ld r31, -8(r1)} %t3
13 ; RUN: not grep "std r31, -8(r1)" %t3
14 ; RUN: grep "stdu r1, -16496(r1)" %t3
15 ; RUN: grep "addi r1, r1, 16496" %t3
16 ; RUN: not grep "ld r31, -8(r1)" %t3
1717 ; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin8 -disable-fp-elim \
1818 ; RUN: -o %t4
19 ; RUN: grep {std r31, -8(r1)} %t4
20 ; RUN: grep {stdu r1, -16512(r1)} %t4
21 ; RUN: grep {addi r1, r1, 16512} %t4
22 ; RUN: grep {ld r31, -8(r1)} %t4
19 ; RUN: grep "std r31, -8(r1)" %t4
20 ; RUN: grep "stdu r1, -16512(r1)" %t4
21 ; RUN: grep "addi r1, r1, 16512" %t4
22 ; RUN: grep "ld r31, -8(r1)" %t4
2323
2424 define i32* @f1() {
2525 %tmp = alloca i32, i32 4095 ; [#uses=1]
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | \
1 ; RUN: grep {stw r4, 32751}
1 ; RUN: grep "stw r4, 32751"
22 ; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin | \
3 ; RUN: grep {stw r4, 32751}
3 ; RUN: grep "stw r4, 32751"
44 ; RUN: llc < %s -march=ppc64 -mtriple=powerpc-apple-darwin | \
5 ; RUN: grep {std r4, 9024}
5 ; RUN: grep "std r4, 9024"
66
77 define void @test() nounwind {
88 store i32 0, i32* inttoptr (i64 48725999 to i32*)
None ; RUN: llc < %s -march=ppc32 | not grep {ori\\|lis}
0 ; RUN: llc < %s -march=ppc32 | not grep "ori\|lis"
11
22 ; andi. r3, r3, 32769
33 define i32 @test(i32 %X) {
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
1 ; RUN: grep {addc 4, 4, 6}
1 ; RUN: grep "addc 4, 4, 6"
22 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
3 ; RUN: grep {adde 3, 3, 5}
3 ; RUN: grep "adde 3, 3, 5"
44
55 define i64 @foo(i64 %x, i64 %y) {
66 %z = add i64 %x, %y
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
1 ; RUN: grep {addic 4, 4, 1}
1 ; RUN: grep "addic 4, 4, 1"
22 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | \
3 ; RUN: grep {addze 3, 3}
3 ; RUN: grep "addze 3, 3"
44
55 declare i64 @foo()
66
0 ; RUN: llc < %s -march=ppc32 | \
1 ; RUN: grep {b LBB.*} | count 4
1 ; RUN: grep "b LBB.*" | count 4
22
33 target datalayout = "E-p:32:32"
44 target triple = "powerpc-apple-darwin8.7.0"
0 ; Test various forms of calls.
11
22 ; RUN: llc < %s -march=ppc32 | \
3 ; RUN: grep {bl } | count 1
3 ; RUN: grep "bl " | count 1
44 ; RUN: llc < %s -march=ppc32 | \
5 ; RUN: grep {bctrl} | count 1
5 ; RUN: grep "bctrl" | count 1
66 ; RUN: llc < %s -march=ppc32 | \
7 ; RUN: grep {bla } | count 1
7 ; RUN: grep "bla " | count 1
88
99 declare void @foo()
1010
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1 ; RUN: grep {cmpwi cr0, r3, -1}
1 ; RUN: grep "cmpwi cr0, r3, -1"
22
33 define i32 @test(i32 %x) nounwind {
44 %c = icmp eq i32 %x, -1
33 ; RUN: llc < %s -march=ppc32 | \
44 ; RUN: grep ori | count 3
55 ; RUN: llc < %s -march=ppc32 | \
6 ; RUN: grep {li } | count 4
6 ; RUN: grep "li " | count 4
77
88 define i32 @f1() {
99 entry:
None ; RUN: llc < %s | grep {foo bar":}
0 ; RUN: llc < %s | grep 'foo bar":'
11
22 target datalayout = "E-p:32:32"
33 target triple = "powerpc-apple-darwin8.2.0"
None ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | grep {fabs f1, f1}
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | grep "fabs f1, f1"
11
22 define double @fabs(double %f) {
33 entry:
0 ; RUN: llc < %s -march=ppc32 -fp-contract=fast | \
1 ; RUN: egrep {fn?madd|fn?msub} | count 8
1 ; RUN: egrep "fn?madd|fn?msub" | count 8
22
33 define double @test_FMADD1(double %A, double %B, double %C) {
44 %D = fmul double %A, %B ; [#uses=1]
11 ; otherwise.
22
33 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=+fsqrt | \
4 ; RUN: grep {fsqrt f1, f1}
4 ; RUN: grep "fsqrt f1, f1"
55 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g5 | \
6 ; RUN: grep {fsqrt f1, f1}
6 ; RUN: grep "fsqrt f1, f1"
77 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-fsqrt | \
8 ; RUN: not grep {fsqrt f1, f1}
8 ; RUN: not grep "fsqrt f1, f1"
99 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mcpu=g4 | \
10 ; RUN: not grep {fsqrt f1, f1}
10 ; RUN: not grep "fsqrt f1, f1"
1111
1212 declare double @llvm.sqrt.f64(double)
1313
0 ; RUN: llc < %s -march=ppc32 -stats |& \
1 ; RUN: grep {4 .*Number of machine instrs printed}
1 ; RUN: grep "4 .*Number of machine instrs printed"
22
33 ;; Integer absolute value, should produce something as good as:
44 ;; srawi r2, r3, 31
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1 ; RUN: grep {srwi r3, r3, 31}
1 ; RUN: grep "srwi r3, r3, 31"
22
33 define i32 @test1(i32 %X) {
44 entry:
None ; RUN: llc < %s | grep {no_dead_strip.*_X}
0 ; RUN: llc < %s | grep "no_dead_strip.*_X"
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"
33 target triple = "powerpc-apple-darwin8.8.0"
0 ; RUN: llc < %s -march=ppc32 | grep mflr
11 ; RUN: llc < %s -march=ppc32 | grep lwz
2 ; RUN: llc < %s -march=ppc64 | grep {ld r., 16(r1)}
2 ; RUN: llc < %s -march=ppc64 | grep "ld r., 16(r1)"
33
44 target triple = "powerpc-apple-darwin8"
55
0 ; RUN: llc < %s -march=ppc32 -stats |& \
1 ; RUN: grep {Number of machine instrs printed} | grep 12
1 ; RUN: grep "Number of machine instrs printed" | grep 12
22
33 define i16 @Trans16Bit(i32 %srcA, i32 %srcB, i32 %alpha) {
44 %tmp1 = shl i32 %srcA, 15 ; [#uses=1]
0 ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 | \
1 ; RUN: grep {srwi r., r., 5}
1 ; RUN: grep "srwi r., r., 5"
22
33 define i32 @eq0(i32 %a) {
44 %tmp.1 = icmp eq i32 %a, 0 ; [#uses=1]
None ; RUN: llc < %s -march=ppc32 | not grep {extsh\\|rlwinm}
0 ; RUN: llc < %s -march=ppc32 | not grep "extsh\|rlwinm"
11
22 declare signext i16 @foo()
33
None ; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_guard}
1 ; RUN: llc -march=ppc32 < %s -o - | grep {__stack_chk_fail}
0 ; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_guard"
1 ; RUN: llc -march=ppc32 < %s -o - | grep "__stack_chk_fail"
22
33 @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1]
44
None ; RUN: llc < %s -march=ppc32 | grep {__trampoline_setup}
0 ; RUN: llc < %s -march=ppc32 | grep "__trampoline_setup"
11
22 module asm "\09.lazy_reference .objc_class_name_NSImageRep"
33 module asm "\09.objc_class_name_NSBitmapImageRep=0"
None ; RUN: llc < %s -mtriple=thumbv6-apple-darwin10 | grep rsbs | grep {#0}
0 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin10 | grep rsbs | grep "#0"
11
22 %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
33 %struct.__sFILEX = type opaque
0 ; RUN: llc < %s -march=thumb -stats |& \
1 ; RUN: grep {4 .*Number of machine instrs printed}
1 ; RUN: grep "4 .*Number of machine instrs printed"
22
33 ;; Integer absolute value, should produce something as good as:
44 ;; Thumb:
0 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
1 ; RUN: grep {ldr.*\\!} | count 3
1 ; RUN: grep "ldr.*\!" | count 3
22 ; RUN: llc < %s -march=thumb -mattr=+thumb2 | \
3 ; RUN: grep {ldrsb.*\\!} | count 1
3 ; RUN: grep "ldrsb.*\!" | count 1
44
55 define i32* @test1(i32* %X, i32* %dest) {
66 %Y = getelementptr i32* %X, i32 4 ; [#uses=2]
0 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi | \
1 ; RUN: grep {i(tpoff)}
1 ; RUN: grep "i(tpoff)"
22 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi | \
3 ; RUN: grep {__aeabi_read_tp}
3 ; RUN: grep "__aeabi_read_tp"
44 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi \
5 ; RUN: -relocation-model=pic | grep {__tls_get_addr}
5 ; RUN: -relocation-model=pic | grep "__tls_get_addr"
66
77
88 @i = thread_local global i32 15 ; [#uses=2]
None ; RUN: llc < %s -march=x86 | grep {(%esp}
1 ; RUN: llc < %s -march=x86 | grep {pushl %ebp} | count 1
2 ; RUN: llc < %s -march=x86 | grep {popl %ebp} | count 1
0 ; RUN: llc < %s -march=x86 | grep "(%esp"
1 ; RUN: llc < %s -march=x86 | grep "pushl %ebp" | count 1
2 ; RUN: llc < %s -march=x86 | grep "popl %ebp" | count 1
33
44 declare i8* @llvm.returnaddress(i32)
55
0 ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin8 -relocation-model=static > %t
1 ; RUN: grep {movl _last} %t | count 1
2 ; RUN: grep {cmpl.*_last} %t | count 1
1 ; RUN: grep "movl _last" %t | count 1
2 ; RUN: grep "cmpl.*_last" %t | count 1
33
44 @block = external global i8* ; [#uses=1]
55 @last = external global i32 ; [#uses=3]
0 ; RUN: llc < %s -march=x86 -mtriple=i386-linux-gnu -mcpu=penryn -mattr=+sse2 -stats -realign-stack=0 |&\
1 ; RUN: grep {asm-printer} | grep 35
1 ; RUN: grep "asm-printer" | grep 35
22
33 target datalayout = "e-p:32:32"
44 define void @foo(i32* %mc, i32* %bp, i32* %ms, i32* %xmb, i32* %mpp, i32* %tpmm, i32* %ip, i32* %tpim, i32* %dpp, i32* %tpdm, i32* %bpi, i32 %M) nounwind {
0 ; PR850
11 ; RUN: llc < %s -march=x86 -x86-asm-syntax=att > %t
2 ; RUN: grep {movl 4(%eax),%ebp} %t
3 ; RUN: grep {movl 0(%eax), %ebx} %t
2 ; RUN: grep "movl 4(%eax),%ebp" %t
3 ; RUN: grep "movl 0(%eax), %ebx" %t
44
55 define i32 @foo(i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i) {
66 %tmp9.i.i = call i32 asm sideeffect "push %ebp\0Apush %ebx\0Amovl 4($2),%ebp\0Amovl 0($2), %ebx\0Amovl $1,%eax\0Aint $$0x80\0Apop %ebx\0Apop %ebp", "={ax},i,0,{cx},{dx},{si},{di}"( i32 192, i32 %__s.i.i, i32 %tmp5.i.i, i32 %tmp6.i.i, i32 %tmp7.i.i, i32 %tmp8.i.i ) ; [#uses=1]
0 ; RUN: llc < %s -march=x86-64 > %t
11 ; RUN: grep movb %t | count 2
2 ; RUN: grep {movzb\[wl\]} %t
2 ; RUN: grep "movzb[wl]" %t
33
44
55 define void @handle_vector_size_attribute() nounwind {
0 ; RUN: llc < %s -march=x86-64 > %t
1 ; RUN: not grep {,%rsp)} %t
1 ; RUN: not grep ",%rsp)" %t
22 ; PR1103
33
44 target datalayout = "e-p:64:64"
None ; RUN: llc < %s -march=x86 | grep {mov %gs:72, %eax}
0 ; RUN: llc < %s -march=x86 | grep "mov %gs:72, %eax"
11 target datalayout = "e-p:32:32"
22 target triple = "i686-apple-darwin9"
33
0 ; RUN: llc < %s -mcpu=yonah -march=x86 | \
1 ; RUN: grep {cmpltsd %xmm0, %xmm0}
1 ; RUN: grep "cmpltsd %xmm0, %xmm0"
22 target datalayout = "e-p:32:32"
33 target triple = "i686-apple-darwin9"
44
None ; RUN: llc < %s -march=x86 | grep {movsbl}
0 ; RUN: llc < %s -march=x86 | grep "movsbl"
11
22 @X = global i32 0 ; [#uses=1]
33
None ; RUN: llc < %s -relocation-model=static | grep {foo str$}
0 ; RUN: llc < %s -relocation-model=static | grep "foo str$"
11 ; PR1761
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"
33 target triple = "x86_64-pc-linux"
None ; RUN: llc < %s -march=x86 -mcpu=generic | grep {(%esp)} | count 2
0 ; RUN: llc < %s -march=x86 -mcpu=generic | grep "(%esp)" | count 2
11 ; PR1872
22
33 %struct.c34007g__designated___XUB = type { i32, i32, i32, i32 }
None ; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 16
0 ; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& grep "Number of block tails merged" | grep 16
11 ; PR1909
22
33 @.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
None ; RUN: llc < %s -mtriple=i386-apple-darwin | grep xorl | grep {%e}
0 ; RUN: llc < %s -mtriple=i386-apple-darwin | grep xorl | grep "%e"
11 ; Make sure xorl operands are 32-bit registers.
22
33 %struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* }
None ; RUN: llc -march=x86-64 < %s -o - | grep {cmpl \\$\[1\], %}
0 ; RUN: llc -march=x86-64 < %s -o - | grep "cmpl \$[1], %"
11
22 @.str = internal constant [4 x i8] c"%d\0A\00"
33
None ; RUN: llc < %s -march=x86 -relocation-model=static | grep {lea.*X.*esp} | count 2
0 ; RUN: llc < %s -march=x86 -relocation-model=static | grep "lea.*X.*esp" | count 2
11
22 @X = external global [0 x i32]
33
None ; RUN: llc < %s -march=x86 | grep {mov.*56}
0 ; RUN: llc < %s -march=x86 | grep "mov.*56"
11 ; PR3449
22
33 define void @test(<8 x double>* %P, i64* %Q) nounwind {
None ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn -stats |& grep {8 machine-licm}
0 ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn -stats |& grep "8 machine-licm"
11 ; RUN: llc < %s -march=x86-64 -mattr=+sse3,+sse41 -mcpu=penryn | FileCheck %s
22 ; rdar://6627786
33 ; rdar://7792037
0 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-linux-gnu -regalloc=fast -optimize-regalloc=0 -relocation-model=pic > %t2
1 ; RUN: grep {leaq.*TLSGD} %t2
2 ; RUN: grep {__tls_get_addr} %t2
1 ; RUN: grep "leaq.*TLSGD" %t2
2 ; RUN: grep "__tls_get_addr" %t2
33 ; PR4004
44
55 @i = thread_local global i32 15
None ; RUN: llc < %s | grep {movl.*%ebx, 8(%esi)}
0 ; RUN: llc < %s | grep "movl.*%ebx, 8(%esi)"
11 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"
22 target triple = "i386-apple-darwin9.0"
33
None ; RUN: llc < %s -mtriple=x86_64-appel-darwin -disable-cgp-branch-opts -stats |& grep {machine-sink}
0 ; RUN: llc < %s -mtriple=x86_64-appel-darwin -disable-cgp-branch-opts -stats |& grep "machine-sink"
11
22 define fastcc void @t() nounwind ssp {
33 entry:
None ; RUN: llc %s -o - | grep {__TEXT,__const}
0 ; RUN: llc %s -o - | grep "__TEXT,__const"
11 ; PR5929
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-n8:16:32"
33 target triple = "i386-apple-darwin10.0"
0 ; RUN: llc < %s -march=x86
1 ; RUN: llc < %s -mtriple=i386-apple-darwin10 | grep {array,16512,7}
2 ; RUN: llc < %s -mtriple=i386-apple-darwin9 | grep {array,16512,7}
1 ; RUN: llc < %s -mtriple=i386-apple-darwin10 | grep "array,16512,7"
2 ; RUN: llc < %s -mtriple=i386-apple-darwin9 | grep "array,16512,7"
33
44 ; Darwin 9+ should get alignment on common symbols.
55 @array = common global [4128 x i32] zeroinitializer, align 128
11 ; Use a subtarget that has post-RA scheduling enabled because the anti-dependency
22 ; breaker requires liveness information to be kept.
33 ; RUN: llc < %s -march=x86-64 -mcpu=atom -post-RA-scheduler -pre-RA-sched=list-burr -break-anti-dependencies=none > %t
4 ; RUN: grep {%xmm0} %t | count 14
5 ; RUN: not grep {%xmm1} %t
4 ; RUN: grep "%xmm0" %t | count 14
5 ; RUN: not grep "%xmm1" %t
66 ; RUN: llc < %s -march=x86-64 -mcpu=atom -post-RA-scheduler -break-anti-dependencies=critical > %t
7 ; RUN: grep {%xmm0} %t | count 7
8 ; RUN: grep {%xmm1} %t | count 7
7 ; RUN: grep "%xmm0" %t | count 7
8 ; RUN: grep "%xmm1" %t | count 7
99
1010 define void @goo(double* %r, double* %p, double* %q) nounwind {
1111 entry:
None ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep {call.*12345678}
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep {call.*12345678}
2 ; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep {call.*12345678}
0 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=static | grep "call.*12345678"
1 ; RUN: llc < %s -mtriple=i386-apple-darwin -relocation-model=pic | not grep "call.*12345678"
2 ; RUN: llc < %s -mtriple=i386-pc-linux -relocation-model=dynamic-no-pic | grep "call.*12345678"
33
44 ; Call to immediate is not safe on x86-64 unless we *know* that the
55 ; call will be within 32-bits pcrel from the dest immediate.
66
7 ; RUN: llc < %s -march=x86-64 | grep {call.*\\*%rax}
7 ; RUN: llc < %s -march=x86-64 | grep "call.*\*%rax"
88
99 ; PR3666
1010 ; PR3773
None ; RUN: llc < %s | grep {movl %esp, %ebp}
0 ; RUN: llc < %s | grep "movl %esp, %ebp"
11 ; PR4572
22
33 ; Don't coalesce with %esp if it would end up putting %esp in
0 ; RUN: llc < %s -mcpu=generic -march=x86 | not grep lea
1 ; RUN: llc < %s -mcpu=generic -march=x86 | grep {movl %ebp}
1 ; RUN: llc < %s -mcpu=generic -march=x86 | grep "movl %ebp"
22
33 declare void @bar(<2 x i64>* %n)
44
0 ; RUN: llc < %s -march=x86 -mcpu=penryn > %t
11 ; RUN: not grep movd %t
2 ; RUN: grep {movss %xmm} %t | count 1
3 ; RUN: grep {extractps \\\$1, %xmm0, } %t | count 1
2 ; RUN: grep "movss %xmm" %t | count 1
3 ; RUN: grep "extractps \$1, %xmm0, " %t | count 1
44 ; PR2647
55
66 external global float, align 16 ; :0 [#uses=2]
0 ; RUN: llc < %s -mcpu=generic -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {add ESP, 8}
1 ; RUN: grep "add ESP, 8"
22
33 target triple = "i686-pc-linux-gnu"
44
None ; RUN: llc < %s -fast-isel | grep {LCPI0_0(%rip)}
0 ; RUN: llc < %s -fast-isel | grep "LCPI0_0(%rip)"
11 ; Make sure fast isel uses rip-relative addressing when required.
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"
33 target triple = "x86_64-apple-darwin9.0"
None ; RUN: llc < %s -fast-isel | grep {_kill@GOTPCREL(%rip)}
0 ; RUN: llc < %s -fast-isel | grep "_kill@GOTPCREL(%rip)"
11 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"
22 target triple = "x86_64-apple-darwin10.0"
33 @f = global i8 (...)* @kill ; [#uses=1]
None ; RUN: llc < %s -tailcallopt=false | grep {movl\[\[:space:\]\]*8(%esp), %eax} | count 2
0 ; RUN: llc < %s -tailcallopt=false | grep "movl[[:space:]]*8(%esp), %eax" | count 2
11 ; PR3122
22 ; rdar://6400815
33
0 ;; Test that this FP immediate is stored in the constant pool as a float.
11
22 ; RUN: llc < %s -march=x86 -mattr=-sse2,-sse3 | \
3 ; RUN: grep {.long.1123418112}
3 ; RUN: grep ".long.1123418112"
44
55 define double @D() {
66 ret double 1.230000e+02
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep -i ST | not grep {fadd\\|fsub\\|fdiv\\|fmul}
1 ; RUN: grep -i ST | not grep "fadd\|fsub\|fdiv\|fmul"
22
33 ; Test that the load of the memory location is folded into the operation.
44
0 ; RUN: llc < %s -march=x86 >%t
11
2 ; RUN: grep {addl \\\$4,} %t | count 3
3 ; RUN: not grep {,%} %t
2 ; RUN: grep "addl \$4," %t | count 3
3 ; RUN: not grep ",%" %t
44
55 define void @foo(float* nocapture %A, float* nocapture %B, float* nocapture %C, i32 %N) nounwind {
66 entry:
None ; RUN: llc < %s -march=x86 | grep {movzbl %\[abcd\]h,} | count 7
0 ; RUN: llc < %s -march=x86 | grep "movzbl %[abcd]h," | count 7
11
22 ; Use h-register extract and zero-extend.
33
None ; RUN: llc < %s -march=x86-64 | grep {movzbl %\[abcd\]h,} | count 7
0 ; RUN: llc < %s -march=x86-64 | grep "movzbl %[abcd]h," | count 7
11
22 ; Use h-register extract and zero-extend.
33
0 ; RUN: llc < %s -mtriple=x86_64-linux > %t
1 ; RUN: grep {movzbl %\[abcd\]h,} %t | count 8
2 ; RUN: grep {%\[abcd\]h} %t | not grep {%r\[\[:digit:\]\]*d}
1 ; RUN: grep "movzbl %[abcd]h," %t | count 8
2 ; RUN: grep "%[abcd]h" %t | not grep "%r[[:digit:]]*d"
33
44 ; LLVM creates virtual registers for values live across blocks
55 ; based on the type of the value. Make sure that the extracts
None ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {mulpd %xmm3, %xmm1}
1 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {mulpd %xmm2, %xmm0}
2 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {addps %xmm3, %xmm1}
3 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep {addps %xmm2, %xmm0}
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "mulpd %xmm3, %xmm1"
1 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "mulpd %xmm2, %xmm0"
2 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "addps %xmm3, %xmm1"
3 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=nehalem | grep "addps %xmm2, %xmm0"
44
55 define <4 x double> @foo(<4 x double> %x, <4 x double> %z) {
66 %y = fmul <4 x double> %x, %z
None ; RUN: llc < %s -march=x86 | grep { 37}
0 ; RUN: llc < %s -march=x86 | grep " 37"
11 ; rdar://7008959
22
33 define void @bork() nounwind {
0 ; RUN: llc < %s -march=x86 > %t
1 ; RUN: grep {movb.7(%...)} %t
1 ; RUN: grep "movb.7(%...)" %t
22 ; RUN: not grep leal %t
33
44 define i8 @test(i32 *%P) nounwind {
None ; RUN: llc < %s -march=x86 | grep {shrl.*31}
0 ; RUN: llc < %s -march=x86 | grep "shrl.*31"
11
22 define i32 @test1(i32 %X) {
33 entry:
0 ; PR7054
1 ; RUN: not llc %s -o - |& grep {'_foo' label emitted multiple times to assembly}
1 ; RUN: not llc %s -o - |& grep "'_foo' label emitted multiple times to assembly"
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-n8:16:32"
33 target triple = "i386-apple-darwin10.0.0"
44
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {lea EAX, DWORD PTR \\\[... + 4\\*... - 5\\\]}
1 ; RUN: grep "lea EAX, DWORD PTR \[... + 4\*... - 5\]"
22 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
33 ; RUN: not grep add
44
None ; RUN: llc < %s -march=x86-64 | grep {xorps %xmm0, %xmm0} | count 2
0 ; RUN: llc < %s -march=x86-64 | grep "xorps %xmm0, %xmm0" | count 2
11
22 define float @foo(<4 x float> %a) {
33 %b = insertelement <4 x float> %a, float 0.0, i32 3
None ; RUN: llc < %s -march=x86 -stats |& grep {Number of blocks eliminated} | grep 6
0 ; RUN: llc < %s -march=x86 -stats |& grep "Number of blocks eliminated" | grep 6
11 ; PR1296
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 -march=x86 -mattr=+sse2 | grep {xorps.\*sp} | count 1
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 | grep "xorps.*sp" | count 1
11 ; PR2656
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:128:128"
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {ro\[rl\]} | count 12
1 ; RUN: grep "ro[rl]" | count 12
22
33 define i32 @rotl32(i32 %A, i8 %Amt) {
44 %shift.upgrd.1 = zext i8 %Amt to i32 ; [#uses=1]
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {shld.*CL}
1 ; RUN: grep "shld.*CL"
22 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
3 ; RUN: not grep {mov CL, BL}
3 ; RUN: not grep "mov CL, BL"
44
55 ; PR687
66
0 ; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | \
1 ; RUN: grep {sh\[lr\]d} | count 5
1 ; RUN: grep "sh[lr]d" | count 5
22
33 define i64 @test1(i64 %X, i8 %C) {
44 %shift.upgrd.1 = zext i8 %C to i64 ; [#uses=1]
None ; RUN: llc < %s -march=x86 | grep {movl 8(.esp), %eax}
1 ; RUN: llc < %s -march=x86 | grep {shrl .eax}
2 ; RUN: llc < %s -march=x86 | grep {movswl .ax, .eax}
0 ; RUN: llc < %s -march=x86 | grep "movl 8(.esp), %eax"
1 ; RUN: llc < %s -march=x86 | grep "shrl .eax"
2 ; RUN: llc < %s -march=x86 | grep "movswl .ax, .eax"
33
44 define i32 @test1(i64 %a) nounwind {
55 %tmp29 = lshr i64 %a, 24 ; [#uses=1]
0 ; RUN: llc -mtriple=i386-pc-linux-gnu < %s -o - | grep %gs:
11 ; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %fs:
22 ; RUN: llc -code-model=kernel -mtriple=x86_64-pc-linux-gnu < %s -o - | grep %gs:
3 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_guard}
4 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep {__stack_chk_fail}
3 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_guard"
4 ; RUN: llc -mtriple=x86_64-apple-darwin < %s -o - | grep "__stack_chk_fail"
55
66 @"\01LC" = internal constant [11 x i8] c"buf == %s\0A\00" ; <[11 x i8]*> [#uses=1]
77
None ; RUN: llc < %s -march=x86-64 | grep {leal .*), %e.\*} | count 1
0 ; RUN: llc < %s -march=x86-64 | grep "leal .*), %e.*" | count 1
11
22 ; Don't eliminate or coalesce away the explicit zero-extension!
33 ; This is currently using an leal because of a 3-addressification detail,
0 ; RUN: llc < %s -march=x86 -tailcallopt | grep TAILCALL
1 ; RUN: llc < %s -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1
1 ; RUN: llc < %s -march=x86 -tailcallopt | grep "movl[[:space:]]*4(%esp), %eax" | count 1
22 %struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32,
33 i32, i32, i32, i32, i32, i32, i32, i32,
44 i32, i32, i32, i32, i32, i32, i32, i32 }
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 -mcpu=penryn -stats |& \
1 ; RUN: grep {twoaddrinstr} | grep {Number of instructions aggressively commuted}
1 ; RUN: grep "twoaddrinstr" | grep "Number of instructions aggressively commuted"
22 ; rdar://6480363
33
44 target triple = "i386-apple-darwin9.6"
None ; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& grep {Number of 3-address instructions sunk}
0 ; RUN: llc < %s -march=x86 -mattr=+sse2 -stats |& grep "Number of 3-address instructions sunk"
11
22 define void @t2(<2 x i64>* %vDct, <2 x i64>* %vYp, i8* %skiplist, <2 x i64> %a1) nounwind {
33 entry:
0 ; RUN: llc < %s -mcpu=generic -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
1 ; RUN: grep {subl.*60}
1 ; RUN: grep "subl.*60"
22 ; RUN: llc < %s -mcpu=generic -march=x86 -mattr=+sse2 -mtriple=i686-apple-darwin8 | \
3 ; RUN: grep {movaps.*32}
3 ; RUN: grep "movaps.*32"
44
55
66 define void @test() {
None ; RUN: llc < %s -march=x86 -mcpu=yonah | grep {(%esp,%eax,4)} | count 4
0 ; RUN: llc < %s -march=x86 -mcpu=yonah | grep "(%esp,%eax,4)" | count 4
11
22 ; Inserts and extracts with variable indices must be lowered
33 ; to memory accesses.
0 ; RUN: llc < %s -march=x86-64 | grep movd | count 1
1 ; RUN: llc < %s -march=x86-64 | grep {movlhps.*%xmm0, %xmm0}
1 ; RUN: llc < %s -march=x86-64 | grep "movlhps.*%xmm0, %xmm0"
22
33 define <2 x i64> @test3(i64 %A) nounwind {
44 entry:
None ; RUN: llc < %s | grep {movl %edi, %eax}
0 ; RUN: llc < %s | grep "movl %edi, %eax"
11 ; The input value is already sign extended, don't re-extend it.
22 ; This testcase corresponds to:
33 ; int test(short X) { return (int)X; }
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {callq f@PLT} %t1
1 ; RUN: grep "callq f@PLT" %t1
22
33 define void @g() {
44 entry:
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {callq g@PLT} %t1
1 ; RUN: grep "callq g@PLT" %t1
22
33 @g = alias weak i32 ()* @f
44
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {callq __fixunsxfti@PLT} %t1
1 ; RUN: grep "callq __fixunsxfti@PLT" %t1
22
33 define i128 @f(x86_fp80 %a) nounwind {
44 entry:
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {callq f} %t1
2 ; RUN: not grep {callq f@PLT} %t1
1 ; RUN: grep "callq f" %t1
2 ; RUN: not grep "callq f@PLT" %t1
33
44 define void @g() {
55 entry:
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {callq f} %t1
2 ; RUN: not grep {callq f@PLT} %t1
1 ; RUN: grep "callq f" %t1
2 ; RUN: not grep "callq f@PLT" %t1
33
44 define void @g() {
55 entry:
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {movq a@GOTPCREL(%rip),} %t1
1 ; RUN: grep "movq a@GOTPCREL(%rip)," %t1
22
33 @a = global i32 0
44
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {movl a(%rip),} %t1
1 ; RUN: grep "movl a(%rip)," %t1
22 ; RUN: not grep GOTPCREL %t1
33
44 @a = hidden global i32 0
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {movl a(%rip),} %t1
1 ; RUN: grep "movl a(%rip)," %t1
22 ; RUN: not grep GOTPCREL %t1
33
44 @a = internal global i32 0
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {movq f@GOTPCREL(%rip),} %t1
1 ; RUN: grep "movq f@GOTPCREL(%rip)," %t1
22
33 define void ()* @g() nounwind {
44 entry:
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {leaq f(%rip),} %t1
1 ; RUN: grep "leaq f(%rip)," %t1
22 ; RUN: not grep GOTPCREL %t1
33
44 define void ()* @g() {
0 ; RUN: llc < %s -mtriple=x86_64-pc-linux -relocation-model=pic -o %t1
1 ; RUN: grep {leaq f(%rip),} %t1
1 ; RUN: grep "leaq f(%rip)," %t1
22 ; RUN: not grep GOTPCREL %t1
33
44 define void ()* @g() nounwind {
None ; RUN: not llvm-as %s -o /dev/null |& grep {redefinition of global '@B'}
0 ; RUN: not llvm-as %s -o /dev/null |& grep "redefinition of global '@B'"
11
22 @B = global i32 7
33 @B = global i32 7
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33 ; RUN: not grep cast %t2.ll
4 ; RUN: grep {\\}>} %t2.ll
4 ; RUN: grep "}>" %t2.ll
55 ; END.
66
77 %struct.anon = type <{ i8, i32, i32, i32 }>
None ; RUN: llvm-as < %s | llvm-dis | not grep {ret.*(}
0 ; RUN: llvm-as < %s | llvm-dis | not grep "ret.*("
11
22 ; All of these constant expressions should fold.
33
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33 ; RUN: not grep cast %t2.ll
4 ; RUN: grep {\\}>} %t2.ll
4 ; RUN: grep "}>" %t2.ll
55 ; END.
66
77 %struct.anon = type <{ i8, i35, i35, i35 }>
0 ; This fails because the linker renames the external symbol not the internal
11 ; one...
22
3 ; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
3 ; RUN: echo "define internal i32 @foo() { ret i32 7 } " | llvm-as > %t.1.bc
44 ; RUN: llvm-as %s -o %t.2.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {@foo()} | grep -v internal
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "@foo()" | grep -v internal
66
77 define i32 @foo() { ret i32 0 }
88
0 ; This fails because the linker renames the non-opaque type not the opaque
11 ; one...
22
3 ; RUN: echo {%%Ty = type opaque @GV = external global %%Ty*} | llvm-as > %t.1.bc
3 ; RUN: echo "%%Ty = type opaque @GV = external global %%Ty*" | llvm-as > %t.1.bc
44 ; RUN: llvm-as < %s > %t.2.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {%%Ty } | not grep opaque
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "%%Ty " | not grep opaque
66
77 %Ty = type {i32}
88
0 ; This fails because the linker renames the non-opaque type not the opaque
11 ; one...
22
3 ; RUN: echo { define linkonce void @foo() \{ ret void \} } | \
3 ; RUN: echo " define linkonce void @foo() { ret void } " | \
44 ; RUN: llvm-as -o %t.2.bc
55 ; RUN: llvm-as %s -o %t.1.bc
66 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep foo | grep linkonce
0 ; This one fails because the LLVM runtime is allowing two null pointers of
11 ; the same type to be created!
22
3 ; RUN: echo {%%T = type i32} | llvm-as > %t.2.bc
3 ; RUN: echo "%%T = type i32" | llvm-as > %t.2.bc
44 ; RUN: llvm-as %s -o %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc
66
0 ; This one fails because the LLVM runtime is allowing two null pointers of
11 ; the same type to be created!
22
3 ; RUN: echo {%M = type \{ %N*\} %N = type opaque} | llvm-as > %t.2.bc
3 ; RUN: echo "%M = type { %N*} %N = type opaque" | llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc
66
33 ; the function name, we must rename the internal function to something that
44 ; does not conflict.
55
6 ; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
6 ; RUN: echo " define internal i32 @foo() { ret i32 7 } " | llvm-as > %t.1.bc
77 ; RUN: llvm-as < %s > %t.2.bc
8 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep internal | not grep {@foo(}
8 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep internal | not grep "@foo("
99
1010 declare i32 @foo()
1111
None ; RUN: echo {%%T = type opaque} | llvm-as > %t.2.bc
0 ; RUN: echo "%%T = type opaque" | llvm-as > %t.2.bc
11 ; RUN: llvm-as < %s > %t.1.bc
22 ; RUN: llvm-link %t.1.bc %t.2.bc
33
None ; RUN: echo {%%T = type i32} | llvm-as > %t.1.bc
0 ; RUN: echo "%%T = type i32" | llvm-as > %t.1.bc
11 ; RUN: llvm-as < %s > %t.2.bc
22 ; RUN: llvm-link %t.1.bc %t.2.bc
33
0 ; RUN: llvm-as < %s > %t.out1.bc
1 ; RUN: echo {%M = type \{ i32, i32* \} } | llvm-as > %t.out2.bc
1 ; RUN: echo "%M = type { i32, i32* } " | llvm-as > %t.out2.bc
22 ; RUN: llvm-link %t.out1.bc %t.out2.bc
33
44 %M = type { i32, %N* }
0 ; RUN: llvm-as < %s > %t.out1.bc
1 ; RUN: echo {%%T1 = type opaque %%T2 = type opaque @S = external global \{ i32, %%T1* \} declare void @F(%%T2*)}\
1 ; RUN: echo "%%T1 = type opaque %%T2 = type opaque @S = external global { i32, %%T1* } declare void @F(%%T2*)"\
22 ; RUN: | llvm-as > %t.out2.bc
33 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep opaque
44
11 ; specified pointer size should not cause a warning!
22
33 ; RUN: llvm-as < %s > %t.out1.bc
4 ; RUN: echo {} | llvm-as > %t.out2.bc
4 ; RUN: echo "" | llvm-as > %t.out2.bc
55 ; RUN: llvm-link %t.out1.bc %t.out2.bc |& not grep warning
66
77 target datalayout = "e-p:64:64"
None ; RUN: echo {@G = weak global \{\{\{\{double\}\}\}\} zeroinitializer } | \
0 ; RUN: echo "@G = weak global {{{{double}}}} zeroinitializer " | \
11 ; RUN: llvm-as > %t.out2.bc
22 ; RUN: llvm-as < %s > %t.out1.bc
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep {\\}}
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep "}"
44
55 ; When linked, the global above should be eliminated, being merged with the
66 ; global below.
0 ; Test that a prototype can be marked const, and the definition is allowed
11 ; to be nonconst.
22
3 ; RUN: echo {@X = external constant i32} | llvm-as > %t.2.bc
3 ; RUN: echo "@X = external constant i32" | llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7}
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "global i32 7"
66
77 @X = global i32 7
0 ; Test that a prototype can be marked const, and the definition is allowed
11 ; to be nonconst.
22
3 ; RUN: echo {@X = global i32 7} | llvm-as > %t.2.bc
3 ; RUN: echo "@X = global i32 7" | llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7}
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "global i32 7"
66
77 @X = external constant i32 ; [#uses=0]
None ; RUN: echo { @G = appending global \[0 x i32\] zeroinitializer } | \
0 ; RUN: echo " @G = appending global [0 x i32] zeroinitializer " | \
11 ; RUN: llvm-as > %t.out2.bc
22 ; RUN: llvm-as < %s > %t.out1.bc
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep {@G =}
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep "@G ="
44
55 ; When linked, the globals should be merged, and the result should still
66 ; be named '@G'.
0 ; The linker should choose the largest alignment when linking.
11
2 ; RUN: echo {@X = global i32 7, align 8} | llvm-as > %t.2.bc
2 ; RUN: echo "@X = global i32 7, align 8" | llvm-as > %t.2.bc
33 ; RUN: llvm-as < %s > %t.1.bc
4 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {align 8}
4 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "align 8"
55
66 @X = weak global i32 7, align 4
11 ; in different modules.
22 ; RUN: llvm-as %s -o %t.foo1.bc
33 ; RUN: llvm-as %s -o %t.foo2.bc
4 ; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc
4 ; RUN: echo "define linkonce void @foo(i32 %x) { ret void }" | llvm-as -o %t.foo3.bc
55 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S
66 ; RUN: llvm-link %t.foo1.bc %t.foo3.bc -S
77 define linkonce void @foo() { ret void }
11 ; in different modules.
22 ; RUN: llvm-as %s -o %t.foo1.bc
33 ; RUN: echo | llvm-as -o %t.foo2.bc
4 ; RUN: llvm-link %t.foo2.bc %t.foo1.bc -S | grep {addrspace(2)}
5 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S | grep {addrspace(2)}
4 ; RUN: llvm-link %t.foo2.bc %t.foo1.bc -S | grep "addrspace(2)"
5 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S | grep "addrspace(2)"
66 ; rdar://6038021
77
88 @G = addrspace(2) global i32 256
0 ; Test that appending linkage works correctly.
11
2 ; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \
2 ; RUN: echo "@X = appending global [1 x i32] [i32 8] " | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 4 | grep 8
0 ; Test that appending linkage works correctly when arrays are the same size.
11
2 ; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \
2 ; RUN: echo "@X = appending global [1 x i32] [i32 8] " | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 8
0 ; Test that appending linkage works correctly when arrays are the same size.
11
2 ; RUN: echo {@X = constant \[1 x i32\] \[i32 8\] } | \
2 ; RUN: echo "@X = constant [1 x i32] [i32 8] " | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
0 ; Test that appending linkage works correctly when arrays are the same size.
11
2 ; RUN: echo {@X = external global \[1 x i32\] } | \
2 ; RUN: echo "@X = external global [1 x i32] " | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
0 ; Test that appending linkage works correctly when arrays are the same size.
11
2 ; RUN: echo {@X = external constant \[1 x i32\] } | \
2 ; RUN: echo "@X = external constant [1 x i32] " | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
55 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
0 ; RUN: llvm-as %s -o %t1.bc
1 ; RUN: echo {declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }} | llvm-as -o %t2.bc
1 ; RUN: echo "declare void @__eprintf(i8*, i8*, i32, i8*) noreturn define void @foo() { tail call void @__eprintf( i8* undef, i8* undef, i32 4, i8* null ) noreturn nounwind unreachable }" | llvm-as -o %t2.bc
22 ; RUN: llvm-link %t2.bc %t1.bc -S | grep __eprintf
33 ; RUN: llvm-link %t1.bc %t2.bc -S | grep __eprintf
44
11 ; in different modules.
22 ; RUN: llvm-as %s -o %t.foo1.bc
33 ; RUN: llvm-as %s -o %t.foo2.bc
4 ; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc
4 ; RUN: echo "define void @foo(i32 %x) { ret void }" | llvm-as -o %t.foo3.bc
55 ; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \
6 ; RUN: grep {symbol multiply defined}
6 ; RUN: grep "symbol multiply defined"
77 ; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \
8 ; RUN: grep {symbol multiply defined}
8 ; RUN: grep "symbol multiply defined"
99 define void @foo() { ret void }
0 ; RUN: llvm-as < %s > %t.bc
11 ; RUN: llvm-as < %p/testlink1.ll > %t2.bc
22 ; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc
3 ; RUN: llvm-dis < %t1.bc | grep {kallsyms_names = extern_weak}
4 ; RUN: llvm-dis < %t1.bc | grep {MyVar = external global i32}
5 ; RUN: llvm-dis < %t1.bc | grep {Inte = global i32}
3 ; RUN: llvm-dis < %t1.bc | grep "kallsyms_names = extern_weak"
4 ; RUN: llvm-dis < %t1.bc | grep "MyVar = external global i32"
5 ; RUN: llvm-dis < %t1.bc | grep "Inte = global i32"
66
77 @kallsyms_names = extern_weak global [0 x i8] ; <[0 x i8]*> [#uses=0]
88 @MyVar = extern_weak global i32 ; [#uses=0]
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=60 Name=BFI Format=ARM_FORMAT_DPFRM(4)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=2249 Name=tBcc Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # invalid imod value (0b01)
33 0xc0 0x67 0x4 0xf1
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "potentially undefined instruction encoding"
11
22 # invalid (imod, M, iflags) combination
33 0x93 0x00 0x02 0xf1
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1908 Name=t2DMB Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=102 Name=DSB Format=ARM_FORMAT_MISCFRM(26)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep "potentially undefined instruction encoding"
11
22 # CBZ / CBNZ not allowed in IT block.
33
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-unknown-unknown |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-unknown-unknown |& grep "potentially undefined instruction encoding"
11
22 0xff 0xbf 0x6b 0x80 0x00 0x75
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=0 Name=PHI Format=(42)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep "potentially undefined instruction encoding"
11
22 # Writeback is not allowed is Rn is in the target register list.
33
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "potentially undefined instruction encoding"
11
22 # Opcode=140 Name=LDRB_POST Format=ARM_FORMAT_LDFRM(6)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1930 Name=t2LDRD_PRE Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {potentially undefined instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "potentially undefined instruction encoding"
11
22 # Opcode=165 Name=LDR_PRE Format=ARM_FORMAT_LDFRM(6)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # LDR (register) has encoding Inst{4} = 0.
33 0xba 0xae 0x9f 0x57
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=171 Name=MCR Format=ARM_FORMAT_BRFRM(2)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=185 Name=MOVTi16 Format=ARM_FORMAT_DPFRM(4)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=0 Name=PHI Format=(42)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=196 Name=MOVs Format=ARM_FORMAT_DPSOREGFRM(5)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=0 Name=PHI Format=(42)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=206 Name=MSRi Format=ARM_FORMAT_BRFRM(2)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=134 Name=LDMIA Format=ARM_FORMAT_LDSTMULFRM(10)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=271 Name=SBFX Format=ARM_FORMAT_DPFRM(4)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=284 Name=SMLAD Format=ARM_FORMAT_MULFRM(1)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=0 Name=PHI Format=(42)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=2313 Name=tSTMIA_UPD Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=390 Name=SXTBr_rot Format=ARM_FORMAT_EXTFRM(14)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=419 Name=UMAAL Format=ARM_FORMAT_MULFRM(1)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=871 Name=VLD3DUPd32_UPD Format=ARM_FORMAT_NLdSt(30)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # core registers out of range
33 0xa5 0xba 0x72 0xed
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1839 Name=VST1d8Twb_register Format=ARM_FORMAT_NLdSt(30)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1894 Name=t2Bcc Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1922 Name=t2LDRBT Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1953 Name=t2LDRSHi12 Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=1954 Name=t2LDRSHi8 Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumbv7-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # SP and PC are not allowed in the register list on STM instructions in Thumb2.
33
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=2128 Name=t2STREXD Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=thumb-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # Opcode=2137 Name=t2STR_POST Format=ARM_FORMAT_THUMBFRM(25)
33 # 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
None # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # This instruction would decode as movmskps if the vvvv field in the VEX prefix was all 1s.
33 0xc5 0xf0 0x50 0xc0
None # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 |& grep {invalid instruction encoding}
0 # RUN: llvm-mc --disassemble %s -triple=x86_64-apple-darwin9 |& grep "invalid instruction encoding"
11
22 # This instruction would decode as cmpordps if the immediate byte was less than 8.
33 0x0f 0xc2 0xc7 0x08
22 ; and instead nests it just inside loop "Top"
33 ;
44 ; RUN: opt < %s -analyze -loops | \
5 ; RUN: grep { Loop at depth 3 containing: %Inner
}
5 ; RUN: grep " Loop at depth 3 containing: %Inner
"
66 ;
77 define void @test() {
88 br label %Top
None ; RUN: not opt --foo |& grep {Unknown command line argument}
0 ; RUN: not opt --foo |& grep "Unknown command line argument"
11
22 ; there is no --foo
None // RUN: llvm-tblgen %s | grep {zing = 4} | count 4
0 // RUN: llvm-tblgen %s | grep "zing = 4" | count 4
11 // XFAIL: vg_leak
22
33 class C1 {
None // RUN: llvm-tblgen %s | grep {int Y = 3}
0 // RUN: llvm-tblgen %s | grep "int Y = 3"
11 // XFAIL: vg_leak
22
33 class C {
0 // RUN llvm-tblgen %s | FileCheck %s
11
2 // RUN: llvm-tblgen %s | grep {foo} | count 1
2 // RUN: llvm-tblgen %s | grep "foo" | count 1
33 // XFAIL: vg_leak
44
55 class Base {
None // RUN: llvm-tblgen %s | grep {zing = 4} | count 2
0 // RUN: llvm-tblgen %s | grep "zing = 4" | count 2
11 // XFAIL: vg_leak
22
33 class C1 {
None // RUN: llvm-tblgen %s | grep {zing = 4} | count 28
0 // RUN: llvm-tblgen %s | grep "zing = 4" | count 28
11 // XFAIL: vg_leak
22
33 class C1 {
None // RUN: llvm-tblgen %s | grep {\\\[(set} | count 2
1 // RUN: llvm-tblgen %s | grep {\\\[\\\]} | count 2
0 // RUN: llvm-tblgen %s | grep "\[(set" | count 2
1 // RUN: llvm-tblgen %s | grep "\[\]" | count 2
22 // XFAIL: vg_leak
33
44 class ValueType {
None // RUN: llvm-tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_pd VR128:\$src1, VR128:\$src2))\\\]} | count 1
1 // RUN: llvm-tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_ps VR128:\$src1, VR128:\$src2))\\\]} | count 1
0 // RUN: llvm-tblgen %s | grep '\[(set VR128:$dst, (int_x86_sse2_add_pd VR128:$src1, VR128:$src2))\]' | count 1
1 // RUN: llvm-tblgen %s | grep '\[(set VR128:$dst, (int_x86_sse2_add_ps VR128:$src1, VR128:$src2))\]' | count 1
22 // XFAIL: vg_leak
33
44 class ValueType {
None // RUN: llvm-tblgen %s | grep {add_ps} | count 3
0 // RUN: llvm-tblgen %s | grep "add_ps" | count 3
11 // XFAIL: vg_leak
22
33 class ValueType {
None // RUN: llvm-tblgen %s | grep {Jr} | count 2
1 // RUN: llvm-tblgen %s | grep {Sr} | count 2
2 // RUN: llvm-tblgen %s | grep {"NAME"} | count 1
0 // RUN: llvm-tblgen %s | grep 'Jr' | count 2
1 // RUN: llvm-tblgen %s | grep 'Sr' | count 2
2 // RUN: llvm-tblgen %s | grep '"NAME"' | count 1
33 // XFAIL: vg_leak
44
55 // Variables for foreach
None // RUN: llvm-tblgen %s | grep {}
0 // RUN: llvm-tblgen %s | grep ""
11 // XFAIL: vg_leak
22
33 class List n> {
None // RUN: llvm-tblgen %s | grep {Smith} | count 7
1 // RUN: llvm-tblgen %s | grep {Johnson} | count 2
2 // RUN: llvm-tblgen %s | grep {FIRST} | count 1
3 // RUN: llvm-tblgen %s | grep {LAST} | count 1
4 // RUN: llvm-tblgen %s | grep {TVAR} | count 2
5 // RUN: llvm-tblgen %s | grep {Bogus} | count 1
0 // RUN: llvm-tblgen %s | grep "Smith" | count 7
1 // RUN: llvm-tblgen %s | grep "Johnson" | count 2
2 // RUN: llvm-tblgen %s | grep "FIRST" | count 1
3 // RUN: llvm-tblgen %s | grep "LAST" | count 1
4 // RUN: llvm-tblgen %s | grep "TVAR" | count 2
5 // RUN: llvm-tblgen %s | grep "Bogus" | count 1
66 // XFAIL: vg_leak
77
88 class Honorific {
0 ; RUN: opt < %s -argpromotion -S > %t
1 ; RUN: cat %t | grep {define.*@callee(.*i32\\*}
1 ; RUN: cat %t | grep "define.*@callee(.*i32\*"
22 ; PR2498
33
44 ; This test tries to convince argpromotion about promoting the load from %A + 2,
None ; RUN: opt < %s -argpromotion -S | grep -F {i32* byval} | count 2
0 ; RUN: opt < %s -argpromotion -S | grep -F "i32* byval" | count 2
11 ; Argpromote + scalarrepl should change this to passing the two integers by value.
22
33 %struct.ss = type { i32, i64 }
0 ; RUN: opt < %s -argpromotion -S | \
1 ; RUN: grep {load i32\\* %A}
1 ; RUN: grep "load i32\* %A"
22 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"
33
44 define internal i32 @callee(i1 %C, i32* %P) {
0 ; RUN: opt < %s -constprop -S | \
1 ; RUN: grep {i32 -1}
1 ; RUN: grep "i32 -1"
22 ; RUN: opt < %s -constprop -S | \
33 ; RUN: not grep zeroinitializer
44
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: grep {ret i1 false}
1 ; RUN: grep "ret i1 false"
22 define i1 @test() {
33 %X = trunc i32 320 to i1 ; [#uses=1]
44 ret i1 %X
0 ; RUN: opt < %s -constprop -S | \
1 ; RUN: grep {ret i32 -1}
1 ; RUN: grep "ret i32 -1"
22 ; RUN: opt < %s -constprop -S | \
3 ; RUN: grep {ret i32 1}
3 ; RUN: grep "ret i32 1"
44
55 define i32 @test1() {
66 %A = sext i1 true to i32 ; [#uses=1]
None ; RUN: llvm-as < %s | llvm-dis | grep {global i32 0}
0 ; RUN: llvm-as < %s | llvm-dis | grep "global i32 0"
11 ; PR1215
22
33 @G = global i32 sdiv (i32 0, i32 -1)
None ; RUN: opt < %s -constprop -S | grep {ret i13 13}
0 ; RUN: opt < %s -constprop -S | grep "ret i13 13"
11 ; PR1816
22 declare i13 @llvm.cttz.i13(i13, i1)
33
None ; RUN: opt < %s -instcombine -S | grep {ret i32 0}
0 ; RUN: opt < %s -instcombine -S | grep "ret i32 0"
11 ; PR4424
22 declare void @ext()
33
None ; RUN: opt < %s -deadargelim -S | grep {@test(}
0 ; RUN: opt < %s -deadargelim -S | grep "@test("
11 ; RUN: opt < %s -deadargelim -S | not grep dead
22
33 define internal i32 @test(i32 %X, i32 %dead) {
0 ; This test shows a few canonicalizations made by deadargelim
11 ; RUN: opt < %s -deadargelim -S > %t
22 ; This test should remove {} and replace it with void
3 ; RUN: cat %t | grep {define internal void @test}
3 ; RUN: cat %t | grep "define internal void @test"
44 ; This test shouls replace the {i32} return value with just i32
5 ; RUN: cat %t | grep {define internal i32 @test2}
5 ; RUN: cat %t | grep "define internal i32 @test2"
66
77 define internal {} @test() {
88 ret {} undef
0 ; RUN: opt < %s -deadargelim -S > %t
1 ; RUN: grep {define internal zeroext i32 @test1() nounwind} %t
2 ; RUN: grep {define internal <{ i32, i32 }> @test2} %t
1 ; RUN: grep "define internal zeroext i32 @test1() nounwind" %t
2 ; RUN: grep "define internal <{ i32, i32 }> @test2" %t
33
44 %Ty = type <{ i32, i32 }>
55
None ; RUN: opt < %s -functionattrs -S | not grep {nocapture *%%q}
1 ; RUN: opt < %s -functionattrs -S | grep {nocapture *%%p}
0 ; RUN: opt < %s -functionattrs -S | not grep "nocapture *%%q"
1 ; RUN: opt < %s -functionattrs -S | grep "nocapture *%%p"
22
33 define i32* @a(i32** %p) {
44 %tmp = load i32** %p
None ; RUN: opt < %s -basicaa -gvn -S | grep {tmp47 = phi i32 }
0 ; RUN: opt < %s -basicaa -gvn -S | grep "tmp47 = phi i32 "
11
22 %struct.anon = type { i32 (i32, i32, i32)*, i32, i32, [3 x i32], i8*, i8*, i8* }
33 @debug = external constant i32 ; [#uses=0]
None ; RUN: opt < %s -basicaa -gvn -S | grep {ret i8 \[%\]tmp3}
0 ; RUN: opt < %s -basicaa -gvn -S | grep "ret i8 [%]tmp3"
11 ; PR2503
22
33 @g_3 = external global i8 ; [#uses=2]
None ; RUN: opt < %s -basicaa -gvn -S | grep {call.*strlen} | count 1
0 ; RUN: opt < %s -basicaa -gvn -S | grep "call.*strlen" | count 1
11 ; Should delete the second call to strlen even though the intervening strchr call exists.
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:128:128"
None ; RUN: opt < %s -basicaa -gvn -instcombine -S | grep {ret i32 0}
0 ; RUN: opt < %s -basicaa -gvn -instcombine -S | grep "ret i32 0"
11 ; PR4189
22 @G = external constant [4 x i32]
33
None ; RUN: opt < %s -gvn -enable-pre -S | grep {b.pre}
0 ; RUN: opt < %s -gvn -enable-pre -S | grep "b.pre"
11
22 define i32 @main(i32 %p) {
33 block1:
None ; RUN: opt < %s -basicaa -gvn -stats -disable-output |& grep {Number of loads deleted}
0 ; RUN: opt < %s -basicaa -gvn -stats -disable-output |& grep "Number of loads deleted"
11 ; rdar://7363102
22
33 ; GVN should be able to eliminate load %tmp22.i, because it is redundant with
None ; RUN: opt < %s -gvn -enable-pre -S | grep {.pre}
0 ; RUN: opt < %s -gvn -enable-pre -S | grep ".pre"
11
22 @H = common global i32 0 ; [#uses=2]
33 @G = common global i32 0 ; [#uses=1]
None ; RUN: opt < %s -basicaa -gvn -S | grep {DEAD = phi i32 }
0 ; RUN: opt < %s -basicaa -gvn -S | grep "DEAD = phi i32 "
11
22 ; GVN should eliminate the fully redundant %9 GEP which
33 ; allows DEAD to be removed. This is PR3198.
None ; RUN: opt < %s -basicaa -gvn -S | grep {DEAD = phi i32 }
0 ; RUN: opt < %s -basicaa -gvn -S | grep "DEAD = phi i32 "
11
22 define i32 @main(i32* %p) {
33 block1:
None ; RUN: opt < %s -globalopt -S | grep {16 x .31 x double.. zeroinitializer}
0 ; RUN: opt < %s -globalopt -S | grep "16 x .31 x double.. zeroinitializer"
11
22 ; The 'X' indices could be larger than 31. Do not SROA the outer indices of this array.
33 @mm = internal global [16 x [31 x double]] zeroinitializer, align 32
None ; RUN: opt < %s -globalopt -S | grep {load volatile}
0 ; RUN: opt < %s -globalopt -S | grep "load volatile"
11 @t0.1441 = internal global double 0x3FD5555555555555, align 8 ; [#uses=1]
22
33 define double @foo() nounwind {
11 ; alignments. Elements 0 and 2 must be 16-byte aligned, and element
22 ; 1 must be at least 8 byte aligned (but could be more).
33
4 ; RUN: opt < %s -globalopt -S | grep {@G.0 = internal unnamed_addr global .*align 16}
5 ; RUN: opt < %s -globalopt -S | grep {@G.1 = internal unnamed_addr global .*align 8}
6 ; RUN: opt < %s -globalopt -S | grep {@G.2 = internal unnamed_addr global .*align 16}
4 ; RUN: opt < %s -globalopt -S | grep "@G.0 = internal unnamed_addr global .*align 16"
5 ; RUN: opt < %s -globalopt -S | grep "@G.1 = internal unnamed_addr global .*align 8"
6 ; RUN: opt < %s -globalopt -S | grep "@G.2 = internal unnamed_addr global .*align 16"
77 ; rdar://5891920
88
99 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:32:32-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
None ; RUN: opt < %s -globalopt -S | grep {phi.*@head}
0 ; RUN: opt < %s -globalopt -S | grep "phi.*@head"
11 ; PR3321
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"
33 target triple = "x86_64-unknown-linux-gnu"
None ; RUN: opt < %s -globalopt -S | grep {@X = internal unnamed_addr global i32}
0 ; RUN: opt < %s -globalopt -S | grep "@X = internal unnamed_addr global i32"
11 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"
22 target triple = "i386-apple-darwin7"
33 @X = internal global i32* null ; [#uses=2]
0 ; RUN: opt < %s -instcombine -globalopt -S | \
1 ; RUN: grep {internal fastcc float @foo}
1 ; RUN: grep "internal fastcc float @foo"
22
33 define internal float @foo() {
44 ret float 0.000000e+00
0 ; RUN: opt < %s -globalopt -S > %t
1 ; RUN: grep {@Y = internal unnamed_addr global \\\[3 x \[%\]struct.X\\\] zeroinitializer} %t
1 ; RUN: grep "@Y = internal unnamed_addr global \[3 x [%]struct.X\] zeroinitializer" %t
22 ; RUN: grep load %t | count 6
3 ; RUN: grep {add i32 \[%\]a, \[%\]b} %t | count 3
3 ; RUN: grep "add i32 [%]a, [%]b" %t | count 3
44
55 ; globalopt should not sra the global, because it can't see the index.
66
None ; RUN: opt < %s -globalopt -S | grep {tmp.f1 = phi i32. }
1 ; RUN: opt < %s -globalopt -S | grep {tmp.f0 = phi i32. }
0 ; RUN: opt < %s -globalopt -S | grep "tmp.f1 = phi i32. "
1 ; RUN: opt < %s -globalopt -S | grep "tmp.f0 = phi i32. "
22 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"
33
44 %struct.foo = type { i32, i32 }
0 ; RUN: opt < %s -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: opt < %s -globalopt -S | \
1 ; RUN: grep {G1 = internal unnamed_addr constant}
1 ; RUN: grep "G1 = internal unnamed_addr constant"
22
33 @G1 = internal global [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00" ; <[58 x i8]*> [#uses=1]
44
0 ; RUN: opt < %s -globalopt -S | \
1 ; RUN: grep {call void @Actual}
1 ; RUN: grep "call void @Actual"
22
33 ; Check that a comparison does not prevent an indirect call from being made
44 ; direct. The global will still remain, but indirect call elim is still good.
None ; RUN: opt < %s -ipconstprop -S | grep {ret i32 %r}
0 ; RUN: opt < %s -ipconstprop -S | grep "ret i32 %r"
11 ; Should not propagate the result of a weak function.
22 ; PR2411
33
0 ; RUN: opt < %s -ipconstprop -S > %t
1 ; RUN: cat %t | grep {store i32 %Z, i32\\* %Q}
2 ; RUN: cat %t | grep {add i32 1, 3}
1 ; RUN: cat %t | grep "store i32 %Z, i32\* %Q"
2 ; RUN: cat %t | grep "add i32 1, 3"
33
44 ;; This function returns its second argument on all return statements
55 define internal i32* @incdec(i1 %C, i32* %V) {
0 ; RUN: opt < %s -ipconstprop -instcombine | \
1 ; RUN: llvm-dis | grep {ret i1 true} | count 2
1 ; RUN: llvm-dis | grep "ret i1 true" | count 2
22 define internal i32 @foo(i1 %C) {
33 br i1 %C, label %T, label %F
44
0 ; RUN: opt < %s -ipconstprop -S > %t
11 ;; Check that the 21 constants got propagated properly
2 ; RUN: cat %t | grep {%M = add i32 21, 21}
2 ; RUN: cat %t | grep "%M = add i32 21, 21"
33 ;; Check that the second return values didn't get propagated
4 ; RUN: cat %t | grep {%N = add i32 %B, %D}
4 ; RUN: cat %t | grep "%N = add i32 %B, %D"
55
66 %0 = type { i32, i32 }
77
0 ; RUN: opt < %s -indvars -S | \
1 ; RUN: grep {ret i32 152}
1 ; RUN: grep "ret i32 152"
22
33 define i32 @main() {
44 entry:
0 ; PR726
11 ; RUN: opt < %s -indvars -S | \
2 ; RUN: grep {ret i32 27}
2 ; RUN: grep "ret i32 27"
33
44 ; Make sure to compute the right exit value based on negative strides.
55
None ; RUN: opt < %s -S -indvars | grep {= icmp} | count 3
0 ; RUN: opt < %s -S -indvars | grep "= icmp" | count 3
11 ; PR4914.ll
22
33 ; Indvars should be able to do range analysis and eliminate icmps.
None ; RUN: opt < %s -indvars -S | grep {ret i32 600000}
0 ; RUN: opt < %s -indvars -S | grep "ret i32 600000"
11 ; PR1179
22
33 define i32 @foo() {
None ; RUN: opt < %s -indvars -S | grep {ret i32 9900}
0 ; RUN: opt < %s -indvars -S | grep "ret i32 9900"
11 ; PR1179
22
33 define i32 @test4() {
None ; RUN: opt < %s -indvars -S | grep {120, %bb2.bb3_crit_edge}
0 ; RUN: opt < %s -indvars -S | grep "120, %bb2.bb3_crit_edge"
11 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"
22 target triple = "i686-pc-linux-gnu"
33
0 ; RUN: opt < %s -scalar-evolution -analyze \
1 ; RUN: | grep {\\--> (zext i4 {-7,+,-8}<%loop> to i32)}
1 ; RUN: | grep "\--> (zext i4 {-7,+,-8}<%loop> to i32)"
22
33 define fastcc void @foo() nounwind {
44 entry:
None ; RUN: opt < %s -inline -S | grep {ret i32 1}
0 ; RUN: opt < %s -inline -S | grep "ret i32 1"
11 ; ModuleID = 'short.opt.bc'
22
33 define i32 @testBool(i1 %X) {
None ; RUN: opt %s -S -inline -functionattrs -stats |& grep {Number of call sites deleted, not inlined}
1 ; RUN: opt %s -S -inline -stats |& grep {Number of functions inlined}
0 ; RUN: opt %s -S -inline -functionattrs -stats |& grep "Number of call sites deleted, not inlined"
1 ; RUN: opt %s -S -inline -stats |& grep "Number of functions inlined"
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:128:128-n8:16:32"
44 target triple = "i386-apple-darwin9.8"
0 ; RUN: opt < %s -inline -constprop -S > %t
11 ; RUN: not grep test_function %t
2 ; RUN: grep {ret i32 5} %t
2 ; RUN: grep "ret i32 5" %t
33
44
55 ; test_function should not be emitted to the .s file.
0 ; RUN: opt < %s -inline -S | \
1 ; RUN: not grep {callee\[12\](}
1 ; RUN: not grep "callee[12]("
22 ; RUN: opt < %s -inline -S | not grep mul
33
44 define internal i32 @callee1(i32 %A, i32 %B) {
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: grep {ret i1 false}
1 ; RUN: grep "ret i1 false"
22
33 define i1 @test(i1 %V) {
44 %Y = icmp ult i1 %V, false ; [#uses=1]
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: grep {ret i1 true}
1 ; RUN: grep "ret i1 true"
22 ; PR586
33
44 @g_07918478 = external global i32 ; [#uses=1]
0 ; RUN: opt < %s -instcombine -S | \
1 ; RUN: grep {icmp sgt}
1 ; RUN: grep "icmp sgt"
22 ; END.
33 target datalayout = "e-p:32:32"
44 target triple = "i686-pc-linux-gnu"
0 ; RUN: opt < %s -instcombine -S | \
11 ; RUN: grep icmp | count 1
22 ; RUN: opt < %s -instcombine -S | \
3 ; RUN: grep {icmp ugt} | count 1
3 ; RUN: grep "icmp ugt" | count 1
44 ; END.
55
66 target datalayout = "e-p:32:32"
None ; RUN: opt < %s -instcombine -S | grep {icmp ugt}
0 ; RUN: opt < %s -instcombine -S | grep "icmp ugt"
11 ; PR1107
22 ; PR1940
33
None ; RUN: opt < %s -instcombine -S | grep {fcmp uno.*0.0}
0 ; RUN: opt < %s -instcombine -S | grep "fcmp uno.*0.0"
11 ; PR1111
22 define i1 @test(double %X) {
33 %tmp = fcmp une double %X, %X
None ; RUN: opt < %s -instcombine -S | grep {ugt.*, 1}
0 ; RUN: opt < %s -instcombine -S | grep "ugt.*, 1"
11
22 define i1 @test(i32 %tmp1030) {
33 %tmp1037 = icmp ne i32 %tmp1030, 40 ; [#uses=1]
None ; RUN: opt < %s -instcombine -mem2reg -S | grep {%A = alloca}
0 ; RUN: opt < %s -instcombine -mem2reg -S | grep "%A = alloca"
11 ; RUN: opt < %s -instcombine -mem2reg -S | \
2 ; RUN: not grep {%B = alloca}
2 ; RUN: not grep "%B = alloca"
33 ; END.
44
55 ; Ensure that instcombine doesn't sink the loads in entry/cond_true into
None ; RUN: opt < %s -instcombine -S | grep {icmp sle}
0 ; RUN: opt < %s -instcombine -S | grep "icmp sle"
11 ; PR1244
22
33 define i1 @test(i32 %c.3.i, i32 %d.292.2.i) {
0 ; For PR1248
1 ; RUN: opt < %s -instcombine -S | grep {ugt i32 .*, 11}
1 ; RUN: opt < %s -instcombine -S | grep "ugt i32 .*, 11"
22 define i1 @test(i32 %tmp6) {
33 %tmp7 = sdiv i32 %tmp6, 12 ; [#uses=1]
44 icmp ne i32 %tmp7, -6 ; :1 [#uses=1]
0 ; PR1271
11 ; RUN: opt < %s -instcombine -S | \
2 ; RUN: grep {icmp eq i32 .tmp.*, 2146435072}
2 ; RUN: grep "icmp eq i32 .tmp.*, 2146435072"
33 %struct..0anon = type { i32, i32 }
44 %struct..1anon = type { double }
55
0 ; PR1271
11 ; RUN: opt < %s -instcombine -S | \
2 ; RUN: grep {ashr exact i32 %.mp137, 2}
2 ; RUN: grep "ashr exact i32 %.mp137, 2"
33
44 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"
55 target triple = "i686-pc-linux-gnu"
None ; RUN: opt < %s -instcombine -S | grep {call.*sret}
0 ; RUN: opt < %s -instcombine -S | grep "call.*sret"
11 ; Make sure instcombine doesn't drop the sret attribute.
22
33 define void @blah(i16* %tmp10) {
None ; RUN: opt < %s -instcombine -S | grep {ashr}
0 ; RUN: opt < %s -instcombine -S | grep "ashr"
11 ; PR1499
22
33 define void @av_cmp_q_cond_true(i32* %retval, i32* %tmp9, i64* %tmp10) {
None ; RUN: opt < %s -instcombine -S | grep {ret i1 true}
0 ; RUN: opt < %s -instcombine -S | grep "ret i1 true"
11 ; rdar://5278853
22
33 define i1 @test(i32 %tmp468) {
None ; RUN: opt < %s -instcombine -S | grep {call.*stacksave}
0 ; RUN: opt < %s -instcombine -S | grep "call.*stacksave"
11 ; PR1745
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-darwin8"
None ; RUN: opt < %s -instcombine -S | grep {icmp eq i32 %In, 1}
0 ; RUN: opt < %s -instcombine -S | grep "icmp eq i32 %In, 1"
11 ; PR1800
22
33 define i1 @test(i32 %In) {
None ; RUN: opt < %s -instcombine -S | grep {add} | count 1
0 ; RUN: opt < %s -instcombine -S | grep "add" | count 1
11
22 define i32 @foo(i32 %a) {
33 entry:
None ; RUN: opt < %s -instcombine -S | grep {ret i.* 0} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "ret i.* 0" | count 2
11 ; PR2048
22
33 define i32 @i(i32 %a) {
None ; RUN: opt < %s -instcombine -S | grep {sdiv i8 \%a, 9}
0 ; RUN: opt < %s -instcombine -S | grep "sdiv i8 \%a, 9"
11 ; PR2048
22
33 define i8 @i(i8 %a) {
None ; RUN: opt < %s -instcombine -S | grep {16} | count 1
0 ; RUN: opt < %s -instcombine -S | grep "16" | count 1
11
22 define i8* @bork(i8** %qux) {
33 %tmp275 = load i8** %qux, align 1
None ; RUN: opt < %s -instcombine -S | grep {store volatile}
0 ; RUN: opt < %s -instcombine -S | grep "store volatile"
11
22 define void @test() {
33 %votf = alloca <4 x float> ; <<4 x float>*> [#uses=1]
None ; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "load volatile" | count 2
11 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"
22 target triple = "i386-apple-darwin8"
33 @g_1 = internal global i32 0 ; [#uses=3]
None ; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "load volatile" | count 2
11 ; PR2262
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-darwin8"
None ; RUN: opt < %s -instcombine -S | grep {store i8} | count 3
0 ; RUN: opt < %s -instcombine -S | grep "store i8" | count 3
11 ; PR2297
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-darwin8"
None ; RUN: opt < %s -instcombine -S | grep {ret i1 false} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "ret i1 false" | count 2
11 ; PR2329
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 -instcombine -S | grep {ret i1 false}
0 ; RUN: opt < %s -instcombine -S | grep "ret i1 false"
11 ; PR2359
22 define i1 @f(i8* %x) {
33 entry:
None ; RUN: opt < %s -instcombine -S | grep {xor}
0 ; RUN: opt < %s -instcombine -S | grep "xor"
11 ; PR2389
22
33 define i1 @test(i1 %a, i1 %b) {
0 ; RUN: opt < %s -instcombine -S > %t
1 ; RUN: grep {xor} %t
2 ; RUN: grep {and} %t
3 ; RUN: not grep {div} %t
1 ; RUN: grep "xor" %t
2 ; RUN: grep "and" %t
3 ; RUN: not grep "div" %t
44
55 define i1 @foo1(i1 %a, i1 %b) {
66 %A = sub i1 %a, %b
None ; RUN: opt < %s -instcombine -S | grep {phi i32} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "phi i32" | count 2
11
22 define void @test() nounwind {
33 entry:
None ; RUN: opt < %s -instcombine -S | grep {store i32} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "store i32" | count 2
11
22 @g_139 = global i32 0 ; [#uses=2]
33
None ; RUN: opt < %s -instcombine -S | grep {store i8} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "store i8" | count 2
11
22 define i32 @a(i8* %s) nounwind {
33 entry:
None ; RUN: opt < %s -instcombine -S | grep {icmp eq i32 %In, 15}
0 ; RUN: opt < %s -instcombine -S | grep "icmp eq i32 %In, 15"
11 ; PR2479
22 ; (See also PR1800.)
33
None ; RUN: opt < %s -instcombine -S | grep {call.*llvm.stackrestore}
0 ; RUN: opt < %s -instcombine -S | grep "call.*llvm.stackrestore"
11 ; PR2488
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:32:32"
33 target triple = "i386-pc-linux-gnu"
None ; RUN: opt < %s -instcombine -S | grep {icmp ne i32 \%a}
0 ; RUN: opt < %s -instcombine -S | grep "icmp ne i32 \%a"
11 ; PR2330
22
33 define i1 @foo(i32 %a) nounwind {
None ; RUN: opt < %s -instcombine -S | grep -v {i32 8}
0 ; RUN: opt < %s -instcombine -S | grep -v "i32 8"
11 ; PR2330
22
33 define i32 @a(i32 %a) nounwind {
None ; RUN: opt < %s -instcombine -S | grep {load volatile} | count 2
0 ; RUN: opt < %s -instcombine -S | grep "load volatile" | count 2
11 ; PR2496
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-darwin8"
None ; RUN: opt < %s -instcombine -S | grep {%C = xor i1 %A, true}
1 ; RUN: opt < %s -instcombine -S | grep {ret i1 false}
0 ; RUN: opt < %s -instcombine -S | grep "%C = xor i1 %A, true"
1 ; RUN: opt < %s -instcombine -S | grep "ret i1 false"
22 ; PR2539
33
44 define i1 @test1(i1 %A) {
None ; RUN: opt < %s -instcombine -S | grep {lshr.*3}
1 ; RUN: opt < %s -instcombine -S | grep {call .*%cond}
0 ; RUN: opt < %s -instcombine -S | grep "lshr.*3"
1 ; RUN: opt < %s -instcombine -S | grep "call .*%cond"
22 ; PR2506
33
44 ; We can simplify the operand of udiv to '8', but not the operand to the
None ; RUN: opt < %s -instcombine -S | grep {or i1}
0 ; RUN: opt < %s -instcombine -S | grep "or i1"
11 ; PR2844
22
33 define i32 @test(i32 %p_74) {