blob: d6069e77f897d2d0b59a9dcaf3cb4611b36b2883 [file] [log] [blame]
Richard Smith46762032014-06-20 19:23:57 +00001// RUN: %clang_cc1 -std=c++1z %s -verify
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -04002// 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 Smith46762032014-06-20 19:23:57 +00004
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -04005#ifdef __MVS__
6#ifndef ENABLED_TRIGRAPHS
7#define ENABLED_TRIGRAPHS 1
8#endif
9#endif
Richard Smith46762032014-06-20 19:23:57 +000010
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -040011??= define foo ;
12
13static_assert("??="[0] == '#', "");
Richard Smith46762032014-06-20 19:23:57 +000014
15// ??/
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -040016error here;
Richard Smith4c132e52017-04-18 21:45:04 +000017
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -040018// Note, there is intentionally trailing whitespace one line below.
Richard Smith4c132e52017-04-18 21:45:04 +000019// ??/
Abhina Sreeskantharajandedaf782020-08-13 14:33:04 -040020error 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