forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
14 changed files
with
60 additions
and
55 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%bug_type = type opaque | ||
declare i32 @bug_a(%bug_type*) | ||
declare i32 @bug_b(%bug_type*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
%foo2 = type { [8 x i8] } | ||
declare void @zed(%foo2*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
define i32* @foo(i32 %x) { ret i32* @baz } | ||
@baz = external global i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare i32* @foo(...) | ||
define i32* @bar() { | ||
%ret = call i32* (...)* @foo( i32 123 ) | ||
ret i32* %ret | ||
} | ||
@baz = global i32 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@X = linkonce global i32 5 | ||
define linkonce i32 @foo() { ret i32 7 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@X = external global i32 | ||
|
||
declare i32 @foo() | ||
|
||
define void @bar() { | ||
load i32* @X | ||
call i32 @foo() | ||
ret void | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters