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" } */
12 #if '\x400' /* { dg-error "out of range" "\x out of range" } */
14 #if '\x0ff' /* { dg-bogus "out of range" "\x out of range" } */
16 #if '\400' /* { dg-error "out of range" "\x out of range" } */
18 #if '\377' /* { dg-bogus "out of range" "bogus \x out of range" } */
20 #if '\177' != 0x7f /* { dg-bogus "out of range" "bogus \x out of range" } */
21 #error bad octal /* { dg-bogus "bad" "bad octal evaluation" } */
23 #if '\0377' /* { dg-warning "multi" "too long octal" } */
25 #if '\p' /* { dg-error "unknown escape" "unknown escape seq" } */
32 c
= '\x'; /* { dg-error "no following" "\x with no digits" } */
33 c
= '\x100'; /* { dg-error "out of range" "\x out of range" } */
34 c
= '\x0ff'; /* { dg-bogus "out of range" "\x out of range" } */
35 c
= '\400'; /* { dg-error "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" } */