re PR tree-optimization/47278 (hidden weak function not handled properly)
authorRichard Guenther <rguenther@suse.de>
Fri, 11 Mar 2011 10:45:54 +0000 (10:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 11 Mar 2011 10:45:54 +0000 (10:45 +0000)
2011-03-11  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/47278
* gcc.dg/torture/pr47278-1.c: New testcase.
* gcc.dg/torture/pr47278-2.c: Likewise.

From-SVN: r170869

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr47278-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr47278-2.c [new file with mode: 0644]

index 23c94cec8fcf73ecb824f0652ef301e2f28a204f..48619b6b7e10c914412e9a8afd1d1b1d11c6446e 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-11  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/47278
+       * gcc.dg/torture/pr47278-1.c: New testcase.
+       * gcc.dg/torture/pr47278-2.c: Likewise.
+
 2011-03-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/48063
diff --git a/gcc/testsuite/gcc.dg/torture/pr47278-1.c b/gcc/testsuite/gcc.dg/torture/pr47278-1.c
new file mode 100644 (file)
index 0000000..f97906c
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do run } */
+/* { dg-require-visibility "" } */
+/* { dg-additional-sources "pr47278-2.c" } */
+
+int foo (void) { return 1; }
diff --git a/gcc/testsuite/gcc.dg/torture/pr47278-2.c b/gcc/testsuite/gcc.dg/torture/pr47278-2.c
new file mode 100644 (file)
index 0000000..0c700d1
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-require-visibility "" } */
+
+extern void abort (void);
+
+int __attribute__((weak,visibility("hidden"))) foo (void)
+{
+  return 0;
+}
+
+int main()
+{
+  if (foo() != 1)
+    abort ();
+  return 0;
+}