Add a test case for PR1434
[oota-llvm.git] / test / Linker / testlink1.ll
index 12cf652d158132a7c9e17a8d4ac4906b7e787b8e..df89d84c17faa37b59342dcb969d045687e3d1f3 100644 (file)
@@ -1,15 +1,20 @@
+; RUN: llvm-upgrade < %s | llvm-as > %t.bc
+; RUN: llvm-upgrade < %p/testlink2.ll | llvm-as > %t2.bc
+; RUN: llvm-link %t.bc %t2.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
+%Inte = global int 1
+
+%AConst    = linkonce constant int 123
 
 %Intern1   = internal constant int 42
 %Intern2   = internal constant int 792
 
 ; Initialized to point to external %MyVar
-%MyVarPtr  = global { int * }  { int * %MyVar }
+%MyVarPtr  = linkonce global { int * }  { int * %MyVar }
 
 declare int "foo"(int %blah)      ;; Declared in testlink2.ll
 
@@ -22,7 +27,8 @@ begin
        %v1 = load int* %MyVar
        call void %print(int %v1)    ;; Should start out 4
 
-       %v2 = load { \2 *, int }* %MyIntList, uint 0, ubyte 1
+       %idx = getelementptr { \2 *, int }* %MyIntList, long 0, uint 1
+       %v2 = load int* %idx
        call void %print(int %v2)    ;; Should start out 17
 
        call int %foo(int 5)         ;; Modify global variablesx
@@ -30,7 +36,7 @@ begin
        %v3 = load int* %MyVar
        call void %print(int %v3)    ;; Should now be 5
 
-       %v4 = load { \2 *, int }* %MyIntList, uint 0, ubyte 1
+       %v4 = load int* %idx
        call void %print(int %v4)    ;; Should start out 12
 
        ret void