llvm.org GIT mirror llvm / 7e621f3
Switch a bunch of Linker tests from using elaborate echo productions to just provide and reference separate input files from an Inputs subdirectory. This pattern works very well in the Clang tree and is easier to understand in my opinion. It also has fewer limitations and will remove one particularly annoying use of TCL-style {} quoting from the testsuite. Also teach the LLVM lit configuration to avoid recursing into 'Inputs' subdirectories. This wasn't required for the previous 'Inputs' subdirectories used due to fortuitous suffix patterns. This is the first step to completely removing support for TCL-style tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159520 91177308-0d34-0410-b5e6-96231b3b80d8 Chandler Carruth 8 years ago
14 changed file(s) with 60 addition(s) and 55 deletion(s). Raw diff Collapse all Expand all
+0
-14
test/Linker/2003-04-21-Linkage.ll less more
None ; RUN: echo {@X = linkonce global i32 5 \
1 ; RUN: define linkonce i32 @foo() \{ ret i32 7 \} } | llvm-as > %t.1.bc
2 ; RUN: llvm-as %s -o %t.2.bc
3 ; RUN: llvm-link %t.1.bc %t.2.bc
4 @X = external global i32
5
6 declare i32 @foo()
7
8 define void @bar() {
9 load i32* @X
10 call i32 @foo()
11 ret void
12 }
13
0 %bug_type = type opaque
1 declare i32 @bug_a(%bug_type*)
2 declare i32 @bug_b(%bug_type*)
0 %bug_type = type { %bug_type* }
1 %bar = type { i32 }
2
3 define i32 @bug_a(%bug_type* %fp) nounwind uwtable {
4 entry:
5 %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0
6 ret i32 0
7 }
8
9 define i32 @bug_b(%bar* %a) nounwind uwtable {
10 entry:
11 ret i32 0
12 }
0 %foo2 = type { [8 x i8] }
1 declare void @zed(%foo2*)
0 %foo = type { [8 x i8] }
1 %bar = type { [9 x i8] }
2
3 @zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*)
4
5 define void @xyz(%bar* %this) {
6 entry:
7 ret void
8 }
0 define i32* @foo(i32 %x) { ret i32* @baz }
1 @baz = external global i32
0 declare i32* @foo(...)
1 define i32* @bar() {
2 %ret = call i32* (...)* @foo( i32 123 )
3 ret i32* %ret
4 }
5 @baz = global i32 0
0 @X = linkonce global i32 5
1 define linkonce i32 @foo() { ret i32 7 }
0 @X = external global i32
1
2 declare i32 @foo()
3
4 define void @bar() {
5 load i32* @X
6 call i32 @foo()
7 ret void
8 }
9
None ; RUN: echo {%foo2 = type \{ \[8 x i8\] \} \
1 ; RUN: declare void @zed(%foo2*) } > %t.ll
2 ; RUN: llvm-link %t.ll %s -o %t.bc
3
4 %foo = type { [8 x i8] }
5 %bar = type { [9 x i8] }
6
7 @zed = alias bitcast (void (%bar*)* @xyz to void (%foo*)*)
8
9 define void @xyz(%bar* %this) {
10 entry:
11 ret void
12 }
0 ; RUN: llvm-link %S/Inputs/PR8300.a.ll %S/Inputs/PR8300.b.ll -o %t.bc
0 ; Test linking two functions with different prototypes and two globals
11 ; in different modules. This is for PR411
2 ; RUN: llvm-as %s -o %t.bar.bc
3 ; RUN: echo {define i32* @foo(i32 %x) \{ ret i32* @baz \} \
4 ; RUN: @baz = external global i32 } | llvm-as -o %t.foo.bc
2 ; RUN: llvm-as %S/Inputs/basiclink.a.ll -o %t.foo.bc
3 ; RUN: llvm-as %S/Inputs/basiclink.b.ll -o %t.bar.bc
4 ; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc
55 ; RUN: llvm-link %t.bar.bc %t.foo.bc -o %t.bc
6 ; RUN: llvm-link %t.foo.bc %t.bar.bc -o %t.bc
7 declare i32* @foo(...)
8 define i32* @bar() {
9 %ret = call i32* (...)* @foo( i32 123 )
10 ret i32* %ret
11 }
12 @baz = global i32 0
0 ; RUN: llvm-as %S/Inputs/linkage.a.ll -o %t.1.bc
1 ; RUN: llvm-as %S/Inputs/linkage.b.ll -o %t.2.bc
2 ; RUN: llvm-link %t.1.bc %t.2.bc
None ; RUN: echo {%bug_type = type opaque \
1 ; RUN: declare i32 @bug_a(%bug_type*) \
2 ; RUN: declare i32 @bug_b(%bug_type*) } > %t.ll
3 ; RUN: llvm-link %t.ll %s
0 ; RUN: llvm-link %S/Inputs/PR11464.a.ll %S/Inputs/PR11464.b.ll
41 ; PR11464
5
6 %bug_type = type { %bug_type* }
7 %bar = type { i32 }
8
9 define i32 @bug_a(%bug_type* %fp) nounwind uwtable {
10 entry:
11 %d_stream = getelementptr inbounds %bug_type* %fp, i64 0, i32 0
12 ret i32 0
13 }
14
15 define i32 @bug_b(%bar* %a) nounwind uwtable {
16 entry:
17 ret i32 0
18 }
1717 # suffixes: A list of file extensions to treat as test files, this is actually
1818 # set by on_clone().
1919 config.suffixes = []
20
21 # excludes: A list of directories to exclude from the testsuite. The 'Inputs'
22 # subdirectories contain auxiliary inputs for various tests in their parent
23 # directories.
24 config.excludes = ['Inputs']
2025
2126 # test_source_root: The root path where tests are located.
2227 config.test_source_root = os.path.dirname(__file__)