diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-13 05:12:34 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-01-13 05:12:34 +0000 |
commit | c2a94da3134fcd5745f1b852af6b4ade7b57b4d3 (patch) | |
tree | 1dab0c0a72771af3dcf4632f4435c539edcadd46 /test/Linker | |
parent | d72479c2f061e3b57adf3d054875665f25a30d90 (diff) | |
download | external_llvm-c2a94da3134fcd5745f1b852af6b4ade7b57b4d3.zip external_llvm-c2a94da3134fcd5745f1b852af6b4ade7b57b4d3.tar.gz external_llvm-c2a94da3134fcd5745f1b852af6b4ade7b57b4d3.tar.bz2 |
Keep unnamed_addr when linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker')
-rw-r--r-- | test/Linker/unnamed-addr1-a.ll | 11 | ||||
-rw-r--r-- | test/Linker/unnamed-addr1-b.ll | 4 | ||||
-rw-r--r-- | test/Linker/unnamed-addr2-a.ll | 11 | ||||
-rw-r--r-- | test/Linker/unnamed-addr2-b.ll | 7 |
4 files changed, 33 insertions, 0 deletions
diff --git a/test/Linker/unnamed-addr1-a.ll b/test/Linker/unnamed-addr1-a.ll new file mode 100644 index 0000000..4be797c --- /dev/null +++ b/test/Linker/unnamed-addr1-a.ll @@ -0,0 +1,11 @@ +; RUN: llvm-link %s %p/unnamed-addr1-b.ll -S -o - | FileCheck %s + +@foo = external global i32 + +define i32 @bar() { +entry: + %tmp = load i32* @foo, align 4 + ret i32 %tmp +} + +; CHECK: @foo = common unnamed_addr global i32 0, align 4 diff --git a/test/Linker/unnamed-addr1-b.ll b/test/Linker/unnamed-addr1-b.ll new file mode 100644 index 0000000..3bfc4ea --- /dev/null +++ b/test/Linker/unnamed-addr1-b.ll @@ -0,0 +1,4 @@ +; This file is for use with unnamed-addr1-a.ll +; RUN: true + +@foo = common unnamed_addr global i32 0, align 4 diff --git a/test/Linker/unnamed-addr2-a.ll b/test/Linker/unnamed-addr2-a.ll new file mode 100644 index 0000000..f43f19a --- /dev/null +++ b/test/Linker/unnamed-addr2-a.ll @@ -0,0 +1,11 @@ +; RUN: llvm-link %s %p/unnamed-addr2-b.ll -S -o - | FileCheck %s + +define i32 @bar() { +entry: + %call = tail call i32 @foo() + ret i32 %call +} + +declare i32 @foo() + +; CHECK: define unnamed_addr i32 @foo() diff --git a/test/Linker/unnamed-addr2-b.ll b/test/Linker/unnamed-addr2-b.ll new file mode 100644 index 0000000..8327912 --- /dev/null +++ b/test/Linker/unnamed-addr2-b.ll @@ -0,0 +1,7 @@ +; This file is for use with unnamed-addr2-a.ll +; RUN: true + +define unnamed_addr i32 @foo() { +entry: + ret i32 42 +} |