* gcc.c-torture/execute/builtin-constant.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58760
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-11-02 Diego Novillo <dnovillo@redhat.com>
+
+ PR optimization/8423
+ * gcc.c-torture/execute/builtin-constant.c: New test.
+
2002-11-01 Zack Weinberg <zack@codesourcery.com>
* g++.dg/ext/typedef-init.C, gcc.dg/typedef-init.C:
--- /dev/null
+/* PR optimization/8423. */
+
+#define btest(x) __builtin_constant_p(x) ? "1" : "0"
+
+#ifdef __OPTIMIZE__
+void
+foo (char *i)
+{
+ if (*i == '0')
+ abort ();
+}
+#else
+void
+foo (char *i)
+{
+}
+#endif
+
+int
+main (void)
+{
+ int size = sizeof (int);
+ foo (btest (size));
+ foo (btest (size));
+ exit (0);
+}