blob: 1f0eefddf2018971ee8e09f088986b028f42bf71 [file] [log] [blame]
Chris Lattner15008812006-06-18 07:00:07 +00001/*
Ted Kremenekb4476342008-09-03 21:22:16 +00002 RUN: clang -E -trigraphs %s | grep bar &&
3 RUN: clang -E -trigraphs %s | grep foo &&
4 RUN: clang -E -trigraphs %s | not grep abc &&
5 RUN: clang -E -trigraphs %s | not grep xyz &&
6 RUN: clang -fsyntax-only -trigraphs -verify %s
7*/
Chris Lattner15008812006-06-18 07:00:07 +00008
Chris Lattnerc850ad62007-07-21 23:43:37 +00009// This is a simple comment, /*/ does not end a comment, the trailing */ does.
10int i = /*/ */ 1;
11
Chris Lattner15008812006-06-18 07:00:07 +000012/* abc
13
Chris Lattnerbdf3f732007-06-28 05:49:50 +000014next comment ends with normal escaped newline:
15*/
16
17/* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\
18/
Chris Lattner15008812006-06-18 07:00:07 +000019
20bar
21
22/* xyz
23
Chris Lattnerbdf3f732007-06-28 05:49:50 +000024next comment ends with a trigraph escaped newline: */
Chris Lattner15008812006-06-18 07:00:07 +000025
Chris Lattnerbdf3f732007-06-28 05:49:50 +000026/* expected-warning {{escaped newline between}} expected-warning {{backslash and newline separated by space}} expected-warning {{trigraph ends block comment}} *??/
27/
Chris Lattner15008812006-06-18 07:00:07 +000028
Chris Lattnerbdf3f732007-06-28 05:49:50 +000029foo /* expected-error {{expected '=', ',', ';', 'asm', or '__attribute__' after declarator}} */
Chris Lattner15008812006-06-18 07:00:07 +000030
Chris Lattnere141a9e2008-12-12 07:34:39 +000031
32// rdar://6060752 - We should not get warnings about trigraphs in comments:
33// '????'
34/* ???? */
35
36
37
38