Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / cpp / escape-1.c
blob52d7414f3ae9f879abf8857a3afef22c0d37e492
1 /* Copyright (C) 2001 Free Software Foundation, Inc. */
3 /* { dg-do compile } */
5 /* This tests various diagnostics about escape sequences, for both
6 the preprocessor and the compiler.
8 Neil Booth, 22 May 2001. */
10 #if '\x' /* { dg-error "no following" "\x with no digits" } */
11 #endif
12 #if '\x400' /* { dg-warning "out of range" "\x out of range" } */
13 #endif
14 #if '\x0ff' /* { dg-bogus "out of range" "\x out of range" } */
15 #endif
16 #if '\400' /* { dg-warning "out of range" "\x out of range" } */
17 #endif
18 #if '\377' /* { dg-bogus "out of range" "bogus \x out of range" } */
19 #endif
20 #if '\177' != 0x7f /* { dg-bogus "out of range" "bogus \x out of range" } */
21 #error bad octal /* { dg-bogus "bad" "bad octal evaluation" } */
22 #endif
23 #if '\0377' /* { dg-warning "multi" "too long octal" } */
24 #endif
25 #if '\p' /* { dg-error "unknown escape" "unknown escape seq" } */
26 #endif
28 void foo ()
30 int c;
32 c = '\x'; /* { dg-error "no following" "\x with no digits" } */
33 c = '\x100'; /* { dg-warning "out of range" "\x out of range" } */
34 c = '\x0ff'; /* { dg-bogus "out of range" "\x out of range" } */
35 c = '\400'; /* { dg-warning "out of range" "\x out of range" } */
36 c = '\377'; /* { dg-bogus "out of range" "bogus \x out of range" } */
37 c = '\0377'; /* { dg-warning "multi" "too long octal" } */
38 c = '\p'; /* { dg-error "unknown escape" "unknown escape seq" } */