From f8bdb0a9e47fef71d86bc48537d133256ca3d0ad Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 22 Oct 2015 05:21:12 +0000 Subject: [PATCH] [coroutines] Add forgotten test for lexing coroutines keywords. llvm-svn: 250992 --- clang/test/Lexer/coroutines.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 clang/test/Lexer/coroutines.cpp diff --git a/clang/test/Lexer/coroutines.cpp b/clang/test/Lexer/coroutines.cpp new file mode 100644 index 000000000000..86d5f969374d --- /dev/null +++ b/clang/test/Lexer/coroutines.cpp @@ -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);