summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/escape-2.c
blob: 31bf882c7211b4e934df4762e40952f15c50f0a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright (C) 2001 Free Software Foundation, Inc.  */

/* { dg-do compile } */
/* { dg-options "-pedantic -std=c99 -fno-show-column" } */

/* This tests various diagnostics with -pedantic about escape
   sequences, for both the preprocessor and the compiler.

   Neil Booth, 22 May 2001.  */

#if '\e'		/* { dg-warning "non-ISO" "non-ISO \\e" } */
#endif
#if '\u00a0'		/* { dg-bogus "unknown" "\\u is known in C99" } */
#endif

void foo ()
{
  int c = '\E';		/* { dg-warning "non-ISO" "non-ISO \\E" } */
  c = '\u00a0';		/* { dg-bogus "unknown" "\\u is known in C99" } */
}