Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
[oota-llvm.git] / test / Linker / testlink2.ll
index 5aacf1a95b2192f257ba5f38d78bebf40ea0c365..31a29eb52d1a11e97f481b54ce1cd69acdaba56b 100644 (file)
@@ -1,6 +1,9 @@
+; This file is used by testlink1.ll, so it doesn't actually do anything itself
+;
+; RUN: echo
 
 %MyVar     = global int 4
-%MyIntList = uninitialized global { \2 *, int }
+%MyIntList = external global { \2 *, int }
 
 %AConst    = constant int 123
 
@@ -8,7 +11,7 @@
 %Intern2   = constant int 12345       ;; Intern in one but not in other
 
 %MyIntListPtr = constant { {\2,int}* } { {\2,int}* %MyIntList }
-%MyVarPtr  = global { int * }  { int * %MyVar }
+%MyVarPtr  = linkonce global { int * }  { int * %MyVar }
 
 constant int 412
 
@@ -17,7 +20,8 @@ implementation
 int "foo"(int %blah)
 begin
        store int %blah, int *%MyVar
-       store int 12, { \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
        %fzo = add int %ack, %blah