]> granicus.if.org Git - clang/commitdiff
[coroutines] Add forgotten test for lexing coroutines keywords.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 22 Oct 2015 05:21:12 +0000 (05:21 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 22 Oct 2015 05:21:12 +0000 (05:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250992 91177308-0d34-0410-b5e6-96231b3b80d8

test/Lexer/coroutines.cpp [new file with mode: 0644]

diff --git a/test/Lexer/coroutines.cpp b/test/Lexer/coroutines.cpp
new file mode 100644 (file)
index 0000000..86d5f96
--- /dev/null
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -fcoroutines -DCORO -fsyntax-only %s
+
+#ifdef CORO
+#define CORO_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME)
+#else
+#define CORO_KEYWORD(NAME) _Static_assert(__is_identifier(NAME), #NAME)
+#endif
+
+CORO_KEYWORD(co_await);
+CORO_KEYWORD(co_return);
+CORO_KEYWORD(co_yield);