diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-05 23:02:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-05 23:02:01 +0000 |
commit | 3ed8815541d2118728a91bbd5bee054fbcfba71f (patch) | |
tree | 077ae7fccb56f694d51c3c9457d7a492138602e9 /test/Linker | |
parent | dd35df15a296ca7a6722dc6eb04702e687652c45 (diff) | |
download | external_llvm-3ed8815541d2118728a91bbd5bee054fbcfba71f.zip external_llvm-3ed8815541d2118728a91bbd5bee054fbcfba71f.tar.gz external_llvm-3ed8815541d2118728a91bbd5bee054fbcfba71f.tar.bz2 |
Link symbols with different visibilities according to the rules in the
System V Application Binary Interface. This lets us use
-fvisibility-inlines-hidden with LTO.
Fixes PR11697.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker')
-rw-r--r-- | test/Linker/visibility1.ll | 46 | ||||
-rw-r--r-- | test/Linker/visibility2.ll | 27 |
2 files changed, 73 insertions, 0 deletions
diff --git a/test/Linker/visibility1.ll b/test/Linker/visibility1.ll new file mode 100644 index 0000000..131f6d5 --- /dev/null +++ b/test/Linker/visibility1.ll @@ -0,0 +1,46 @@ +; RUN: llvm-link %s %p/visibility2.ll -S | FileCheck %s +; RUN: llvm-link %p/visibility2.ll %s -S | FileCheck %s + +; The values in this file are strong, the ones in visibility2.ll are weak, +; but we should still get the visibility from them. + +; Variables +; CHECK: @v1 = hidden global i32 0 +@v1 = global i32 0 + +; CHECK: @v2 = protected global i32 0 +@v2 = global i32 0 + +; CHECK: @v3 = hidden global i32 0 +@v3 = protected global i32 0 + + +; Aliases +; CHECK: @a1 = hidden alias i32* @v1 +@a1 = alias i32* @v1 + +; CHECK: @a2 = protected alias i32* @v2 +@a2 = alias i32* @v2 + +; CHECK: @a3 = hidden alias i32* @v3 +@a3 = protected alias i32* @v3 + + +; Functions +; CHECK: define hidden void @f1() +define void @f1() { +entry: + ret void +} + +; CHECK: define protected void @f2() +define void @f2() { +entry: + ret void +} + +; CHECK: define hidden void @f3() +define protected void @f3() { +entry: + ret void +} diff --git a/test/Linker/visibility2.ll b/test/Linker/visibility2.ll new file mode 100644 index 0000000..e6363ca --- /dev/null +++ b/test/Linker/visibility2.ll @@ -0,0 +1,27 @@ +; This file is used by visibility1.ll, so it doesn't actually do anything itself +; +; RUN: true + +; Variables +@v1 = weak hidden global i32 0 +@v2 = weak protected global i32 0 +@v3 = weak hidden global i32 0 + +; Aliases +@a1 = hidden alias weak i32* @v1 +@a2 = protected alias weak i32* @v2 +@a3 = hidden alias weak i32* @v3 + +; Functions +define weak hidden void @f1() { +entry: + ret void +} +define weak protected void @f2() { +entry: + ret void +} +define weak hidden void @f3() { +entry: + ret void +} |