r224714 - Add test coverage for cc1's trigraph option handling.

Nico Weber nicolasweber at gmx.de
Mon Dec 22 09:56:51 PST 2014


Author: nico
Date: Mon Dec 22 11:56:50 2014
New Revision: 224714

URL: http://llvm.org/viewvc/llvm-project?rev=224714&view=rev
Log:
Add test coverage for cc1's trigraph option handling.

Added:
    cfe/trunk/test/Frontend/trigraphs.cpp

Added: cfe/trunk/test/Frontend/trigraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/trigraphs.cpp?rev=224714&view=auto
==============================================================================
--- cfe/trunk/test/Frontend/trigraphs.cpp (added)
+++ cfe/trunk/test/Frontend/trigraphs.cpp Mon Dec 22 11:56:50 2014
@@ -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
+}





More information about the cfe-commits mailing list