summaryrefslogtreecommitdiff
path: root/test/Lexer
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-07-23 02:32:21 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-07-23 02:32:21 +0000
commit9ae609fe2b08ad710a0f1f36fd576359f2831ff8 (patch)
treeef45cf33d74cc69fa3af5b98a5d3a5fecc10af6b /test/Lexer
parent122bd494e7e85cc69c463ab1e46854112aa00eab (diff)
Add -fmodules-ts flag to cc1 for the provisional C++ modules TS, and mark
'module' and 'import' as keywords when the flag is specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Lexer')
-rw-r--r--test/Lexer/modules-ts.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Lexer/modules-ts.cpp b/test/Lexer/modules-ts.cpp
new file mode 100644
index 0000000000..06be17c536
--- /dev/null
+++ b/test/Lexer/modules-ts.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -fmodules-ts -DMODULES -fsyntax-only %s
+
+#ifdef MODULES
+#define MODULES_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME)
+#else
+#define MODULES_KEYWORD(NAME) _Static_assert(__is_identifier(NAME), #NAME)
+#endif
+
+MODULES_KEYWORD(import);
+MODULES_KEYWORD(module);