llvm.org GIT mirror llvm / 5efe566
Use llvm-link -S instead of using llvm-dis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81860 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
21 changed file(s) with 24 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
22
33 ; 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 | llvm-dis | 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
22
33 ; 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 | llvm-dis | 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
33 ; 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
6 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep foo | grep linkonce
6 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep foo | grep linkonce
77
88 declare void @foo()
99
55
66 ; 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 | llvm-dis | 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
0 ; RUN: llvm-as < %s > %t.out1.bc
11 ; RUN: echo {@S = external global \{ i32, opaque* \} declare void @F(opaque*)}\
22 ; RUN: | llvm-as > %t.out2.bc
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | not grep opaque
3 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep opaque
44
55 ; After linking this testcase, there should be no opaque types left. The two
66 ; S's should cause the opaque type to be resolved to 'int'.
0 ; RUN: llvm-as < %s > %t.out1.bc
11 ; RUN: echo { %M = type \[8 x i32\] external global %M } | llvm-as > %t.out2.bc
2 ; RUN: llvm-link %t.out1.bc %t.out2.bc | llvm-dis | grep %M | grep \\{
2 ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep %M | grep \\{
33 %M = type { i32 }
44
55
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 | llvm-dis | 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.
22
33 ; 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 | llvm-dis | 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
22
33 ; 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 | llvm-dis | 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]
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 | llvm-dis | 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'.
11
22 ; 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 | llvm-dis | 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
22 ; RUN: llvm-as %s -o %t.foo1.bc
33 ; RUN: llvm-as %s -o %t.foo2.bc
44 ; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc
5 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis
6 ; RUN: llvm-link %t.foo1.bc %t.foo3.bc | llvm-dis
5 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S
6 ; 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 | llvm-dis | grep {addrspace(2)}
5 ; RUN: llvm-link %t.foo1.bc %t.foo2.bc | llvm-dis | 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
22 ; 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
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 4 | grep 8
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 4 | grep 8
66
77 @X = appending global [2 x i32] [ i32 7, i32 4 ] ; <[2 x i32]*> [#uses=2]
88 @Y = global i32* getelementptr ([2 x i32]* @X, i64 0, i64 0) ; [#uses=0]
22 ; 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
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep 7 | grep 8
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 8
66
77 @X = appending global [1 x i32] [ i32 7 ] ; <[1 x i32]*> [#uses=0]
22 ; RUN: echo {@X = constant \[1 x i32\] \[i32 8\] } | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
66
77 @X = external global [1 x i32] ; <[1 x i32]*> [#uses=0]
88
22 ; RUN: echo {@X = external global \[1 x i32\] } | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
66
77 @X = constant [1 x i32] [ i32 12 ] ; <[1 x i32]*> [#uses=0]
88
22 ; RUN: echo {@X = external constant \[1 x i32\] } | \
33 ; RUN: llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis | grep constant
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant
66
77 @X = external global [1 x i32] ; <[1 x i32]*> [#uses=0]
22
33 ; RUN: echo "@X = linkonce global i32 8" | llvm-as > %t.2.bc
44 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.1.bc %t.2.bc | llvm-dis
5 ; RUN: llvm-link %t.1.bc %t.2.bc -S
66
77 @X = linkonce global i32 7 ; [#uses=0]
0 ; RUN: llvm-as %s -o %t1.bc
11 ; 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
2 ; RUN: llvm-link %t2.bc %t1.bc -o - | llvm-dis | grep __eprintf
3 ; RUN: llvm-link %t1.bc %t2.bc -o - | llvm-dis | grep __eprintf
2 ; RUN: llvm-link %t2.bc %t1.bc -S | grep __eprintf
3 ; RUN: llvm-link %t1.bc %t2.bc -S | grep __eprintf
44
55 ; rdar://6072702
66
0 ; RUN: llvm-as < %s > %t.bc
11 ; RUN: llvm-as < %p/linknamedmdnode2.ll > %t2.bc
2 ; RUN: llvm-link %t.bc %t2.bc | llvm-dis | grep "!llvm.stuff = !{!0, !1}"
2 ; RUN: llvm-link %t.bc %t2.bc -S | grep "!llvm.stuff = !{!0, !1}"
33
44 !0 = metadata !{i32 42}
55 !llvm.stuff = !{!0}