Merged r157428 through r157652 into branch.
[official-gcc.git] / gcc / testsuite / gcc.dg / raw-string-3.c
blob9226411d2e0d883c705546e506ba8761ad7deb7c
1 /* If not gnu99, the {,u,u8,U,L}R prefix should be parsed as separate
2 token. */
3 /* { dg-do compile } */
4 /* { dg-options "" } */
6 const void *s0 = R"[a]"; /* { dg-error "undeclared" } */
7 /* { dg-error "expected ',' or ';'" "" { target *-*-* } 6 } */
8 const void *s1 = uR"[a]"; /* { dg-error "undeclared" } */
9 /* { dg-error "expected ',' or ';'" "" { target *-*-* } 8 } */
10 const void *s2 = UR"[a]"; /* { dg-error "undeclared" } */
11 /* { dg-error "expected ',' or ';'" "" { target *-*-* } 10 } */
12 const void *s3 = u8R"[a]"; /* { dg-error "undeclared" } */
13 /* { dg-error "expected ',' or ';'" "" { target *-*-* } 12 } */
14 const void *s4 = LR"[a]"; /* { dg-error "undeclared" } */
15 /* { dg-error "expected ',' or ';'" "" { target *-*-* } 14 } */
17 const int i0 = R'a'; /* { dg-error "expected ',' or ';'" } */
18 const int i1 = uR'a'; /* { dg-error "expected ',' or ';'" } */
19 const int i2 = UR'a'; /* { dg-error "expected ',' or ';'" } */
20 const int i3 = u8R'a'; /* { dg-error "expected ',' or ';'" } */
21 const int i4 = LR'a'; /* { dg-error "expected ',' or ';'" } */
23 #define R "a"
24 #define uR "b"
25 #define UR "c"
26 #define u8R "d"
27 #define LR "e"
29 const void *s5 = R"[a]";
30 const void *s6 = uR"[a]";
31 const void *s7 = UR"[a]";
32 const void *s8 = u8R"[a]";
33 const void *s9 = LR"[a]";
35 #undef R
36 #undef uR
37 #undef UR
38 #undef u8R
39 #undef LR
41 #define R 1 +
42 #define uR 2 +
43 #define UR 3 +
44 #define u8R 4 +
45 #define LR 5 +
47 const int i5 = R'a';
48 const int i6 = uR'a';
49 const int i7 = UR'a';
50 const int i8 = u8R'a';
51 const int i9 = LR'a';
53 int main () {}