re PR lto/60820 (ice in ctor_for_folding, at varpool.c:291)
authorJan Hubicka <hubicka@ucw.cz>
Thu, 17 Apr 2014 02:32:26 +0000 (04:32 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 17 Apr 2014 02:32:26 +0000 (02:32 +0000)
PR lto/60820
* gcc.dg/lto/pr60820_0.c: New testcase.
* gcc.dg/lto/pr60820_1.c: New testcase.

From-SVN: r209460

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr60820_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr60820_1.c [new file with mode: 0644]

index de911fd..560b5f7 100644 (file)
@@ -1,5 +1,11 @@
 2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
 
+       PR lto/60820
+       * gcc.dg/lto/pr60820_0.c: New testcase.
+       * gcc.dg/lto/pr60820_1.c: New testcase.
+
+2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
+
        PR ipa/60854
        * g++.dg/torture/pr60854.C: New testcase.
 
diff --git a/gcc/testsuite/gcc.dg/lto/pr60820_0.c b/gcc/testsuite/gcc.dg/lto/pr60820_0.c
new file mode 100644 (file)
index 0000000..349cf6a
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options {{-flto -r -nostdlib -O2}} } */
+#include <stdio.h>
+struct in6_addr {int bah;};
+extern const struct in6_addr in6addr_any;
+static const struct in6_addr local_in6addr_any = {1};
+#pragma weak in6addr_any = local_in6addr_any
+
+__attribute__ ((used))
+void foo2()
+{
+  fprintf (stderr, "v1: %p, v2: %p\n", &local_in6addr_any, &in6addr_any);
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr60820_1.c b/gcc/testsuite/gcc.dg/lto/pr60820_1.c
new file mode 100644 (file)
index 0000000..16009e4
--- /dev/null
@@ -0,0 +1,11 @@
+#include <stdio.h>
+struct in6_addr {int bah;};
+extern const struct in6_addr in6addr_any;
+static const struct in6_addr local_in6addr_any = {1};
+#pragma weak in6addr_any = local_in6addr_any
+
+__attribute__ ((used))
+void foo()
+{
+  fprintf (stderr, "v1: %p, v2: %p\n", &local_in6addr_any, &in6addr_any);
+}