gcc/gcc41-c++-guard-visibility.patch
Jakub Jelinek d8d9cbe2d6 4.1.2-34
2007-11-25 20:29:41 +00:00

37 lines
753 B
Diff

2007-09-06 Jason Merrill <jason@redhat.com>
* g++.dg/ext/visibility/guard1.C: New test.
--- gcc/testsuite/g++.dg/ext/visibility/guard1.C (revision 0)
+++ gcc/testsuite/g++.dg/ext/visibility/guard1.C (revision 128226)
@@ -0,0 +1,29 @@
+// { dg-options "-fvisibility=hidden" }
+// { dg-require-visibility "" }
+// { dg-final { scan-not-hidden "_ZGVZN5otherclEvE4s_cd" } }
+
+extern "C" int printf (const char *, ...);
+
+#define DLLEXPORT __attribute__ ((visibility("default")))
+
+struct class_data
+{
+ int apple;
+ class_data() { printf("non trivial ctor\n"); }
+};
+
+struct DLLEXPORT other
+{
+ class_data* operator ()()
+ {
+ static class_data s_cd;
+ return &s_cd;
+ }
+};
+
+int main()
+{
+ other aFoo;
+ aFoo();
+ return 0;
+}