Richard Smith | 4676203 | 2014-06-20 19:23:57 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++1z %s -verify |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 2 | // RUN: %clang_cc1 -std=c++1z %s -verify -ftrigraphs -DENABLED_TRIGRAPHS=1 |
| 3 | // RUN: %clang_cc1 -std=c++1z %s -verify -fno-trigraphs -DENABLED_TRIGRAPHS=0 |
Richard Smith | 4676203 | 2014-06-20 19:23:57 +0000 | [diff] [blame] | 4 | |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 5 | #ifdef __MVS__ |
| 6 | #ifndef ENABLED_TRIGRAPHS |
| 7 | #define ENABLED_TRIGRAPHS 1 |
| 8 | #endif |
| 9 | #endif |
Richard Smith | 4676203 | 2014-06-20 19:23:57 +0000 | [diff] [blame] | 10 | |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 11 | ??= define foo ; |
| 12 | |
| 13 | static_assert("??="[0] == '#', ""); |
Richard Smith | 4676203 | 2014-06-20 19:23:57 +0000 | [diff] [blame] | 14 | |
| 15 | // ??/ |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 16 | error here; |
Richard Smith | 4c132e5 | 2017-04-18 21:45:04 +0000 | [diff] [blame] | 17 | |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 18 | // Note, there is intentionally trailing whitespace one line below. |
Richard Smith | 4c132e5 | 2017-04-18 21:45:04 +0000 | [diff] [blame] | 19 | // ??/ |
Abhina Sreeskantharajan | dedaf78 | 2020-08-13 14:33:04 -0400 | [diff] [blame] | 20 | error here; |
| 21 | |
| 22 | #if !ENABLED_TRIGRAPHS |
| 23 | // expected-error@11 {{}} expected-warning@11 {{trigraph ignored}} |
| 24 | // expected-error@13 {{failed}} expected-warning@13 {{trigraph ignored}} |
| 25 | // expected-error@16 {{}} |
| 26 | // expected-error@20 {{}} |
| 27 | #else |
| 28 | // expected-warning@11 {{trigraph converted}} |
| 29 | // expected-warning@13 {{trigraph converted}} |
| 30 | // expected-warning@19 {{backslash and newline separated by space}} |
| 31 | #endif |