1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu99" { target c } } */
3 /* { dg-options "-std=c++11" { target c++ } } */
5 /* Test that multi-line raw strings are lexed OK for all preprocessing
6 directives where one could appear. Test raw-string-directive-2.c
7 checks that #define is also processed properly. */
9 /* Note that in cases where we cause GCC to produce a multi-line error
10 message, we construct the string so that the second line looks enough
11 like an error message for DejaGNU to process it as such, so that we
12 can use dg-warning or dg-error directives to check for it. */
14 #warning R"delim(line1 /* { dg-warning "line1" } */
15 file:15:1: warning: line2)delim" /* { dg-warning "line2" } */
17 #error R"delim(line3 /* { dg-error "line3" } */
18 file:18:1: error: line4)delim" /* { dg-error "line4" } */
29 #define X2(a) X1 #a R"(line 11
34 #if R"(line 13 /* { dg-error "line13" } */
35 file:35:1: error: line14)" /* { dg-error "line14\\)\"\" is not valid" } */
36 #endif R"(line 15 /* { dg-warning "extra tokens at end of #endif" } */
40 #ifdef XYZ R"(line17 /* { dg-warning "extra tokens at end of #ifdef" } */
47 #else R"(line23 /* { dg-warning "extra tokens at end of #else" } */
54 #elif R"(line 25 /* { dg-error "line25" } */
55 file:55:1: error: line26)" /* { dg-error "line26\\)\"\" is not valid" } */
58 #line 60 R"(file:60:1: warning: this file has a space
60 #warning "line27" /* { dg-warning "line27" } */
61 /* { dg-warning "this file has a space" "#line check" { target *-*-* } 60 } */
64 #undef X1 R"(line28 /* { dg-warning "extra tokens at end of #undef" } */
70 line31)" R"(line 32 /* { dg-warning "extra tokens at end of #ident" } */
73 #pragma GCC diagnostic ignored R"(-Woption /* { dg-warning "-Wpragmas" } */