Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | /* |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 2 | 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 Kremenek | ea644d8 | 2008-09-03 21:22:16 +0000 | [diff] [blame] | 7 | */ |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 8 | |
Chris Lattner | 8146b68 | 2007-07-21 23:43:37 +0000 | [diff] [blame] | 9 | // This is a simple comment, /*/ does not end a comment, the trailing */ does. |
| 10 | int i = /*/ */ 1; |
| 11 | |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 12 | /* abc |
| 13 | |
| 14 | next comment ends with normal escaped newline: |
| 15 | */ |
| 16 | |
| 17 | /* expected-warning {{escaped newline}} expected-warning {{backslash and newline}} *\ |
| 18 | / |
| 19 | |
Chris Lattner | 9b3215d | 2010-07-11 22:46:04 +0000 | [diff] [blame] | 20 | int bar /* expected-error {{expected ';' after top level declarator}} */ |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 21 | |
| 22 | /* xyz |
| 23 | |
| 24 | next 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 McCall | d8ac057 | 2009-11-03 19:26:08 +0000 | [diff] [blame] | 29 | foo |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 30 | |
Chris Lattner | bc3e984 | 2008-12-12 07:34:39 +0000 | [diff] [blame] | 31 | |
| 32 | // rdar://6060752 - We should not get warnings about trigraphs in comments: |
| 33 | // '????' |
| 34 | /* ???? */ |
| 35 | |
| 36 | |
| 37 | |
| 38 | |