Add test coverage for cc1's trigraph option handling.

llvm-svn: 224714
This commit is contained in:
Nico Weber 2014-12-22 17:56:50 +00:00
parent c362aedffb
commit 4f371b031b
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// RUN: %clang_cc1 -DSTDCPP11 -std=c++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11 -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11TRI -trigraphs -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17TRI -trigraphs -std=c++1z -verify -fsyntax-only %s
void foo() {
#if defined(NOFLAGS) || defined(STDCPP11) || defined(STDGNU11TRI) || defined(STDCPP17TRI)
const char c[] = "??/n"; // expected-warning{{trigraph converted to '\' character}}
#elif defined(STDGNU11) || defined(STDCPP17)
const char c[] = "??/n"; // expected-warning{{trigraph ignored}}
#else
#error Not handled.
#endif
}