OSDN Git Service

For Greta Yorsh.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / binary-constants-4.c
1 /* Test for binary integer constants: random errors.  */
2
3 /* Origin: Joerg Wunsch <j.gnu@uriah.heep.sax.de>.  */
4 /* { dg-do compile } */
5 /* { dg-options "-std=gnu99" } */
6
7 void
8 foo(void)
9 {
10   double d;
11   int i;
12
13   d = 0b1101;
14   d = 0b1101p1; /* { dg-error "invalid suffix \"p1\" on integer constant" } */
15   d = 0x1101p1;
16   i = 0b3011;   /* { dg-error "invalid suffix \"b3011\" on integer constant" } */
17   i = 0b113;    /* { dg-error "invalid digit \"3\" in binary constant" } */
18 }