Test files for linker
authorChris Lattner <sabre@nondot.org>
Sat, 13 Oct 2001 07:15:38 +0000 (07:15 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Oct 2001 07:15:38 +0000 (07:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@783 91177308-0d34-0410-b5e6-96231b3b80d8

test/Linker/testlink1.ll [new file with mode: 0644]
test/Linker/testlink2.ll [new file with mode: 0644]

diff --git a/test/Linker/testlink1.ll b/test/Linker/testlink1.ll
new file mode 100644 (file)
index 0000000..87a9e9a
--- /dev/null
@@ -0,0 +1,32 @@
+
+%MyVar     = uninitialized global int
+%MyIntList = global { \2 *, int } { { \2, int }* null, int 17 }
+             uninitialized global int      ; int*:0
+
+%AConst    = constant int 123
+
+declare int "foo"(int %blah)      ;; Declared in testlink2.ll
+
+declare void "print"(int %Value)
+
+implementation
+
+void "main"()
+begin
+       %v1 = load int* %MyVar
+       call void %print(int %v1)    ;; Should start out 4
+
+       %v2 = load { \2 *, int }* %MyIntList, ubyte 1
+       call void %print(int %v2)    ;; Should start out 17
+
+       call int %foo(int 5)         ;; Modify global variablesx
+
+       %v3 = load int* %MyVar
+       call void %print(int %v3)    ;; Should now be 5
+
+       %v4 = load { \2 *, int }* %MyIntList, ubyte 1
+       call void %print(int %v4)    ;; Should start out 12
+
+       ret void
+end
+
diff --git a/test/Linker/testlink2.ll b/test/Linker/testlink2.ll
new file mode 100644 (file)
index 0000000..445749a
--- /dev/null
@@ -0,0 +1,15 @@
+
+%MyVar     = global int 4
+%MyIntList = uninitialized global { \2 *, int }
+
+%AConst    = constant int 123
+
+implementation
+
+int "foo"(int %blah)
+begin
+       store int %blah, int *%MyVar
+       store int 12, { \2 *, int } * %MyIntList, ubyte 1
+       ret int %blah
+end
+