llvm-capstone/clang/test/Lexer/block_cmt_end.c
Mehdi Amini e0ac46e69d Revert "Remove rdar links; NFC"
This reverts commit d618f1c3b1.
This commit wasn't reviewed ahead of time and significant concerns were
raised immediately after it landed. According to our developer policy
this warrants immediate revert of the commit.

https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy

Differential Revision: https://reviews.llvm.org/D155509
2023-07-17 18:08:04 -07:00

46 lines
1.1 KiB
C

/*
RUN: %clang_cc1 -E -ftrigraphs %s | grep bar
RUN: %clang_cc1 -E -ftrigraphs %s | grep foo
RUN: %clang_cc1 -E -ftrigraphs %s | not grep qux
RUN: %clang_cc1 -E -ftrigraphs %s | not grep xyz
RUN: %clang_cc1 -fsyntax-only -ftrigraphs -verify %s
*/
// This is a simple comment, /*/ does not end a comment, the trailing */ does.
int i = /*/ */ 1;
/* qux
next comment ends with normal escaped newline:
*/
/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\
/
int bar /* expected-error {{expected ';' after top level declarator}} */
/* xyz
next comment ends with a trigraph escaped newline: */
/* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/
/
foo
// rdar://6060752 - We should not get warnings about trigraphs in comments:
// '????'
/* ???? */
// PR50456: multiple escaped newlines in one */.
/*
*\
??/
??/
\
/
// expected-warning@-5 {{escaped newline}}
// expected-warning@-4 {{separated by space}}
// expected-warning@-6 {{trigraph ends block comment}}