llvm.org GIT mirror llvm / b6cb66f
Renamed `as' => `llvm-as', `dis' => `llvm-dis', `link' => `llvm-link'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8545 91177308-0d34-0410-b5e6-96231b3b80d8 Misha Brukman 16 years ago
23 changed file(s) with 70 addition(s) and 70 deletion(s). Raw diff Collapse all Expand all
None ; RUN: as < %s > %t.bc
1 ; RUN: echo | as > %t.tmp.bc
2 ; RUN: link %t.tmp.bc %t.bc
0 ; RUN: llvm-as < %s > %t.bc
1 ; RUN: echo | llvm-as > %t.tmp.bc
2 ; RUN: llvm-link %t.tmp.bc %t.bc
33
44 %X = constant int 5
55 %Y = internal global [2 x int*] [ int* %X, int * %X]
0 ; This fails linking when it is linked with an empty file as the first object file
11
2 ; RUN: as > %t1.bc < /dev/null
3 ; RUN: as < %s > %t2.bc
4 ; RUN: link %t[12].bc
2 ; RUN: llvm-as > %t1.bc < /dev/null
3 ; RUN: llvm-as < %s > %t2.bc
4 ; RUN: llvm-link %t[12].bc
55
66 %work = global int (int, int)* %zip
77
0 ; This fails linking when it is linked with an empty file as the first object file
11
2 ; RUN: as > %t.LinkTest.bc < /dev/null
3 ; RUN: as < %s > %t.bc
4 ; RUN: link %t.LinkTest.bc %t.bc
2 ; RUN: llvm-as > %t.LinkTest.bc < /dev/null
3 ; RUN: llvm-as < %s > %t.bc
4 ; RUN: llvm-link %t.LinkTest.bc %t.bc
55
66 %work = global int 4
77 %test = global int* getelementptr( int* %work, long 1)
0 ; This fails because the linker renames the external symbol not the internal
11 ; one...
22
3 ; RUN: echo "implementation internal int %foo() { ret int 7 }" | as > %t.1.bc
4 ; RUN: as < %s > %t.2.bc
5 ; RUN: link %t.[12].bc | dis | grep '%foo()' | grep -v internal
3 ; RUN: echo "implementation internal int %foo() { ret int 7 }" | llvm-as > %t.1.bc
4 ; RUN: llvm-as < %s > %t.2.bc
5 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep '%foo()' | grep -v internal
66
77 implementation
88 int %foo() { ret int 0 }
0 ; This fails because the linker renames the non-opaque type not the opaque
11 ; one...
22
3 ; RUN: echo "%Ty = type opaque" | as > %t.1.bc
4 ; RUN: as < %s > %t.2.bc
5 ; RUN: link %t.[12].bc | dis | grep '%Ty ' | grep -v opaque
3 ; RUN: echo "%Ty = type opaque" | llvm-as > %t.1.bc
4 ; RUN: llvm-as < %s > %t.2.bc
5 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep '%Ty ' | grep -v opaque
66
77 %Ty = type int
88
None ; RUN: echo "%X = linkonce global int 5 implementation linkonce int %foo() { ret int 7 }" | as > %t.1.bc
1 ; RUN: as < %s > %t.2.bc
2 ; RUN: link %t.[12].bc
0 ; RUN: echo "%X = linkonce global int 5 implementation linkonce int %foo() { ret int 7 }" | llvm-as > %t.1.bc
1 ; RUN: llvm-as < %s > %t.2.bc
2 ; RUN: llvm-link %t.[12].bc
33 %X = external global int
44
55 implementation
0 ; This fails because the linker renames the non-opaque type not the opaque
11 ; one...
22
3 ; RUN: echo "implementation linkonce void %foo() { ret void } " | as > %t.2.bc
4 ; RUN: as < %s > %t.1.bc
5 ; RUN: link %t.[12].bc | dis | grep foo | grep linkonce
3 ; RUN: echo "implementation linkonce void %foo() { ret void } " | llvm-as > %t.2.bc
4 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep foo | grep linkonce
66
77 declare void %foo()
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 int" | as > %t.2.bc
4 ; RUN: as < %s > %t.1.bc
5 ; RUN: link %t.[12].bc
3 ; RUN: echo "%T = type int" | llvm-as > %t.2.bc
4 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.[12].bc
66
77 %T = type opaque
88
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 "%S = type { %T*} %T = type opaque" | as > %t.2.bc
4 ; RUN: as < %s > %t.1.bc
5 ; RUN: link %t.[12].bc
3 ; RUN: echo "%S = type { %T*} %T = type opaque" | llvm-as > %t.2.bc
4 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.[12].bc
66
77 %S = type { %T* }
88 %T = type int
None ; The funcresolve pass will (intentionally) link an _internal_ function body with an
0 ; The funcresolve pass will (intentionally) llvm-link an _internal_ function body with an
11 ; external declaration. Because of this, if we LINK an internal function body into
22 ; a program that already has an external declaration for the function name, we must
33 ; rename the internal function to something that does not conflict.
44
5 ; RUN: echo "implementation internal int %foo() { ret int 7 }" | as > %t.1.bc
6 ; RUN: as < %s > %t.2.bc
7 ; RUN: link %t.[12].bc | dis | grep 'internal' | not grep '%foo('
5 ; RUN: echo "implementation internal int %foo() { ret int 7 }" | llvm-as > %t.1.bc
6 ; RUN: llvm-as < %s > %t.2.bc
7 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep 'internal' | not grep '%foo('
88
99 implementation
1010 declare int %foo()
None ; RUN: echo "%T = type opaque" | as > %t.2.bc
1 ; RUN: as < %s > %t.1.bc
2 ; RUN: link %t.[12].bc
0 ; RUN: echo "%T = type opaque" | llvm-as > %t.2.bc
1 ; RUN: llvm-as < %s > %t.1.bc
2 ; RUN: llvm-link %t.[12].bc
33
44 %T = type opaque
55 %a = constant { %T* } { %T* null }
None ; RUN: echo "%T = type int" | as > %t.1.bc
1 ; RUN: as < %s > %t.2.bc
2 ; RUN: link %t.[12].bc
0 ; RUN: echo "%T = type int" | llvm-as > %t.1.bc
1 ; RUN: llvm-as < %s > %t.2.bc
2 ; RUN: llvm-link %t.[12].bc
33
44 %T = type opaque
55
0
1 ; RUN: as < %s > Output/%s.out1.bc
2 ; RUN: echo "%S = type { int, int* }" | as > Output/%s.out2.bc
3 ; RUN: link Output/%s.out[12].bc
1 ; RUN: llvm-as < %s > Output/%s.out1.bc
2 ; RUN: echo "%S = type { int, int* }" | llvm-as > Output/%s.out2.bc
3 ; RUN: llvm-link Output/%s.out[12].bc
44
55 %T = type opaque
66 %S = type { int, %T* }
None ; RUN: as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = external global { int, opaque* } declare void %F(opaque*)" | as > Output/%s.out2.bc
2 ; RUN: link Output/%s.out[12].bc | dis | not grep opaque
0 ; RUN: llvm-as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = external global { int, opaque* } declare void %F(opaque*)" | llvm-as > Output/%s.out2.bc
2 ; RUN: llvm-link Output/%s.out[12].bc | llvm-dis | not grep opaque
33
44 ; After linking this testcase, there should be no opaque types left. The two
55 ; S's should cause the opaque type to be resolved to 'int'.
0 ; It's a bad idea to go recursively traipsing through types without a safety
11 ; net.
22
3 ; RUN: as < %s > Output/%s.out1.bc
4 ; RUN: echo "%S = type { %S*, int* }" | as > Output/%s.out2.bc
5 ; RUN: link Output/%s.out[12].bc
3 ; RUN: llvm-as < %s > Output/%s.out1.bc
4 ; RUN: echo "%S = type { %S*, int* }" | llvm-as > Output/%s.out2.bc
5 ; RUN: llvm-link Output/%s.out[12].bc
66
77 %S = type { %S*, opaque* }
0 ; Linking these a module with a specified pointer size to one without a
11 ; specified pointer size should not cause a warning!
22
3 ; RUN: as < %s > Output/%s.out1.bc
4 ; RUN: echo "" | as > Output/%s.out2.bc
5 ; RUN: link Output/%s.out[12].bc 2>&1 | not grep WARNING
3 ; RUN: llvm-as < %s > Output/%s.out1.bc
4 ; RUN: echo "" | llvm-as > Output/%s.out2.bc
5 ; RUN: llvm-link Output/%s.out[12].bc 2>&1 | not grep WARNING
66
77 target pointersize = 64
88
None ; RUN: as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | as > Output/%s.out2.bc
2 ; RUN: link Output/%s.out[21].bc
0 ; RUN: llvm-as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | llvm-as > Output/%s.out2.bc
2 ; RUN: llvm-link Output/%s.out[21].bc
33
44 %S = type opaque
55
None ; RUN: as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | as > Output/%s.out2.bc
2 ; RUN: link Output/%s.out[21].bc
0 ; RUN: llvm-as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | llvm-as > Output/%s.out2.bc
2 ; RUN: llvm-link Output/%s.out[21].bc
33
44 %S = type opaque
55
None ; RUN: as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | as > Output/%s.out2.bc
2 ; RUN: link Output/%s.out[21].bc
0 ; RUN: llvm-as < %s > Output/%s.out1.bc
1 ; RUN: echo "%S = type int" | llvm-as > Output/%s.out2.bc
2 ; RUN: llvm-link Output/%s.out[21].bc
33
44 %S = type opaque
55
0 ; Test that appending linkage works correctly.
11
2 ; RUN: echo "%X = appending global [1x int] [int 8]" | as > %t.2.bc
3 ; RUN: as < %s > %t.1.bc
4 ; RUN: link %t.[12].bc | dis | grep 7 | grep 4 | grep 8
2 ; RUN: echo "%X = appending global [1x int] [int 8]" | llvm-as > %t.2.bc
3 ; RUN: llvm-as < %s > %t.1.bc
4 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep 7 | grep 4 | grep 8
55
66 %X = appending global [2 x int] [int 7, int 4]
77
0 ; Test that appending linkage works correctly when arrays are the same size.
11
2 ; RUN: echo "%X = appending global [1x int] [int 8]" | as > %t.2.bc
3 ; RUN: as < %s > %t.1.bc
4 ; RUN: link %t.[12].bc | dis | grep 7 | grep 8
2 ; RUN: echo "%X = appending global [1x int] [int 8]" | llvm-as > %t.2.bc
3 ; RUN: llvm-as < %s > %t.1.bc
4 ; RUN: llvm-link %t.[12].bc | llvm-dis | grep 7 | grep 8
55
66 %X = appending global [1 x int] [int 7]
0 ; This fails because the linker renames the non-opaque type not the opaque
11 ; one...
22
3 ; RUN: echo "%X = linkonce global int 8" | as > %t.2.bc
4 ; RUN: as < %s > %t.1.bc
5 ; RUN: link %t.[12].bc | dis
3 ; RUN: echo "%X = linkonce global int 8" | llvm-as > %t.2.bc
4 ; RUN: llvm-as < %s > %t.1.bc
5 ; RUN: llvm-link %t.[12].bc | llvm-dis
66
77 %X = linkonce global int 7
None ; RUN: as < %s > %t.bc
1 ; RUN: as < `dirname %s`/testlink2.ll > %t2.bc
2 ; RUN: link %t.bc %t2.bc
0 ; RUN: llvm-as < %s > %t.bc
1 ; RUN: llvm-as < `dirname %s`/testlink2.ll > %t2.bc
2 ; RUN: llvm-link %t.bc %t2.bc
33
44 %MyVar = external global int
55 %MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }