re PR ipa/61159 (__builtin_constant_p gives incorrect results with aliases)
authorJan Hubicka <hubicka@ucw.cz>
Sun, 11 Sep 2016 12:15:02 +0000 (14:15 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 11 Sep 2016 12:15:02 +0000 (12:15 +0000)
PR ipa/61159
* compile/pr61159.c: New testcase

From-SVN: r240082

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr61159.c [new file with mode: 0644]

index 8766abb787135a963b4cfb03021953d0778fd55f..2ec3a240b869f4c89ecf549303de764c521cc328 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-09  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR ipa/61159
+       * compile/pr61159.c: New testcase
+
 2016-08-09  Jan Hubicka  <hubicka@ucw.cz>
 
        PR ipa/64316
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr61159.c b/gcc/testsuite/gcc.c-torture/compile/pr61159.c
new file mode 100644 (file)
index 0000000..5afa6ea
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-require-alias "" } */
+/* { dg-require-weak "" } */
+
+static int dummy = 0;
+extern int foo __attribute__((__weak__, __alias__("dummy")));
+typedef char check[2*!__builtin_constant_p(dummy)-1];
+typedef char check[2*!__builtin_constant_p(foo)-1];