diff options
Diffstat (limited to 'test/Lexer')
-rw-r--r-- | test/Lexer/cxx-features.cpp | 8 | ||||
-rw-r--r-- | test/Lexer/cxx2a_keyword_as_cxx17.cpp | 4 | ||||
-rw-r--r-- | test/Lexer/eof-include.c | 4 | ||||
-rw-r--r-- | test/Lexer/half-literal.cpp | 2 | ||||
-rw-r--r-- | test/Lexer/has_feature_efficiency_sanitizer.cpp | 12 | ||||
-rw-r--r-- | test/Lexer/keywords_test.c | 12 | ||||
-rw-r--r-- | test/Lexer/keywords_test.cpp | 9 |
7 files changed, 29 insertions, 22 deletions
diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp index 09b82b7c47..75d6e0aa14 100644 --- a/test/Lexer/cxx-features.cpp +++ b/test/Lexer/cxx-features.cpp @@ -6,9 +6,9 @@ // // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -frelaxed-template-template-args -DRELAXED_TEMPLATE_TEMPLATE_ARGS=1 -verify %s // RUN: %clang_cc1 -std=c++17 -fcxx-exceptions -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s -// RUN: %clang_cc1 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation -// RUN: %clang_cc1 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s -// RUN: %clang_cc1 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s +// RUN: %clang_cc1 -std=c++14 -fno-rtti -fno-threadsafe-statics -verify %s -DNO_EXCEPTIONS -DNO_RTTI -DNO_THREADSAFE_STATICS -fsized-deallocation +// RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -DNO_EXCEPTIONS -DCOROUTINES -verify -fsized-deallocation %s +// RUN: %clang_cc1 -std=c++14 -fchar8_t -DNO_EXCEPTIONS -DCHAR8_T -verify -fsized-deallocation %s // RUN: %clang_cc1 -std=c++2a -fno-char8_t -DNO_EXCEPTIONS -DNO_CHAR8_T -verify -fsized-deallocation %s // expected-no-diagnostics @@ -271,6 +271,6 @@ #error "wrong value for __cpp_experimental_concepts" #endif -#if defined(COROUTINES) ? check(coroutines, 201703L, 201703L, 201703L, 201703L, 201703L) : check(coroutines, 0, 0, 0, 0, 0) +#if defined(COROUTINES) ? check(coroutines, 201703L, 201703L, 201703L, 201703L, 201703L) : check(coroutines, 0, 0, 0, 0, 201703L) #error "wrong value for __cpp_coroutines" #endif diff --git a/test/Lexer/cxx2a_keyword_as_cxx17.cpp b/test/Lexer/cxx2a_keyword_as_cxx17.cpp index c6a821be0e..d2ed7d3380 100644 --- a/test/Lexer/cxx2a_keyword_as_cxx17.cpp +++ b/test/Lexer/cxx2a_keyword_as_cxx17.cpp @@ -5,5 +5,9 @@ template<typename T> concept x = 0; #undef concept +int co_await = 0; // expected-warning {{'co_await' is a keyword in C++2a}} +int co_return = 0; // expected-warning {{'co_return' is a keyword in C++2a}} +int co_yield = 0; // expected-warning {{'co_yield' is a keyword in C++2a}} +int char8_t = 0; // expected-warning {{'char8_t' is a keyword in C++2a}} int concept = 0; // expected-warning {{'concept' is a keyword in C++2a}} int requires = 0; // expected-warning {{'requires' is a keyword in C++2a}} diff --git a/test/Lexer/eof-include.c b/test/Lexer/eof-include.c index 6e53788718..ba791d574b 100644 --- a/test/Lexer/eof-include.c +++ b/test/Lexer/eof-include.c @@ -4,5 +4,5 @@ // This file intentionally ends without a \n on the last line. Make sure your // editor doesn't add one. -// expected-error@+1{{expected "FILENAME" or <FILENAME>}} -#include <\
\ No newline at end of file +// expected-error@+1{{expected '>'}} expected-note@+1{{to match this '<'}} +#include <\ diff --git a/test/Lexer/half-literal.cpp b/test/Lexer/half-literal.cpp index 8e0034d491..43d0b92872 100644 --- a/test/Lexer/half-literal.cpp +++ b/test/Lexer/half-literal.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s +// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify -pedantic -triple aarch64-linux-gnu %s float a = 1.0h; // expected-error{{no matching literal operator for call to 'operator""h' with argument of type 'long double' or 'const char *', and no matching literal operator template}} float b = 1.0H; // expected-error{{invalid suffix 'H' on floating constant}} diff --git a/test/Lexer/has_feature_efficiency_sanitizer.cpp b/test/Lexer/has_feature_efficiency_sanitizer.cpp deleted file mode 100644 index ef9e273602..0000000000 --- a/test/Lexer/has_feature_efficiency_sanitizer.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// RUN: %clang_cc1 -E -fsanitize=efficiency-cache-frag %s -o - | FileCheck --check-prefix=CHECK-ESAN %s -// RUN: %clang_cc1 -E -fsanitize=efficiency-working-set %s -o - | FileCheck --check-prefix=CHECK-ESAN %s -// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-ESAN %s - -#if __has_feature(efficiency_sanitizer) -int EfficiencySanitizerEnabled(); -#else -int EfficiencySanitizerDisabled(); -#endif - -// CHECK-ESAN: EfficiencySanitizerEnabled -// CHECK-NO-ESAN: EfficiencySanitizerDisabled diff --git a/test/Lexer/keywords_test.c b/test/Lexer/keywords_test.c index 7f840c1154..16778143f0 100644 --- a/test/Lexer/keywords_test.c +++ b/test/Lexer/keywords_test.c @@ -7,7 +7,7 @@ // RUN: %clang_cc1 -std=gnu89 -fno-gnu-keywords -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-NONE %s -// RUN: %clang_cc1 -std=c99 -fms-extensions -E %s -o - \ +// RUN: %clang_cc1 -std=c99 -fms-extensions -fms-compatibility -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-MS-KEYWORDS %s // RUN: %clang_cc1 -std=c99 -fdeclspec -E %s -o - \ // RUN: | FileCheck --check-prefix=CHECK-DECLSPEC-KEYWORD %s @@ -42,3 +42,13 @@ void no_declspec(); #else void has_declspec(); #endif + +// CHECK-NONE: no_static_assert +// CHECK-GNU-KEYWORDS: no_static_assert +// CHECK-MS-KEYWORDS: has_static_assert +// CHECK-MS-KEYWORDS-WITHOUT-DECLSPEC: no_static_assert +#if __is_identifier(static_assert) +void no_static_assert(); +#else +void has_static_assert(); +#endif diff --git a/test/Lexer/keywords_test.cpp b/test/Lexer/keywords_test.cpp index e7edf96d93..4c6ccca3f7 100644 --- a/test/Lexer/keywords_test.cpp +++ b/test/Lexer/keywords_test.cpp @@ -11,9 +11,9 @@ // RUN: %clang_cc1 -std=c++03 -fdeclspec -fno-declspec -fsyntax-only %s // RUN: %clang_cc1 -std=c++03 -fms-extensions -fno-declspec -fdeclspec -DDECLSPEC -fsyntax-only %s // RUN: %clang_cc1 -std=c++03 -fms-extensions -fdeclspec -fno-declspec -fsyntax-only %s -// RUN: %clang -std=c++03 -target i686-windows-msvc -DDECLSPEC -fsyntax-only %s +// RUN: %clang -std=c++03 -target i686-windows-msvc -DMS -DDECLSPEC -fsyntax-only %s // RUN: %clang -std=c++03 -target x86_64-scei-ps4 -DDECLSPEC -fsyntax-only %s -// RUN: %clang -std=c++03 -target i686-windows-msvc -fno-declspec -fsyntax-only %s +// RUN: %clang -std=c++03 -target i686-windows-msvc -DMS -fno-declspec -fsyntax-only %s // RUN: %clang -std=c++03 -target x86_64-scei-ps4 -fno-declspec -fsyntax-only %s #define IS_KEYWORD(NAME) _Static_assert(!__is_identifier(NAME), #NAME) @@ -51,7 +51,12 @@ CXX11_KEYWORD(char32_t); CXX11_TYPE(char32_t); CXX11_KEYWORD(constexpr); CXX11_KEYWORD(noexcept); +#ifndef MS CXX11_KEYWORD(static_assert); +#else +// MS compiler recognizes static_assert in all modes. So should we. +IS_KEYWORD(static_assert); +#endif CXX11_KEYWORD(thread_local); // Concepts TS keywords |