Debian Codegraph @

gcc/testsuite/c-c++-common/raw-string-14.c

raw
1 // PR preprocessor/57620
2 // { dg-do compile { target { c || c++11 } } }
3 // { dg-options "-std=gnu99 -trigraphs" { target c } }
4
5 const void *s0 = R"abc\
6 def()abcdef" 0;
7 // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
8 // { dg-error "stray" "stray" { target *-*-* } .-3 }
9 const void *s1 = R"??/
10 ()??/" 0;
11 // { dg-error "invalid new-line" "invalid" { target *-*-* } .-2 }
12 // { dg-error "stray" "stray" { target *-*-* } .-3 }
13 const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???" 0;
14 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
15 // { dg-error "stray" "stray" { target *-*-* } .-2 }
16 const void *s3 = R"abcdefghijklmno??/(a)abcdefghijklmno???" 0;
17 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
18 // { dg-error "stray" "stray" { target *-*-* } .-2 }
19 const void *s4 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=" 0;
20 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
21 // { dg-error "stray" "stray" { target *-*-* } .-2 }
22 const void *s5 = R"abc\
23 ()abcdef" 0;
24 // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
25 // { dg-error "stray" "stray" { target *-*-* } .-3 }
26 const void *s6 = R"\
27 ()" 0;
28 // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
29 // { dg-error "stray" "stray" { target *-*-* } .-3 }
30 const void *s7 = R"\
31 a()a" 0;
32 // { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
33 // { dg-error "stray" "stray" { target *-*-* } .-3 }
34
35 int main () {}