summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-21 21:06:25 +0000
committerChris Lattner <sabre@nondot.org>2003-04-21 21:06:25 +0000
commit8869c2cb6a7f1f241e842d82f581dbea09b39eb5 (patch)
tree333574aaf847492f6a66cf7555987b620e6090a0
parentd34a51dbbe84562e054811f70705f66177848096 (diff)
downloadllvm-8869c2cb6a7f1f241e842d82f581dbea09b39eb5.tar.gz
llvm-8869c2cb6a7f1f241e842d82f581dbea09b39eb5.tar.bz2
llvm-8869c2cb6a7f1f241e842d82f581dbea09b39eb5.tar.xz
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Linker/2003-04-21-Linkage.ll15
-rw-r--r--test/Linker/testlink1.ll6
-rw-r--r--test/Linker/testlink2.ll4
3 files changed, 20 insertions, 5 deletions
diff --git a/test/Linker/2003-04-21-Linkage.ll b/test/Linker/2003-04-21-Linkage.ll
new file mode 100644
index 0000000000..58493f9ece
--- /dev/null
+++ b/test/Linker/2003-04-21-Linkage.ll
@@ -0,0 +1,15 @@
+; RUN: echo "%X = linkonce global int 5 implementation linkonce int %foo() { ret int 7 }" | as > Output/%s.1.bc
+; RUN: as < %s > Output/%s.2.bc
+; RUN: link Output/%s.[12].bc
+%X = external global int
+
+implementation
+
+declare int %foo()
+
+void %bar() {
+ load int* %X
+ call int %foo()
+ ret void
+}
+
diff --git a/test/Linker/testlink1.ll b/test/Linker/testlink1.ll
index 35b6eeb6f6..898188b5c6 100644
--- a/test/Linker/testlink1.ll
+++ b/test/Linker/testlink1.ll
@@ -2,9 +2,9 @@
; RUN: as < testlink2.ll > Output/testlink2.bc
; RUN: link Output/%s.bc Output/testlink2.bc
-%MyVar = uninitialized global int
+%MyVar = external global int
%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
- uninitialized global int ; int*:0
+ external global int ; int*:0
%AConst = constant int 123
@@ -25,7 +25,7 @@ begin
%v1 = load int* %MyVar
call void %print(int %v1) ;; Should start out 4
- %idx = getelementptr { \2 *, int }* %MyIntList, uint 0, ubyte 1
+ %idx = getelementptr { \2 *, int }* %MyIntList, long 0, ubyte 1
%v2 = load int* %idx
call void %print(int %v2) ;; Should start out 17
diff --git a/test/Linker/testlink2.ll b/test/Linker/testlink2.ll
index f119618a90..210e847f6d 100644
--- a/test/Linker/testlink2.ll
+++ b/test/Linker/testlink2.ll
@@ -3,7 +3,7 @@
; RUN: echo
%MyVar = global int 4
-%MyIntList = uninitialized global { \2 *, int }
+%MyIntList = external global { \2 *, int }
%AConst = constant int 123
@@ -20,7 +20,7 @@ implementation
int "foo"(int %blah)
begin
store int %blah, int *%MyVar
- %idx = getelementptr { \2 *, int } * %MyIntList, uint 0, ubyte 1
+ %idx = getelementptr { \2 *, int } * %MyIntList, long 0, ubyte 1
store int 12, int* %idx
%ack = load int * %0 ;; Load from the unnamed constant