comparison gcc/testsuite/c-c++-common/raw-string-16.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
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++ } }
5
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 }
13
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 }
32
33 int main () {}