aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c
new file mode 100644
index 000000000..0302768c9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/visibility-5.c
@@ -0,0 +1,12 @@
+/* Test visibility attribute on definition of a function that has
+ already had a forward declaration. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+void foo();
+
+void
+ __attribute__((visibility ("hidden")))
+foo()
+{ }