summaryrefslogtreecommitdiffstats
path: root/test/Frontend/trigraphs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Frontend/trigraphs.cpp')
-rw-r--r--test/Frontend/trigraphs.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Frontend/trigraphs.cpp b/test/Frontend/trigraphs.cpp
new file mode 100644
index 0000000..5520789
--- /dev/null
+++ b/test/Frontend/trigraphs.cpp
@@ -0,0 +1,17 @@
+// 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 -ftrigraphs -std=gnu++11 -verify -fsyntax-only %s
+// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s
+// RUN: %clang_cc1 -DSTDCPP17TRI -ftrigraphs -std=c++1z -verify -fsyntax-only %s
+// RUN: %clang_cc1 -DMSCOMPAT -fms-compatibility -std=c++11 -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) || defined(MSCOMPAT)
+ const char c[] = "??/n"; // expected-warning{{trigraph ignored}}
+#else
+#error Not handled.
+#endif
+}
OpenPOWER on IntegriCloud