OSDN Git Service

2008-08-14 Rafael Avila de Espindola <espindola@google.com>
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2008 16:05:36 +0000 (16:05 +0000)
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 14 Aug 2008 16:05:36 +0000 (16:05 +0000)
* gcc.dg/visibility-14.c: New test.
* gcc.dg/visibility-15.c: New test.
* gcc.dg/visibility-16.c: New test.
* gcc.dg/visibility-17.c: New test.
* gcc.dg/visibility-18.c: New test.
* gcc.dg/visibility-19.c: New test.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/visibility-14.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-15.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-17.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-18.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/visibility-19.c [new file with mode: 0644]

index 5355b4d..f738628 100644 (file)
@@ -1,3 +1,12 @@
+2008-08-14  Rafael Avila de Espindola  <espindola@google.com>
+
+       * gcc.dg/visibility-14.c: New test.
+       * gcc.dg/visibility-15.c: New test.
+       * gcc.dg/visibility-16.c: New test.
+       * gcc.dg/visibility-17.c: New test.
+       * gcc.dg/visibility-18.c: New test.
+       * gcc.dg/visibility-19.c: New test.
+
 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/34600
diff --git a/gcc/testsuite/gcc.dg/visibility-14.c b/gcc/testsuite/gcc.dg/visibility-14.c
new file mode 100644 (file)
index 0000000..6b75608
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test that called external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+int f () {
+ foo();
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-15.c b/gcc/testsuite/gcc.dg/visibility-15.c
new file mode 100644 (file)
index 0000000..4a3aa68
--- /dev/null
@@ -0,0 +1,11 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+
+foo_t g(void) {
+  return foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-16.c b/gcc/testsuite/gcc.dg/visibility-16.c
new file mode 100644 (file)
index 0000000..055d00f
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test that accessed external variables are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int f () {
+  return foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-17.c b/gcc/testsuite/gcc.dg/visibility-17.c
new file mode 100644 (file)
index 0000000..99a1bc2
--- /dev/null
@@ -0,0 +1,9 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *f () {
+  return &foo;
+}
diff --git a/gcc/testsuite/gcc.dg/visibility-18.c b/gcc/testsuite/gcc.dg/visibility-18.c
new file mode 100644 (file)
index 0000000..4e87066
--- /dev/null
@@ -0,0 +1,7 @@
+/* Test that external variable whose address is taken are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern int foo __attribute__ ((visibility ("hidden")));
+int *test = &foo;
diff --git a/gcc/testsuite/gcc.dg/visibility-19.c b/gcc/testsuite/gcc.dg/visibility-19.c
new file mode 100644 (file)
index 0000000..f56f136
--- /dev/null
@@ -0,0 +1,8 @@
+/* Test that accessed external functions are marked. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-hidden "foo" } } */
+
+extern void foo(void) __attribute__ ((visibility ("hidden")));
+typedef void (*foo_t)(void);
+foo_t test = foo;