aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/raw-string-14.c
blob: fba826c4c5133ed5dd978e67de68d481b9232dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// PR preprocessor/57620
// { dg-do compile }
// { dg-options "-std=gnu99 -trigraphs" { target c } }
// { dg-options "-std=c++11" { target c++ } }

const void *s0 = R"abc\
def()abcdef" 0;
	// { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
	// { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s1 = R"??/
()??/" 0;
	// { dg-error "invalid new-line" "invalid" { target *-*-* } .-2 }
	// { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???" 0;
	// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
	// { dg-error "stray" "stray" { target *-*-* } .-2 }
const void *s3 = R"abcdefghijklmno??/(a)abcdefghijklmno???" 0;
	// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
	// { dg-error "stray" "stray" { target *-*-* } .-2 }
const void *s4 = R"abcdefghijklmnop??=(a)abcdefghijklmnop??=" 0;
	// { dg-error "raw string delimiter longer" "longer" { target *-*-* } .-1 }
	// { dg-error "stray" "stray" { target *-*-* } .-2 }
const void *s5 = R"abc\
()abcdef" 0;
	// { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
	// { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s6 = R"\
()" 0;
	// { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
	// { dg-error "stray" "stray" { target *-*-* } .-3 }
const void *s7 = R"\
a()a" 0;
	// { dg-error "invalid character" "invalid" { target *-*-* } .-2 }
	// { dg-error "stray" "stray" { target *-*-* } .-3 }

int main () {}