2018-01-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / escape.c
blobe7d5e08dd49382ecd2e1b47d131852964b51d73a
1 /* Copyright (C) 2001 Free Software Foundation, Inc. */
3 /* { dg-do compile } */
4 /* { dg-options "-Wtraditional -std=c89" } */
6 /* This tests various diagnostics with -Wtraditioanl about escape
7 sequences, for both the preprocessor and the compiler.
9 Neil Booth, 22 May 2001. */
11 #if '\a' /* { dg-warning "traditional" "traditional bell" } */
12 #endif
13 #if '\x1a' != 26 /* { dg-warning "traditional" "traditional hex" } */
14 #error bad hex /* { dg-bogus "bad" "bad hexadecimal evaluation" } */
15 #endif
16 #if L'\u00a1' /* { dg-warning "only valid" "\u is unknown in C89" } */
17 #endif
19 void foo ()
21 int c = '\a'; /* { dg-warning "traditional" "traditional bell" } */
23 c = '\xa1'; /* { dg-warning "traditional" "traditional hex" } */
24 c = L'\u00a1'; /* { dg-warning "only valid" "\u is unknown in C89" } */