OSDN Git Service

* gcc.dg/visibility-12.c: New test.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Jul 2007 17:34:16 +0000 (17:34 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 Jul 2007 17:34:16 +0000 (17:34 +0000)
* gcc.dg/visibility-13.c: Likewise.
* g++.dg/ext/visibility-9.C: Likewise.
* g++.dg/ext/visibility-10.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126330 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/visibility/visibility-10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/visibility/visibility-9.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-13.c [new file with mode: 0644]

index 30516ad..63aedcb 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-04  Mark Mitchell  <mark@codesourcery.com>
+
+       * gcc.dg/visibility-12.c: New test.
+       * gcc.dg/visibility-13.c: Likewise.
+       * g++.dg/ext/visibility-9.C: Likewise.
+       * g++.dg/ext/visibility-10.C: Likewise.
+
 2007-07-04  Richard Sandiford  <richard@codesourcery.com>
 
        * gcc.dg/sh-relax.c: Skip for VxWorks if non-PIC.
        PR fortran/32298
        * gfortran.dg/minmaxloc_2.f90: New test.
 
-2007-06-23  Mark Mitchell  <mark@codesourcery.com>
-
-       * gcc.dg/visibility-12.c: New test.
-       * gcc.dg/visibility-13.c: Likewise.
-       * g++.dg/ext/visibility-9.C: Likewise.
-       * g++.dg/ext/visibility-10.C: Likewise.
-
 2007-06-23  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/16876
diff --git a/gcc/testsuite/g++.dg/ext/visibility/visibility-10.C b/gcc/testsuite/g++.dg/ext/visibility/visibility-10.C
new file mode 100644 (file)
index 0000000..312d323
--- /dev/null
@@ -0,0 +1,19 @@
+// { dg-require-visibility "" }
+// { dg-require-dll "" }
+
+extern void __attribute__((dllimport, visibility("hidden"))) 
+  f1(); // { dg-error "visibility" }
+extern void __attribute__((visibility("hidden"), dllimport)) 
+  f2(); // { dg-error "visibility" }
+extern void __attribute__((dllexport, visibility("hidden"))) 
+  f3(); // { dg-error "visibility" }
+extern void __attribute__((visibility("hidden"), dllexport)) 
+  f4(); // { dg-error "visibility" }
+extern void __attribute__((visibility("default"), dllimport))
+  f5();
+extern void __attribute__((dllimport, visibility("default")))
+  f6();
+extern void __attribute__((visibility("default"), dllexport))
+  f7();
+extern void __attribute__((dllexport, visibility("default")))
+  f8();
diff --git a/gcc/testsuite/g++.dg/ext/visibility/visibility-9.C b/gcc/testsuite/g++.dg/ext/visibility/visibility-9.C
new file mode 100644 (file)
index 0000000..06b5a17
--- /dev/null
@@ -0,0 +1,29 @@
+// Test that dllimport'd functions have default visibility.
+// { dg-require-visibility "" }
+// { dg-require-dll "" }
+// { dg-options "-fvisibility=hidden" }
+// { dg-final { scan-not-hidden "_Z2f1v" } }
+// { dg-final { scan-not-hidden "_ZN1S2f3Ev" } }
+
+extern void  __attribute__((dllimport)) f1();
+void f2() {
+  f1();
+}
+
+struct __attribute__((visibility("hidden")) S1 {
+  __attribute__((dllimport)) void f3();
+};
+
+void f4() {
+  S1 s1;
+  s1.f3();
+}
+
+struct S2 {
+  __attribute__((dllimport)) void f5();
+};
+
+void f6() {
+  S2 s2;
+  s2.f5();
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-12.c b/gcc/testsuite/gcc.dg/visibility-12.c
new file mode 100644 (file)
index 0000000..6012bd9
--- /dev/null
@@ -0,0 +1,10 @@
+/* Test that dllimport'd functions have default visibility.  */
+/* { dg-require-visibility "" } */
+/* { dg-require-dll "" } */
+/* { dg-options "-fvisibility=hidden" } */
+/* { dg-final { scan-not-hidden "f1" } } */
+
+extern void  __attribute__((dllimport)) f1();
+void f2() {
+  f1();
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-13.c b/gcc/testsuite/gcc.dg/visibility-13.c
new file mode 100644 (file)
index 0000000..5f7a7c7
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-require-visibility "" } */
+/* { dg-require-dll "" } */
+
+extern void __attribute__((dllimport, visibility("hidden"))) 
+  f1(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("hidden"), dllimport)) 
+  f2(); /* { dg-error "visibility" } */
+extern void __attribute__((dllexport, visibility("hidden"))) 
+  f3(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("hidden"), dllexport)) 
+  f4(); /* { dg-error "visibility" } */
+extern void __attribute__((visibility("default"), dllimport))
+  f5();
+extern void __attribute__((dllimport, visibility("default")))
+  f6();
+extern void __attribute__((visibility("default"), dllexport))
+  f7();
+extern void __attribute__((dllexport, visibility("default")))
+  f8();