aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-05-21 14:22:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-05-21 14:22:37 +0000
commit2de54fcf8511344d888f445bf159e5dee69cd6b9 (patch)
tree54b390efbccefd172bd4c178f69dd843db7da289
parent11ed43dabf272fe80cc3820bb1a043ca7c1d53ac (diff)
Test and document a difference from gcc in the handling of visibility
attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157186 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGenCXX/visibility.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp
index be8e199532..568a2859f8 100644
--- a/test/CodeGenCXX/visibility.cpp
+++ b/test/CodeGenCXX/visibility.cpp
@@ -66,6 +66,19 @@ namespace test40 {
// CHECK-HIDDEN: _ZN6test403fooIiE3barE = weak_odr global
}
+namespace test41 {
+ // Unlike gcc we propagate the information that foo not only is hidden, but
+ // has been explicitly marked as so. This lets us produce a hidden undefined
+ // reference to bar.
+ struct __attribute__((visibility("hidden"))) foo {};
+ extern foo bar;
+ foo *zed() {
+ return &bar;
+ }
+ // CHECK: @_ZN6test413barE = external hidden global
+ // CHECK-HIDDEN: @_ZN6test413barE = external hidden global
+}
+
// CHECK: @_ZN5Test425VariableInHiddenNamespaceE = hidden global i32 10
// CHECK: @_ZN5Test71aE = hidden global
// CHECK: @_ZN5Test71bE = global