diff options
Diffstat (limited to 'test/Linker')
46 files changed, 105 insertions, 122 deletions
diff --git a/test/Linker/2003-01-30-LinkerRename.ll b/test/Linker/2003-01-30-LinkerRename.ll index cc34634..e7431ec 100644 --- a/test/Linker/2003-01-30-LinkerRename.ll +++ b/test/Linker/2003-01-30-LinkerRename.ll @@ -1,9 +1,9 @@ ; This fails because the linker renames the external symbol not the internal ; one... -; RUN: echo {define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc +; RUN: echo "define internal i32 @foo() { ret i32 7 } " | llvm-as > %t.1.bc ; RUN: llvm-as %s -o %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {@foo()} | grep -v internal +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "@foo()" | grep -v internal define i32 @foo() { ret i32 0 } diff --git a/test/Linker/2003-01-30-LinkerTypeRename.ll b/test/Linker/2003-01-30-LinkerTypeRename.ll index 043457d..94fb5e0 100644 --- a/test/Linker/2003-01-30-LinkerTypeRename.ll +++ b/test/Linker/2003-01-30-LinkerTypeRename.ll @@ -1,9 +1,9 @@ ; This fails because the linker renames the non-opaque type not the opaque ; one... -; RUN: echo {%%Ty = type opaque @GV = external global %%Ty*} | llvm-as > %t.1.bc +; RUN: echo "%%Ty = type opaque @GV = external global %%Ty*" | llvm-as > %t.1.bc ; RUN: llvm-as < %s > %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {%%Ty } | not grep opaque +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "%%Ty " | not grep opaque %Ty = type {i32} diff --git a/test/Linker/2003-04-21-Linkage.ll b/test/Linker/2003-04-21-Linkage.ll deleted file mode 100644 index f6d4c4b..0000000 --- a/test/Linker/2003-04-21-Linkage.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: echo {@X = linkonce global i32 5 \ -; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc -; RUN: llvm-as %s -o %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc -@X = external global i32 - -declare i32 @foo() - -define void @bar() { - load i32* @X - call i32 @foo() - ret void -} - diff --git a/test/Linker/2003-04-23-LinkOnceLost.ll b/test/Linker/2003-04-23-LinkOnceLost.ll index beaf6ec..98a943a 100644 --- a/test/Linker/2003-04-23-LinkOnceLost.ll +++ b/test/Linker/2003-04-23-LinkOnceLost.ll @@ -1,7 +1,7 @@ ; This fails because the linker renames the non-opaque type not the opaque ; one... -; RUN: echo { define linkonce void @foo() \{ ret void \} } | \ +; RUN: echo " define linkonce void @foo() { ret void } " | \ ; RUN: llvm-as -o %t.2.bc ; RUN: llvm-as %s -o %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep foo | grep linkonce diff --git a/test/Linker/2003-04-26-NullPtrLinkProblem.ll b/test/Linker/2003-04-26-NullPtrLinkProblem.ll index d23df1b..5e8249b 100644 --- a/test/Linker/2003-04-26-NullPtrLinkProblem.ll +++ b/test/Linker/2003-04-26-NullPtrLinkProblem.ll @@ -1,7 +1,7 @@ ; This one fails because the LLVM runtime is allowing two null pointers of ; the same type to be created! -; RUN: echo {%%T = type i32} | llvm-as > %t.2.bc +; RUN: echo "%%T = type i32" | llvm-as > %t.2.bc ; RUN: llvm-as %s -o %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc diff --git a/test/Linker/2003-05-15-TypeProblem.ll b/test/Linker/2003-05-15-TypeProblem.ll index 18fcea0..c1fe334 100644 --- a/test/Linker/2003-05-15-TypeProblem.ll +++ b/test/Linker/2003-05-15-TypeProblem.ll @@ -1,7 +1,7 @@ ; This one fails because the LLVM runtime is allowing two null pointers of ; the same type to be created! -; RUN: echo {%M = type \{ %N*\} %N = type opaque} | llvm-as > %t.2.bc +; RUN: echo "%M = type { %N*} %N = type opaque" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc diff --git a/test/Linker/2003-05-31-LinkerRename.ll b/test/Linker/2003-05-31-LinkerRename.ll index 80e0a69..dff861d 100644 --- a/test/Linker/2003-05-31-LinkerRename.ll +++ b/test/Linker/2003-05-31-LinkerRename.ll @@ -4,9 +4,9 @@ ; the function name, we must rename the internal function to something that ; does not conflict. -; RUN: echo { define internal i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc +; RUN: echo " define internal i32 @foo() { ret i32 7 } " | llvm-as > %t.1.bc ; RUN: llvm-as < %s > %t.2.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep internal | not grep {@foo(} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep internal | not grep "@foo(" declare i32 @foo() diff --git a/test/Linker/2003-06-02-TypeResolveProblem.ll b/test/Linker/2003-06-02-TypeResolveProblem.ll index 0b0e9c1..fa24b6d 100644 --- a/test/Linker/2003-06-02-TypeResolveProblem.ll +++ b/test/Linker/2003-06-02-TypeResolveProblem.ll @@ -1,4 +1,4 @@ -; RUN: echo {%%T = type opaque} | llvm-as > %t.2.bc +; RUN: echo "%%T = type opaque" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc diff --git a/test/Linker/2003-06-02-TypeResolveProblem2.ll b/test/Linker/2003-06-02-TypeResolveProblem2.ll index 3f9fd04..3ae23a2 100644 --- a/test/Linker/2003-06-02-TypeResolveProblem2.ll +++ b/test/Linker/2003-06-02-TypeResolveProblem2.ll @@ -1,4 +1,4 @@ -; RUN: echo {%%T = type i32} | llvm-as > %t.1.bc +; RUN: echo "%%T = type i32" | llvm-as > %t.1.bc ; RUN: llvm-as < %s > %t.2.bc ; RUN: llvm-link %t.1.bc %t.2.bc diff --git a/test/Linker/2003-08-20-OpaqueTypeResolve.ll b/test/Linker/2003-08-20-OpaqueTypeResolve.ll index c0fc620..175146f 100644 --- a/test/Linker/2003-08-20-OpaqueTypeResolve.ll +++ b/test/Linker/2003-08-20-OpaqueTypeResolve.ll @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s > %t.out1.bc -; RUN: echo {%M = type \{ i32, i32* \} } | llvm-as > %t.out2.bc +; RUN: echo "%M = type { i32, i32* } " | llvm-as > %t.out2.bc ; RUN: llvm-link %t.out1.bc %t.out2.bc %M = type { i32, %N* } diff --git a/test/Linker/2003-08-23-GlobalVarLinking.ll b/test/Linker/2003-08-23-GlobalVarLinking.ll index 255cb88..e934836 100644 --- a/test/Linker/2003-08-23-GlobalVarLinking.ll +++ b/test/Linker/2003-08-23-GlobalVarLinking.ll @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s > %t.out1.bc -; RUN: echo {%%T1 = type opaque %%T2 = type opaque @S = external global \{ i32, %%T1* \} declare void @F(%%T2*)}\ +; RUN: echo "%%T1 = type opaque %%T2 = type opaque @S = external global { i32, %%T1* } declare void @F(%%T2*)"\ ; RUN: | llvm-as > %t.out2.bc ; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep opaque diff --git a/test/Linker/2003-08-24-InheritPtrSize.ll b/test/Linker/2003-08-24-InheritPtrSize.ll index f93c054..51d544b 100644 --- a/test/Linker/2003-08-24-InheritPtrSize.ll +++ b/test/Linker/2003-08-24-InheritPtrSize.ll @@ -2,8 +2,8 @@ ; specified pointer size should not cause a warning! ; RUN: llvm-as < %s > %t.out1.bc -; RUN: echo {} | llvm-as > %t.out2.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc |& not grep warning +; RUN: echo "" | llvm-as > %t.out2.bc +; RUN: llvm-link %t.out1.bc %t.out2.bc 2>&1 | not grep warning target datalayout = "e-p:64:64" diff --git a/test/Linker/2004-12-03-DisagreeingType.ll b/test/Linker/2004-12-03-DisagreeingType.ll index 570bda8..73d7a40 100644 --- a/test/Linker/2004-12-03-DisagreeingType.ll +++ b/test/Linker/2004-12-03-DisagreeingType.ll @@ -1,7 +1,7 @@ -; RUN: echo {@G = weak global \{\{\{\{double\}\}\}\} zeroinitializer } | \ +; RUN: echo "@G = weak global {{{{double}}}} zeroinitializer " | \ ; RUN: llvm-as > %t.out2.bc ; RUN: llvm-as < %s > %t.out1.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep {\\}} +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | not grep "}" ; When linked, the global above should be eliminated, being merged with the ; global below. diff --git a/test/Linker/2005-02-12-ConstantGlobals-2.ll b/test/Linker/2005-02-12-ConstantGlobals-2.ll index 2ceae31..30bfafe 100644 --- a/test/Linker/2005-02-12-ConstantGlobals-2.ll +++ b/test/Linker/2005-02-12-ConstantGlobals-2.ll @@ -1,8 +1,8 @@ ; Test that a prototype can be marked const, and the definition is allowed ; to be nonconst. -; RUN: echo {@X = external constant i32} | llvm-as > %t.2.bc +; RUN: echo "@X = external constant i32" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "global i32 7" @X = global i32 7 diff --git a/test/Linker/2005-02-12-ConstantGlobals.ll b/test/Linker/2005-02-12-ConstantGlobals.ll index 60f176b..93709cf 100644 --- a/test/Linker/2005-02-12-ConstantGlobals.ll +++ b/test/Linker/2005-02-12-ConstantGlobals.ll @@ -1,8 +1,8 @@ ; Test that a prototype can be marked const, and the definition is allowed ; to be nonconst. -; RUN: echo {@X = global i32 7} | llvm-as > %t.2.bc +; RUN: echo "@X = global i32 7" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {global i32 7} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "global i32 7" @X = external constant i32 ; <i32*> [#uses=0] diff --git a/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll b/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll index 7d1020d..d7a34c8 100644 --- a/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll +++ b/test/Linker/2005-12-06-AppendingZeroLengthArrays.ll @@ -1,7 +1,7 @@ -; RUN: echo { @G = appending global \[0 x i32\] zeroinitializer } | \ +; RUN: echo " @G = appending global [0 x i32] zeroinitializer " | \ ; RUN: llvm-as > %t.out2.bc ; RUN: llvm-as < %s > %t.out1.bc -; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep {@G =} +; RUN: llvm-link %t.out1.bc %t.out2.bc -S | grep "@G =" ; When linked, the globals should be merged, and the result should still ; be named '@G'. diff --git a/test/Linker/2006-06-15-GlobalVarAlignment.ll b/test/Linker/2006-06-15-GlobalVarAlignment.ll index df3284b..eec8f63 100644 --- a/test/Linker/2006-06-15-GlobalVarAlignment.ll +++ b/test/Linker/2006-06-15-GlobalVarAlignment.ll @@ -1,7 +1,7 @@ ; The linker should choose the largest alignment when linking. -; RUN: echo {@X = global i32 7, align 8} | llvm-as > %t.2.bc +; RUN: echo "@X = global i32 7, align 8" | llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc -; RUN: llvm-link %t.1.bc %t.2.bc -S | grep {align 8} +; RUN: llvm-link %t.1.bc %t.2.bc -S | grep "align 8" @X = weak global i32 7, align 4 diff --git a/test/Linker/2008-03-07-DroppedSection_a.ll b/test/Linker/2008-03-07-DroppedSection_a.ll index 4458971..ec9d5c2 100644 --- a/test/Linker/2008-03-07-DroppedSection_a.ll +++ b/test/Linker/2008-03-07-DroppedSection_a.ll @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.bc ; RUN: llvm-as < %p/2008-03-07-DroppedSection_b.ll > %t2.bc -; RUN: llvm-ld -r -disable-opt %t.bc %t2.bc -o %t3.bc +; RUN: llvm-link %t.bc %t2.bc -o %t3.bc ; RUN: llvm-dis < %t3.bc | grep ".data.init_task" ; ModuleID = 't.bc' diff --git a/test/Linker/2008-03-07-DroppedSection_b.ll b/test/Linker/2008-03-07-DroppedSection_b.ll index 884bf0a..63b64f6 100644 --- a/test/Linker/2008-03-07-DroppedSection_b.ll +++ b/test/Linker/2008-03-07-DroppedSection_b.ll @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s > %t.bc ; RUN: llvm-as < %p/2008-03-07-DroppedSection_a.ll > %t2.bc -; RUN: llvm-ld -r -disable-opt %t.bc %t2.bc -o %t3.bc +; RUN: llvm-link %t.bc %t2.bc -o %t3.bc ; RUN: llvm-dis < %t3.bc | grep ".data.init_task" ; ModuleID = 'u.bc' diff --git a/test/Linker/2008-06-13-LinkOnceRedefinition.ll b/test/Linker/2008-06-13-LinkOnceRedefinition.ll index 49da96a..da4b48d 100644 --- a/test/Linker/2008-06-13-LinkOnceRedefinition.ll +++ b/test/Linker/2008-06-13-LinkOnceRedefinition.ll @@ -2,7 +2,7 @@ ; in different modules. ; RUN: llvm-as %s -o %t.foo1.bc ; RUN: llvm-as %s -o %t.foo2.bc -; RUN: echo {define linkonce void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc +; RUN: echo "define linkonce void @foo(i32 %x) { ret void }" | llvm-as -o %t.foo3.bc ; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S ; RUN: llvm-link %t.foo1.bc %t.foo3.bc -S define linkonce void @foo() { ret void } diff --git a/test/Linker/2008-06-26-AddressSpace.ll b/test/Linker/2008-06-26-AddressSpace.ll index e3ed385..e1d3574 100644 --- a/test/Linker/2008-06-26-AddressSpace.ll +++ b/test/Linker/2008-06-26-AddressSpace.ll @@ -2,8 +2,8 @@ ; in different modules. ; RUN: llvm-as %s -o %t.foo1.bc ; RUN: echo | llvm-as -o %t.foo2.bc -; RUN: llvm-link %t.foo2.bc %t.foo1.bc -S | grep {addrspace(2)} -; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S | grep {addrspace(2)} +; RUN: llvm-link %t.foo2.bc %t.foo1.bc -S | grep "addrspace(2)" +; RUN: llvm-link %t.foo1.bc %t.foo2.bc -S | grep "addrspace(2)" ; rdar://6038021 @G = addrspace(2) global i32 256 diff --git a/test/Linker/AppendingLinkage.ll b/test/Linker/AppendingLinkage.ll index 134a42e..014ead9 100644 --- a/test/Linker/AppendingLinkage.ll +++ b/test/Linker/AppendingLinkage.ll @@ -1,6 +1,6 @@ ; Test that appending linkage works correctly. -; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \ +; RUN: echo "@X = appending global [1 x i32] [i32 8] " | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 4 | grep 8 diff --git a/test/Linker/AppendingLinkage2.ll b/test/Linker/AppendingLinkage2.ll index 2c1302f..7385efb 100644 --- a/test/Linker/AppendingLinkage2.ll +++ b/test/Linker/AppendingLinkage2.ll @@ -1,6 +1,6 @@ ; Test that appending linkage works correctly when arrays are the same size. -; RUN: echo {@X = appending global \[1 x i32\] \[i32 8\] } | \ +; RUN: echo "@X = appending global [1 x i32] [i32 8] " | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep 7 | grep 8 diff --git a/test/Linker/ConstantGlobals1.ll b/test/Linker/ConstantGlobals1.ll index 8fdbe50..716eb3d 100644 --- a/test/Linker/ConstantGlobals1.ll +++ b/test/Linker/ConstantGlobals1.ll @@ -1,6 +1,6 @@ ; Test that appending linkage works correctly when arrays are the same size. -; RUN: echo {@X = constant \[1 x i32\] \[i32 8\] } | \ +; RUN: echo "@X = constant [1 x i32] [i32 8] " | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant diff --git a/test/Linker/ConstantGlobals2.ll b/test/Linker/ConstantGlobals2.ll index ad4428b..ad0f8e2 100644 --- a/test/Linker/ConstantGlobals2.ll +++ b/test/Linker/ConstantGlobals2.ll @@ -1,6 +1,6 @@ ; Test that appending linkage works correctly when arrays are the same size. -; RUN: echo {@X = external global \[1 x i32\] } | \ +; RUN: echo "@X = external global [1 x i32] " | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant diff --git a/test/Linker/ConstantGlobals3.ll b/test/Linker/ConstantGlobals3.ll index e25529a..5aa26bc 100644 --- a/test/Linker/ConstantGlobals3.ll +++ b/test/Linker/ConstantGlobals3.ll @@ -1,6 +1,6 @@ ; Test that appending linkage works correctly when arrays are the same size. -; RUN: echo {@X = external constant \[1 x i32\] } | \ +; RUN: echo "@X = external constant [1 x i32] " | \ ; RUN: llvm-as > %t.2.bc ; RUN: llvm-as < %s > %t.1.bc ; RUN: llvm-link %t.1.bc %t.2.bc -S | grep constant diff --git a/test/Linker/Inputs/PR11464.a.ll b/test/Linker/Inputs/PR11464.a.ll new file mode 100644 index 0000000..25a9350 --- /dev/null +++ b/test/Linker/Inputs/PR11464.a.ll @@ -0,0 +1,3 @@ +%bug_type = type opaque +declare i32 @bug_a(%bug_type*) +declare i32 @bug_b(%bug_type*) diff --git a/test/Linker/Inputs/PR11464.b.ll b/test/Linker/Inputs/PR11464.b.ll new file mode 100644 index 0000000..7ef5a36 --- /dev/null +++ b/test/Linker/Inputs/PR11464.b.ll @@ -0,0 +1,13 @@ +%bug_type = type { %bug_type* } +%bar = type { i32 } + +define i32 @bug_a(%bug_type* %fp) nounwind uwtable { +entry: + %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0 + ret i32 0 +} + +define i32 @bug_b(%bar* %a) nounwind uwtable { +entry: + ret i32 0 +} diff --git a/test/Linker/Inputs/PR8300.a.ll b/test/Linker/Inputs/PR8300.a.ll new file mode 100644 index 0000000..c705db3 --- /dev/null +++ b/test/Linker/Inputs/PR8300.a.ll @@ -0,0 +1,2 @@ +%foo2 = type { [8 x i8] } +declare void @zed(%foo2*) diff --git a/test/Linker/Inputs/PR8300.b.ll b/test/Linker/Inputs/PR8300.b.ll new file mode 100644 index 0000000..9e538f5 --- /dev/null +++ b/test/Linker/Inputs/PR8300.b.ll @@ -0,0 +1,9 @@ +%foo = type { [8 x i8] } +%bar = type { [9 x i8] } + +@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*) + +define void @xyz(%bar* %this) { +entry: + ret void +} diff --git a/test/Linker/Inputs/basiclink.a.ll b/test/Linker/Inputs/basiclink.a.ll new file mode 100644 index 0000000..997932d --- /dev/null +++ b/test/Linker/Inputs/basiclink.a.ll @@ -0,0 +1,2 @@ +define i32* @foo(i32 %x) { ret i32* @baz } +@baz = external global i32 diff --git a/test/Linker/Inputs/basiclink.b.ll b/test/Linker/Inputs/basiclink.b.ll new file mode 100644 index 0000000..0d2abc7 --- /dev/null +++ b/test/Linker/Inputs/basiclink.b.ll @@ -0,0 +1,6 @@ +declare i32* @foo(...) +define i32* @bar() { + %ret = call i32* (...)* @foo( i32 123 ) + ret i32* %ret +} +@baz = global i32 0 diff --git a/test/Linker/Inputs/linkage.a.ll b/test/Linker/Inputs/linkage.a.ll new file mode 100644 index 0000000..8a156f6 --- /dev/null +++ b/test/Linker/Inputs/linkage.a.ll @@ -0,0 +1,2 @@ +@X = linkonce global i32 5 +define linkonce i32 @foo() { ret i32 7 } diff --git a/test/Linker/Inputs/linkage.b.ll b/test/Linker/Inputs/linkage.b.ll new file mode 100644 index 0000000..0ada3f4 --- /dev/null +++ b/test/Linker/Inputs/linkage.b.ll @@ -0,0 +1,10 @@ +@X = external global i32 + +declare i32 @foo() + +define void @bar() { + load i32* @X + call i32 @foo() + ret void +} + diff --git a/test/Linker/PR8300.ll b/test/Linker/PR8300.ll index f0fc1e7..7c03d5b 100644 --- a/test/Linker/PR8300.ll +++ b/test/Linker/PR8300.ll @@ -1,13 +1 @@ -; RUN: echo {%foo2 = type \{ \[8 x i8\] \} \ -; RUN: declare void @zed(%foo2*) } > %t.ll -; RUN: llvm-link %t.ll %s -o %t.bc - -%foo = type { [8 x i8] } -%bar = type { [9 x i8] } - -@zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*) - -define void @xyz(%bar* %this) { -entry: - ret void -} +; RUN: llvm-link %S/Inputs/PR8300.a.ll %S/Inputs/PR8300.b.ll -o %t.bc diff --git a/test/Linker/basiclink.ll b/test/Linker/basiclink.ll index afe0320..804329a 100644 --- a/test/Linker/basiclink.ll +++ b/test/Linker/basiclink.ll @@ -1,13 +1,6 @@ ; Test linking two functions with different prototypes and two globals ; in different modules. This is for PR411 -; RUN: llvm-as %s -o %t.bar.bc -; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ -; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc +; RUN: llvm-as %S/Inputs/basiclink.a.ll -o %t.foo.bc +; RUN: llvm-as %S/Inputs/basiclink.b.ll -o %t.bar.bc ; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc -declare i32* @foo(...) -define i32* @bar() { - %ret = call i32* (...)* @foo( i32 123 ) - ret i32* %ret -} -@baz = global i32 0 +; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc diff --git a/test/Linker/link-archive.ll b/test/Linker/link-archive.ll deleted file mode 100644 index 9251b4e..0000000 --- a/test/Linker/link-archive.ll +++ /dev/null @@ -1,16 +0,0 @@ -; Test linking of a bc file to an archive via llvm-ld. -; PR1434 -; RUN: rm -f %t.bar.a %t.foo.a -; RUN: llvm-as %s -o %t.bar.bc -; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \ -; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc -; RUN: llvm-ar rcf %t.foo.a %t.foo.bc -; RUN: llvm-ar rcf %t.bar.a %t.bar.bc -; RUN: llvm-ld -disable-opt %t.bar.bc %t.foo.a -o %t.bc -; RUN: llvm-ld -disable-opt %t.foo.bc %t.bar.a -o %t.bc -declare i32* @foo(...) -define i32* @bar() { - %ret = call i32* (...)* @foo( i32 123 ) - ret i32* %ret -} -@baz = global i32 0 diff --git a/test/Linker/link-global-to-func.ll b/test/Linker/link-global-to-func.ll index 2fc501d..9d969d7 100644 --- a/test/Linker/link-global-to-func.ll +++ b/test/Linker/link-global-to-func.ll @@ -1,5 +1,5 @@ ; RUN: llvm-as %s -o %t1.bc -; 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 +; 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 ; RUN: llvm-link %t2.bc %t1.bc -S | grep __eprintf ; RUN: llvm-link %t1.bc %t2.bc -S | grep __eprintf diff --git a/test/Linker/link-messages.ll b/test/Linker/link-messages.ll index 920782d..4e7ffbc 100644 --- a/test/Linker/link-messages.ll +++ b/test/Linker/link-messages.ll @@ -2,10 +2,9 @@ ; that error is printed out. ; RUN: llvm-as %s -o %t.one.bc ; RUN: llvm-as %s -o %t.two.bc -; RUN: not llvm-ld -disable-opt -link-as-library %t.one.bc %t.two.bc \ -; RUN: -o %t.bc 2>%t.err -; RUN: grep "symbol multiply defined" %t.err +; RUN: not llvm-link %t.one.bc %t.two.bc -o %t.bc 2>&1 | FileCheck %s +; CHECK: symbol multiply defined define i32 @bar() { - ret i32 0 + ret i32 0 } diff --git a/test/Linker/linkage.ll b/test/Linker/linkage.ll new file mode 100644 index 0000000..c7309aa --- /dev/null +++ b/test/Linker/linkage.ll @@ -0,0 +1,3 @@ +; RUN: llvm-as %S/Inputs/linkage.a.ll -o %t.1.bc +; RUN: llvm-as %S/Inputs/linkage.b.ll -o %t.2.bc +; RUN: llvm-link %t.1.bc %t.2.bc diff --git a/test/Linker/module-flags-4-a.ll b/test/Linker/module-flags-4-a.ll index f411a56..a656c8b 100644 --- a/test/Linker/module-flags-4-a.ll +++ b/test/Linker/module-flags-4-a.ll @@ -1,4 +1,4 @@ -; RUN: not llvm-link %s %p/module-flags-4-b.ll -S -o - |& FileCheck %s +; RUN: not llvm-link %s %p/module-flags-4-b.ll -S -o - 2>&1 | FileCheck %s ; Test 'require' error. diff --git a/test/Linker/module-flags-5-a.ll b/test/Linker/module-flags-5-a.ll index 2e59ecc..8d625cd 100644 --- a/test/Linker/module-flags-5-a.ll +++ b/test/Linker/module-flags-5-a.ll @@ -1,4 +1,4 @@ -; RUN: not llvm-link %s %p/module-flags-5-b.ll -S -o - |& FileCheck %s +; RUN: not llvm-link %s %p/module-flags-5-b.ll -S -o - 2>&1 | FileCheck %s ; Test the 'override' error. diff --git a/test/Linker/module-flags-6-a.ll b/test/Linker/module-flags-6-a.ll index c3e0225..5329c43 100644 --- a/test/Linker/module-flags-6-a.ll +++ b/test/Linker/module-flags-6-a.ll @@ -1,4 +1,4 @@ -; RUN: not llvm-link %s %p/module-flags-6-b.ll -S -o - |& FileCheck %s +; RUN: not llvm-link %s %p/module-flags-6-b.ll -S -o - 2>&1 | FileCheck %s ; Test module flags error messages. diff --git a/test/Linker/multiple-merged-structs.ll b/test/Linker/multiple-merged-structs.ll index 348cd89..aa8204d 100644 --- a/test/Linker/multiple-merged-structs.ll +++ b/test/Linker/multiple-merged-structs.ll @@ -1,19 +1,2 @@ -; RUN: echo {%bug_type = type opaque \ -; RUN: declare i32 @bug_a(%bug_type*) \ -; RUN: declare i32 @bug_b(%bug_type*) } > %t.ll -; RUN: llvm-link %t.ll %s +; RUN: llvm-link %S/Inputs/PR11464.a.ll %S/Inputs/PR11464.b.ll ; PR11464 - -%bug_type = type { %bug_type* } -%bar = type { i32 } - -define i32 @bug_a(%bug_type* %fp) nounwind uwtable { -entry: - %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0 - ret i32 0 -} - -define i32 @bug_b(%bar* %a) nounwind uwtable { -entry: - ret i32 0 -} diff --git a/test/Linker/redefinition.ll b/test/Linker/redefinition.ll index 0d05689..23ba6a1 100644 --- a/test/Linker/redefinition.ll +++ b/test/Linker/redefinition.ll @@ -2,9 +2,9 @@ ; in different modules. ; RUN: llvm-as %s -o %t.foo1.bc ; RUN: llvm-as %s -o %t.foo2.bc -; RUN: echo {define void @foo(i32 %x) { ret void }} | llvm-as -o %t.foo3.bc -; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc |& \ -; RUN: grep {symbol multiply defined} -; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc |& \ -; RUN: grep {symbol multiply defined} +; RUN: echo "define void @foo(i32 %x) { ret void }" | llvm-as -o %t.foo3.bc +; RUN: not llvm-link %t.foo1.bc %t.foo2.bc -o %t.bc 2>&1 | \ +; RUN: grep "symbol multiply defined" +; RUN: not llvm-link %t.foo1.bc %t.foo3.bc -o %t.bc 2>&1 | \ +; RUN: grep "symbol multiply defined" define void @foo() { ret void } diff --git a/test/Linker/weakextern.ll b/test/Linker/weakextern.ll index aa38b12..3a72a48 100644 --- a/test/Linker/weakextern.ll +++ b/test/Linker/weakextern.ll @@ -1,9 +1,9 @@ ; RUN: llvm-as < %s > %t.bc ; RUN: llvm-as < %p/testlink1.ll > %t2.bc ; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc -; RUN: llvm-dis < %t1.bc | grep {kallsyms_names = extern_weak} -; RUN: llvm-dis < %t1.bc | grep {MyVar = external global i32} -; RUN: llvm-dis < %t1.bc | grep {Inte = global i32} +; RUN: llvm-dis < %t1.bc | grep "kallsyms_names = extern_weak" +; RUN: llvm-dis < %t1.bc | grep "MyVar = external global i32" +; RUN: llvm-dis < %t1.bc | grep "Inte = global i32" @kallsyms_names = extern_weak global [0 x i8] ; <[0 x i8]*> [#uses=0] @MyVar = extern_weak global i32 ; <i32*> [#uses=0] |