re PR ipa/61144 (Invalid optimizations for extern vars with local weak definitions)
authorJan Hubicka <hubicka@ucw.cz>
Sun, 5 Oct 2014 04:56:14 +0000 (06:56 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 5 Oct 2014 04:56:14 +0000 (04:56 +0000)
PR ipa/61144
* gcc.dg/tree-ssa/pr61144.c: New testcase.

From-SVN: r215897

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr61144.c [new file with mode: 0644]

index 4672a6830f7aa631aaaf9d6765917816265eff78..39af721082980c1e54a385543a032a089df05f41 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-04  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR ipa/61144
+       * gcc.dg/tree-ssa/pr61144.c: New testcase.
+
 2014-10-04  Jan Hubicka  <hubicka@ucw.cz>
 
        * g++.dg/ipa/devirt-46.C: New testcase.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c b/gcc/testsuite/gcc.dg/tree-ssa/pr61144.c
new file mode 100644 (file)
index 0000000..cd34b14
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+static int dummy = 0;
+extern int foo __attribute__((__weak__, __alias__("dummy")));
+int bar() { if (foo) return 1; return 0; }
+/* { dg-final { scan-tree-dump-not "return 0" "optimized"} } */