Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / raw-string-14.c
blobb2e395c3f73fd41d01eab163cedb8daa332a6487
1 // PR preprocessor/57620
2 // { dg-do compile }
3 // { dg-options "-std=gnu99 -trigraphs" { target c } }
4 // { dg-options "-std=c++11" { target c++ } }
6 const void *s0 = R"abc\
7 def()abcdef";
8 // { dg-error "invalid character" "invalid" { target *-*-* } 6 }
9 // { dg-error "stray" "stray" { target *-*-* } 6 }
10 const void *s1 = R"??/
11 ()??/";
12 // { dg-error "invalid new-line" "invalid" { target *-*-* } 10 }
13 // { dg-error "stray" "stray" { target *-*-* } 10 }
14 // { dg-warning "missing terminating" "missing" { target *-*-* } 10 }
15 // { dg-error "19:missing terminating" "missing" { target *-*-* } 10 }
16 const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???";
17 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
18 // { dg-error "stray" "stray" { target *-*-* } .-2 }
19 // { dg-error "expected" "expected" { target *-*-* } .-3 }
20 const void *s3 = R"abcdefghijklmno??/(a)abcdefghijklmno???";
21 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
22 // { dg-error "stray" "stray" { target *-*-* } .-2 }
23 const void *s4 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=";
24 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
25 // { dg-error "stray" "stray" { target *-*-* } .-2 }
26 const void *s5 = R"abc\
27 ()abcdef";
28 // { dg-error "invalid character" "invalid" { target *-*-* } 26 }
29 // { dg-error "stray" "stray" { target *-*-* } 26 }
30 const void *s6 = R"\
31 ()";
32 // { dg-error "invalid character" "invalid" { target *-*-* } 30 }
33 // { dg-error "stray" "stray" { target *-*-* } 30 }
34 const void *s7 = R"\
35 a()a";
36 // { dg-error "invalid character" "invalid" { target *-*-* } 34 }
37 // { dg-error "stray" "stray" { target *-*-* } 34 }
39 int main () {}