xref: /aosp_15_r20/external/clang/test/Lexer/block_cmt_end.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li /*
2*67e74705SXin Li   RUN: %clang_cc1 -E -ftrigraphs %s | grep bar
3*67e74705SXin Li   RUN: %clang_cc1 -E -ftrigraphs %s | grep foo
4*67e74705SXin Li   RUN: %clang_cc1 -E -ftrigraphs %s | not grep qux
5*67e74705SXin Li   RUN: %clang_cc1 -E -ftrigraphs %s | not grep xyz
6*67e74705SXin Li   RUN: %clang_cc1 -fsyntax-only -ftrigraphs -verify %s
7*67e74705SXin Li */
8*67e74705SXin Li 
9*67e74705SXin Li // This is a simple comment, /*/ does not end a comment, the trailing */ does.
10*67e74705SXin Li int i = /*/ */ 1;
11*67e74705SXin Li 
12*67e74705SXin Li /* qux
13*67e74705SXin Li 
14*67e74705SXin Li next comment ends with normal escaped newline:
15*67e74705SXin Li */
16*67e74705SXin Li 
17*67e74705SXin Li /* expected-warning {{escaped newline}} expected-warning {{backslash and newline}}  *\
18*67e74705SXin Li /
19*67e74705SXin Li 
20*67e74705SXin Li int bar /* expected-error {{expected ';' after top level declarator}} */
21*67e74705SXin Li 
22*67e74705SXin Li /* xyz
23*67e74705SXin Li 
24*67e74705SXin Li next comment ends with a trigraph escaped newline: */
25*67e74705SXin Li 
26*67e74705SXin Li /* expected-warning {{escaped newline between}}   expected-warning {{backslash and newline separated by space}}    expected-warning {{trigraph ends block comment}}   *??/
27*67e74705SXin Li /
28*67e74705SXin Li 
29*67e74705SXin Li foo
30*67e74705SXin Li 
31*67e74705SXin Li 
32*67e74705SXin Li // rdar://6060752 - We should not get warnings about trigraphs in comments:
33*67e74705SXin Li // '????'
34*67e74705SXin Li /* ???? */
35