46 lines · c
1/*2 RUN: %clang_cc1 -E -ftrigraphs %s | grep bar3 RUN: %clang_cc1 -E -ftrigraphs %s | grep foo4 RUN: %clang_cc1 -E -ftrigraphs %s | not grep qux5 RUN: %clang_cc1 -E -ftrigraphs %s | not grep xyz6 RUN: %clang_cc1 -fsyntax-only -ftrigraphs -verify %s 7*/8 9// This is a simple comment, /*/ does not end a comment, the trailing */ does.10int i = /*/ */ 1;11 12/* qux13 14next comment ends with normal escaped newline:15*/16 17/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\ 18/19 20int bar /* expected-error {{expected ';' after top level declarator}} */21 22/* xyz23 24next comment ends with a trigraph escaped newline: */25 26/* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/ 27/28 29foo30 31 32// We should not get warnings about trigraphs in comments:33// '????'34/* ???? */35 36// PR50456: multiple escaped newlines in one */.37/*38 *\39??/40??/ 41\ 42/43// expected-warning@-5 {{escaped newline}}44// expected-warning@-4 {{separated by space}}45// expected-warning@-6 {{trigraph ends block comment}}46