PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / raw-string-16.c
blob1185c0e377e0c5aa95cbc2644d84e6e66eca13a1
1 // PR preprocessor/57620
2 // { dg-do compile }
3 // { dg-options "-std=gnu99 -Wtrigraphs" { target c } }
4 // { dg-options "-std=gnu++11 -Wtrigraphs" { 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"abcdefghijklmn??/(a)abcdefghijklmn???";
11 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
12 // { dg-error "stray" "stray" { target *-*-* } .-2 }
14 const void *s2 = R"abcdefghijklmno??/(a)abcdefghijklmno???";
15 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
16 // { dg-error "stray" "stray" { target *-*-* } .-2 }
17 const void *s3 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=?"; // { dg-warning "trigraph ..= ignored" }
18 // { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
19 // { dg-error "stray" "stray" { target *-*-* } .-2 }
20 const void *s4 = R"abc\
21 ()abcdef";
22 // { dg-error "invalid character" "invalid" { target *-*-* } 20 }
23 // { dg-error "stray" "stray" { target *-*-* } 20 }
24 const void *s5 = R"\
25 ()";
26 // { dg-error "invalid character" "invalid" { target *-*-* } 24 }
27 // { dg-error "stray" "stray" { target *-*-* } 24 }
28 const void *s6 = R"\
29 a()a";
30 // { dg-error "invalid character" "invalid" { target *-*-* } 28 }
31 // { dg-error "stray" "stray" { target *-*-* } 28 }
33 int main () {}