summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/binary-constants-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/binary-constants-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/binary-constants-3.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/binary-constants-3.c b/gcc/testsuite/gcc.dg/binary-constants-3.c
new file mode 100644
index 000000000..984477dca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/binary-constants-3.c
@@ -0,0 +1,16 @@
+/* Test for binary integer constants: -pedantic-errors. */
+
+/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+#define FOO 0b1101
+
+int
+foo (void)
+{
+#if FOO /* { dg-error "binary constants are a GCC extension" } */
+ return 23;
+#endif
+ return 0b1101; /* { dg-error "binary constants are a GCC extension" } */
+}