Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / c-c++-common / raw-string-directive-1.c
blobd6525e107bc29822f0517f28557421dfdeff8bdb
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" } */
20 #define X1 R"(line 5
21 line 6
22 line 7
23 line 8
26 line 9)" R"delim(
27 line10)delim"
29 #define X2(a) X1 #a R"(line 11
31 line12
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" } */
38 line16)" ""
40 #ifdef XYZ R"(line17 /* { dg-warning "extra tokens at end of #ifdef" } */
43 line18)"
44 #endif
46 #if 1
47 #else R"(line23 /* { dg-warning "extra tokens at end of #else" } */
50 line24)"
51 #endif
53 #if 0
54 #elif R"(line 25 /* { dg-error "line25" } */
55 file:55:1: error: line26)" /* { dg-error "line26\\)\"\" is not valid" } */
56 #endif
58 #line 60 R"(file:60:1: warning: this file has a space
59 in it!)"
60 #warning "line27" /* { dg-warning "line27" } */
61 /* { dg-warning "this file has a space" "#line check" { target *-*-* } 60 } */
62 #line 63 "file"
64 #undef X1 R"(line28 /* { dg-warning "extra tokens at end of #undef" } */
65 line29
69 #ident R"(line30
70 line31)" R"(line 32 /* { dg-warning "extra tokens at end of #ident" } */
71 line 33)"
73 #pragma GCC diagnostic ignored R"(-Woption /* { dg-warning "-Wpragmas" } */
74 -with-a-newline)"