New testcase
authorChris Lattner <sabre@nondot.org>
Mon, 21 Apr 2003 21:06:25 +0000 (21:06 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Apr 2003 21:06:25 +0000 (21:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5826 91177308-0d34-0410-b5e6-96231b3b80d8

test/Linker/2003-04-21-Linkage.ll [new file with mode: 0644]
test/Linker/testlink1.ll
test/Linker/testlink2.ll

diff --git a/test/Linker/2003-04-21-Linkage.ll b/test/Linker/2003-04-21-Linkage.ll
new file mode 100644 (file)
index 0000000..58493f9
--- /dev/null
@@ -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
+}
+
index 35b6eeb6f6493f00b2b2692f3366153eedb9c595..898188b5c6751ec50f712daeb5ca952f92c07d0e 100644 (file)
@@ -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
 
index f119618a902ab27c63295878672c4abb996764ac..210e847f6d72af429e925803f17bbd0843e25aa1 100644 (file)
@@ -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