]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.dg/cxx-comments-2.c
Test cases for c++ comments and endif labels in system headers.
[gcc.git] / gcc / testsuite / gcc.dg / cxx-comments-2.c
1 /* { dg-do preprocess } */
2 /* { dg-options "-pedantic -std=c89" } */
3
4 /* This is an extension and therefore gets a warning. */
5 #line 5 "cxx-comments-2.c" 3 /* { dg-warning "garbage at end" "#line extension" } */
6
7 /* A system header may contain C++ comments irrespective of mode. */
8 // C++ comment is not in C89 { dg-bogus "style comment" "bad warning" }
9
10 /*
11 { dg-final { if ![file exists cxx-comments-2.i] { return } } }
12 { dg-final { set tmp [grep cxx-comments-2.i "is not in C89" line] } }
13 { dg-final { # send_user "$tmp\n" } }
14 { dg-final { if [regexp "is not in C89" $tmp] \{ } }
15 { dg-final { fail "cxx-comments-2: comment strip check" } }
16 { dg-final { \} else \{ } }
17 { dg-final { pass "cxx-comments-2: comment strip check" } }
18 { dg-final { \} } }
19 */
20
This page took 0.039456 seconds and 5 git commands to generate.