From 8869c2cb6a7f1f241e842d82f581dbea09b39eb5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 21 Apr 2003 21:06:25 +0000 Subject: [PATCH] New testcase git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5826 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Linker/2003-04-21-Linkage.ll | 15 +++++++++++++++ test/Linker/testlink1.ll | 6 +++--- test/Linker/testlink2.ll | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 test/Linker/2003-04-21-Linkage.ll diff --git a/test/Linker/2003-04-21-Linkage.ll b/test/Linker/2003-04-21-Linkage.ll new file mode 100644 index 00000000000..58493f9eceb --- /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 35b6eeb6f64..898188b5c67 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 f119618a902..210e847f6d7 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 -- 2.40.0