blob: 72bc836a0ef0cb1b2c3067f9891339eea422851a [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001/*
Daniel Dunbara5728872009-12-15 20:14:24 +00002 RUN: %clang_cc1 -E -trigraphs %s | grep bar
3 RUN: %clang_cc1 -E -trigraphs %s | grep foo
4 RUN: %clang_cc1 -E -trigraphs %s | not grep abc
5 RUN: %clang_cc1 -E -trigraphs %s | not grep xyz
6 RUN: %clang_cc1 -fsyntax-only -trigraphs -verify %s
Ted Kremenekea644d82008-09-03 21:22:16 +00007*/
Reid Spencer5f016e22007-07-11 17:01:13 +00008
Chris Lattner8146b682007-07-21 23:43:37 +00009// This is a simple comment, /*/ does not end a comment, the trailing */ does.
10int i = /*/ */ 1;
11
Reid Spencer5f016e22007-07-11 17:01:13 +000012/* abc
13
14next comment ends with normal escaped newline:
15*/
16
17/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\
18/
19
John McCalld8ac0572009-11-03 19:26:08 +000020int bar /* expected-error {{invalid token after top level declarator}} */
Reid Spencer5f016e22007-07-11 17:01:13 +000021
22/* xyz
23
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
John McCalld8ac0572009-11-03 19:26:08 +000029foo
Reid Spencer5f016e22007-07-11 17:01:13 +000030
Chris Lattnerbc3e9842008-12-12 07:34:39 +000031
32// rdar://6060752 - We should not get warnings about trigraphs in comments:
33// '????'
34/* ???? */
35
36
37
38