blob: 1d00137644c3094d28bd43d0d9745bb8e561c93e [file] [log] [blame]
Chris Lattner15008812006-06-18 07:00:07 +00001/*
Nico Weber00721502014-12-23 22:32:37 +00002 RUN: %clang_cc1 -E -ftrigraphs %s | grep bar
3 RUN: %clang_cc1 -E -ftrigraphs %s | grep foo
4 RUN: %clang_cc1 -E -ftrigraphs %s | not grep qux
5 RUN: %clang_cc1 -E -ftrigraphs %s | not grep xyz
6 RUN: %clang_cc1 -fsyntax-only -ftrigraphs -verify %s
Ted Kremenekb4476342008-09-03 21:22:16 +00007*/
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
Matt Beaumont-Gay5bd77b32011-05-10 20:28:29 +000012/* qux
Chris Lattner15008812006-06-18 07:00:07 +000013
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
Chris Lattneref74e2b22010-07-11 22:46:04 +000020int bar /* expected-error {{expected ';' after top level declarator}} */
Chris Lattner15008812006-06-18 07:00:07 +000021
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
John McCalld5a36322009-11-03 19:26:08 +000029foo
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/* ???? */