llvm.org GIT mirror llvm / a0126af
FileCheckize these testcases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154281 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
15 changed file(s) with 119 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-as < %s | llvm-dis | grep 7 | count 3
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
11
2 ; CHECK: @foo
3 ; CHECK: store { i32, i32 } { i32 7, i32 9 }, { i32, i32 }* %x
4 ; CHECK: ret
25 define void @foo({i32, i32}* %x) nounwind {
36 store {i32, i32}{i32 7, i32 9}, {i32, i32}* %x
47 ret void
58 }
9
10 ; CHECK: @foo_empty
11 ; CHECK: store {} zeroinitializer, {}* %x
12 ; CHECK: ret
613 define void @foo_empty({}* %x) nounwind {
714 store {}{}, {}* %x
815 ret void
916 }
17
18 ; CHECK: @bar
19 ; CHECK: store [2 x i32] [i32 7, i32 9], [2 x i32]* %x
20 ; CHECK: ret
1021 define void @bar([2 x i32]* %x) nounwind {
1122 store [2 x i32][i32 7, i32 9], [2 x i32]* %x
1223 ret void
1324 }
25
26 ; CHECK: @bar_empty
27 ; CHECK: store [0 x i32] undef, [0 x i32]* %x
28 ; CHECK: ret
1429 define void @bar_empty([0 x i32]* %x) nounwind {
1530 store [0 x i32][], [0 x i32]* %x
1631 ret void
1732 }
33
34 ; CHECK: @qux
35 ; CHECK: store <{ i32, i32 }> <{ i32 7, i32 9 }>, <{ i32, i32 }>* %x
36 ; CHECK: ret
1837 define void @qux(<{i32, i32}>* %x) nounwind {
1938 store <{i32, i32}><{i32 7, i32 9}>, <{i32, i32}>* %x
2039 ret void
2140 }
41
42 ; CHECK: @qux_empty
43 ; CHECK: store <{}> zeroinitializer, <{}>* %x
44 ; CHECK: ret
2245 define void @qux_empty(<{}>* %x) nounwind {
2346 store <{}><{}>, <{}>* %x
2447 ret void
0 ; RUN: llvm-as < %s > %t
1 ; RUN: llvm-nm %t | grep foo
2 ; test for isBitcodeFile, llvm-nm must read from a file for this test
1 ; RUN: llvm-nm %t | FileCheck %s
2 ; Test for isBitcodeFile, llvm-nm must read from a file for this test.
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"
44 target triple = "i686-apple-darwin9.2.2"
5
6 ; CHECK: foo
57
68 define i32 @foo() {
79 ret i32 0
None ; RUN: not llvm-as < %s |& grep {invalid indices for extractvalue}
0 ; RUN: not llvm-as < %s |& FileCheck %s
11 ; PR4170
2
3 ; CHECK: invalid indices for extractvalue
24
35 define void @test() {
46 entry:
None ; RUN: not llvm-as < %s >/dev/null |& grep {invalid getelementptr indices}
0 ; RUN: not llvm-as < %s >/dev/null |& FileCheck %s
11 ; Test the case of a incorrect indices type into struct
2
3 ; CHECK: invalid getelementptr indices
24
35 %RT = type { i8 , [10 x [20 x i32]], i8 }
46 %ST = type { i32, double, %RT }
None ; RUN: llvm-as < %s | llvm-dis | grep 18446744073709551615 | count 2
0 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
11
2 ; CHECK: define [18446744073709551615 x i8]* @foo() {
3 ; CHECK: ret [18446744073709551615 x i8]* null
24 define [18446744073709551615 x i8]* @foo() {
35 ret [18446744073709551615 x i8]* null
46 }
None ; RUN: llvm-as < %s | llvm-dis > %t
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
11 ; RUN: grep insertvalue %t | count 1
22 ; RUN: grep extractvalue %t | count 1
33
4 ; CHECK: @foo
5 ; CHECK-NEXT: load
6 ; CHECK-NEXT: extractvalue
7 ; CHECK-NEXT: insertvalue
8 ; CHECK-NEXT: store
9 ; CHECK-NEXT: ret
410 define float @foo({{i32},{float, double}}* %p) nounwind {
511 %t = load {{i32},{float, double}}* %p
612 %s = extractvalue {{i32},{float, double}} %t, 1, 0
814 store {{i32},{float, double}} %r, {{i32},{float, double}}* %p
915 ret float %s
1016 }
17
18 ; CHECK: @bar
19 ; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } { i32 4 }, { float, double } { float 4.000000e+00, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
20 ; CHECK-NEXT: ret float 7.000000e+00
1121 define float @bar({{i32},{float, double}}* %p) nounwind {
1222 store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, 1, 1), {{i32},{float, double}}* %p
1323 ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0)
1424 }
25
26 ; CHECK: @car
27 ; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } undef, { float, double } { float undef, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
28 ; CHECK-NEXT: ret float undef
1529 define float @car({{i32},{float, double}}* %p) nounwind {
1630 store {{i32},{float, double}} insertvalue ({{i32},{float, double}} undef, double 20.0, 1, 1), {{i32},{float, double}}* %p
1731 ret float extractvalue ({{i32},{float, double}} undef, 1, 0)
1832 }
33
34 ; CHECK: @dar
35 ; CHECK-NEXT: store { { i32 }, { float, double } } { { i32 } zeroinitializer, { float, double } { float 0.000000e+00, double 2.000000e+01 } }, { { i32 }, { float, double } }* %p
36 ; CHECK-NEXT: ret float 0.000000e+00
1937 define float @dar({{i32},{float, double}}* %p) nounwind {
2038 store {{i32},{float, double}} insertvalue ({{i32},{float, double}} zeroinitializer, double 20.0, 1, 1), {{i32},{float, double}}* %p
2139 ret float extractvalue ({{i32},{float, double}} zeroinitializer, 1, 0)
2240 }
2341
24
2542 ; PR4963
43 ; CHECK: @test57
44 ; CHECK-NEXT: ret <{ i32, i32 }> <{ i32 0, i32 4 }>
2645 define <{ i32, i32 }> @test57() {
2746 ret <{ i32, i32 }> insertvalue (<{ i32, i32 }> zeroinitializer, i32 4, 1)
2847 }
None ; RUN: not llvm-as < %s |& grep {invalid indices for insertvalue}
0 ; RUN: not llvm-as < %s |& FileCheck %s
1
2 ; CHECK: invalid indices for insertvalue
13
24 define void @test() {
35 entry:
4 insertvalue [0 x i32] undef, i32 0, 0
5 ret void
6 insertvalue [0 x i32] undef, i32 0, 0
7 ret void
68 }
None ; RUN: not llvm-as < %s |& grep {invalid cast opcode}
0 ; RUN: not llvm-as < %s |& FileCheck %s
1
2 ; CHECK: invalid cast opcode for cast from '<4 x i64>' to '<3 x i8>'
13
24 define <3 x i8> @foo(<4 x i64> %x) {
35 %y = trunc <4 x i64> %x to <3 x i8>
None ; RUN: not llvm-as < %s |& grep {invalid cast opcode}
0 ; RUN: not llvm-as < %s |& FileCheck %s
1
2 ; CHECK: invalid cast opcode for cast from '<4 x i64>' to 'i8'
13
24 define i8 @foo(<4 x i64> %x) {
35 %y = trunc <4 x i64> %x to i8
None ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {ret void, !bar !1, !foo !0}
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
1
2 ; CHECK: @test
3 ; CHECK: ret void, !bar !1, !foo !0
14 define void @test() {
25 add i32 2, 1, !bar !0
36 add i32 1, 2, !foo !1
4
57 call void @llvm.dbg.func.start(metadata !"foo")
6
78 extractvalue {{i32, i32}, i32} undef, 0, 1, !foo !0
8
99 ret void, !foo !0, !bar !1
1010 }
1111
1414
1515 declare void @llvm.dbg.func.start(metadata) nounwind readnone
1616
17
1817 !foo = !{ !0 }
1918 !bar = !{ !1 }
20
21 ; !foo = !{ !0, !"foo" }
None ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {icmp slt}
1 ; rudimentary test of fcmp/icmp on vectors returning vector of bool
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
1 ; Rudimentary test of fcmp/icmp on vectors returning vector of bool
22
3 ; CHECK: @ffoo
4 ; CHECK: fcmp olt <4 x float> %a, %b
35 define <4 x i1> @ffoo(<4 x float> %a, <4 x float> %b) nounwind {
46 entry:
5 %cmp = fcmp olt <4 x float> %a, %b ; <4 x i1> [#uses=1]
6 ret <4 x i1> %cmp
7 %cmp = fcmp olt <4 x float> %a, %b ; <4 x i1> [#uses=1]
8 ret <4 x i1> %cmp
79 }
810
11 ; CHECK: @ifoo
12 ; CHECK: icmp slt <4 x i32> %a, %b
913 define <4 x i1> @ifoo(<4 x i32> %a, <4 x i32> %b) nounwind {
1014 entry:
11 %cmp = icmp slt <4 x i32> %a, %b ; <4 x i1> [#uses=1]
12 ret <4 x i1> %cmp
15 %cmp = icmp slt <4 x i32> %a, %b ; <4 x i1> [#uses=1]
16 ret <4 x i1> %cmp
1317 }
14
None ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep {global.*icmp slt}
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
11 ; PR2317
22 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
33 target triple = "i686-apple-darwin9.2.2"
44
5 ; CHECK: @1 = global <4 x i1>
6
57 define <4 x i1> @foo(<4 x float> %a, <4 x float> %b) nounwind {
68 entry:
7 %cmp = fcmp olt <4 x float> %a, %b ; <4 x i32> [#uses=1]
8 ret <4 x i1> %cmp
9 %cmp = fcmp olt <4 x float> %a, %b ; <4 x i32> [#uses=1]
10 ret <4 x i1> %cmp
911 }
1012
1113 global <4 x i1> icmp slt ( <4 x i32> , <4 x i32> )
12
1314 @B = external global i32
14
1515 global <4 x i1> icmp slt ( <4 x i32> , <4 x i32> )
None ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep select
1 ; rudimentary test of select on vectors returning vector of bool
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
1 ; Rudimentary test of select on vectors returning vector of bool
22
3 define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b,
4 <4 x i1> %cond) nounwind {
3 ; CHECK: @foo
4 ; CHECK: select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b
5 define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b, <4 x i1> %cond) nounwind {
56 entry:
6 %cmp = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b
7 ; <4 x i32> [#uses=1]
7 %cmp = select <4 x i1> %cond, <4 x i32> %a, <4 x i32> %b
88 ret <4 x i32> %cmp
99 }
1010
None ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep shl | count 1
1 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep ashr | count 1
2 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | grep lshr | count 1
0 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
31
2 ; CHECK: @foo
3 ; CHECK: shl
44 define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind {
55 entry:
6 %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1]
7 ret <4 x i32> %cmp
6 %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1]
7 ret <4 x i32> %cmp
88 }
99
10 ; CHECK: @bar
11 ; CHECK: lshr
1012 define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind {
1113 entry:
12 %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
13 ret <4 x i32> %cmp
14 %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
15 ret <4 x i32> %cmp
1416 }
1517
18 ; CHECK: @baz
19 ; CHECK: ashr
1620 define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind {
1721 entry:
18 %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
19 ret <4 x i32> %cmp
22 %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
23 ret <4 x i32> %cmp
2024 }
2125
2226 ; Constant expressions: these should be folded.
27
28 ; CHECK: @foo_ce
29 ; CHECK: ret <2 x i64>
2330 define <2 x i64> @foo_ce() nounwind {
2431 ret <2 x i64> shl (<2 x i64> , <2 x i64> )
2532 }
33
34 ; CHECK: @bar_ce
35 ; CHECK: ret <2 x i64>
2636 define <2 x i64> @bar_ce() nounwind {
2737 ret <2 x i64> lshr (<2 x i64> , <2 x i64> )
2838 }
39
40 ; CHECK: baz_ce
41 ; CHECK: ret <2 x i64>
2942 define <2 x i64> @baz_ce() nounwind {
3043 ret <2 x i64> ashr (<2 x i64> , <2 x i64> )
3144 }
None ; RUN: not llvm-dis < %s.bc > /dev/null |& grep "Invalid MODULE_CODE_FUNCTION record"
0 ; RUN: not llvm-dis < %s.bc > /dev/null |& FileCheck %s
11 ; PR8494
2
3 ; CHECK: Invalid MODULE_CODE_FUNCTION record