diff options
author | Joerg Wunsch <j.gnu@uriah.heep.sax.de> | 2007-06-05 22:25:27 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-06-05 22:25:27 +0000 |
commit | f7fd775f0203c580b35b179976c665db3e4d9e46 (patch) | |
tree | f7bdd99b29a4dc2624af52e3f3a9d6c816e0b468 /gcc/testsuite/gcc.dg/binary-constants-2.c | |
parent | 1a5f8b894c144cc15f6a63b3b52ba28b5bd4e94f (diff) | |
download | gcc-f7fd775f0203c580b35b179976c665db3e4d9e46.zip gcc-f7fd775f0203c580b35b179976c665db3e4d9e46.tar.gz gcc-f7fd775f0203c580b35b179976c665db3e4d9e46.tar.bz2 |
re PR preprocessor/23479 (Implement binary constants with a "0b" prefix)
2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
PR preprocessor/23479
gcc/
* doc/extend.texi: Document the 0b-prefixed binary integer
constant extension.
libcpp/
* expr.c (cpp_classify_number): Implement 0b-prefixed binary
integer constants.
(append_digit): Likewise.
* include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
binary integer constants.
testsuite/
* testsuite/gcc.dg/binary-constants-1.c: Add test suites for
the 0b-prefixed binary integer constants.
* testsuite/gcc.dg/binary-constants-2.c: Ditto.
* testsuite/gcc.dg/binary-constants-3.c: Ditto.
* testsuite/gcc.dg/binary-constants-4.c: Ditto.
From-SVN: r125346
Diffstat (limited to 'gcc/testsuite/gcc.dg/binary-constants-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/binary-constants-2.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/binary-constants-2.c b/gcc/testsuite/gcc.dg/binary-constants-2.c new file mode 100644 index 0000000..40d7636 --- /dev/null +++ b/gcc/testsuite/gcc.dg/binary-constants-2.c @@ -0,0 +1,16 @@ +/* Test for binary integer constants: -pedantic warnings. */ + +/* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic" } */ + +#define FOO 0b1101 + +int +foo (void) +{ +#if FOO /* { dg-warning "binary constants are a GCC extension" } */ + return 23; +#endif + return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */ +} |