[cfe-commits] r157186 - /cfe/trunk/test/CodeGenCXX/visibility.cpp

Rafael Espindola rafael.espindola at gmail.com
Mon May 21 07:22:37 PDT 2012


Author: rafael
Date: Mon May 21 09:22:37 2012
New Revision: 157186

URL: http://llvm.org/viewvc/llvm-project?rev=157186&view=rev
Log:
Test and document a difference from gcc in the handling of visibility
attributes.

Modified:
    cfe/trunk/test/CodeGenCXX/visibility.cpp

Modified: cfe/trunk/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/visibility.cpp?rev=157186&r1=157185&r2=157186&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/visibility.cpp Mon May 21 09:22:37 2012
@@ -66,6 +66,19 @@
   // 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





More information about the cfe-commits mailing list