From: Richard Smith Date: Fri, 2 Dec 2016 22:14:59 +0000 (+0000) Subject: Check for SD-6 feature test macro when determining which tests should be X-Git-Tag: llvmorg-4.0.0-rc1~3120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=366bb54f8138cb82803df75f18cfc8943f5e1b75;p=platform%2Fupstream%2Fllvm.git Check for SD-6 feature test macro when determining which tests should be available, rather than #ifdef'ing away the relevant tests if it's unavailable. llvm-svn: 288543 --- diff --git a/libcxxabi/test/catch_function_03.pass.cpp b/libcxxabi/test/catch_function_03.pass.cpp index c366638..bf817a9 100644 --- a/libcxxabi/test/catch_function_03.pass.cpp +++ b/libcxxabi/test/catch_function_03.pass.cpp @@ -8,12 +8,10 @@ //===----------------------------------------------------------------------===// // Can a noexcept function pointer be caught by a non-noexcept catch clause? -// UNSUPPORTED: c++98, c++03, c++11, c++14 -// UNSUPPORTED: libcxxabi-no-exceptions +// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type #include -#ifdef __cpp_noexcept_function_type template void f() noexcept(Noexcept) {} template using FnType = void() noexcept(Noexcept); @@ -64,6 +62,3 @@ int main() check(); check_deep(); } -#else -int main() {} -#endif diff --git a/libcxxabi/test/catch_member_function_pointer_02.pass.cpp b/libcxxabi/test/catch_member_function_pointer_02.pass.cpp index 71df051..5ce2359 100644 --- a/libcxxabi/test/catch_member_function_pointer_02.pass.cpp +++ b/libcxxabi/test/catch_member_function_pointer_02.pass.cpp @@ -9,12 +9,10 @@ // Can a noexcept member function pointer be caught by a non-noexcept catch // clause? -// UNSUPPORTED: c++98, c++03, c++11, c++14 -// UNSUPPORTED: libcxxabi-no-exceptions +// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type #include -#ifdef __cpp_noexcept_function_type struct X { template void f() noexcept(Noexcept) {} }; @@ -67,6 +65,3 @@ int main() check(); check_deep(); } -#else -int main() {} -#endif diff --git a/libcxxabi/test/libcxxabi/test/config.py b/libcxxabi/test/libcxxabi/test/config.py index 3d5a235..5349338 100644 --- a/libcxxabi/test/libcxxabi/test/config.py +++ b/libcxxabi/test/libcxxabi/test/config.py @@ -33,10 +33,15 @@ class Configuration(LibcxxConfiguration): self.libcxxabi_obj_root = self.get_lit_conf('libcxxabi_obj_root') super(Configuration, self).configure_obj_root() + def has_cpp_feature(self, feature, required_value): + return int(self.cxx.dumpMacros().get('__cpp_' + feature, 0)) >= required_value + def configure_features(self): super(Configuration, self).configure_features() if not self.get_lit_bool('enable_exceptions', True): self.config.available_features.add('libcxxabi-no-exceptions') + if not self.has_cpp_feature('noexcept_function_type', 201510): + self.config.available_features.add('libcxxabi-no-noexcept-function-type') def configure_compile_flags(self): self.cxx.compile_flags += ['-DLIBCXXABI_NO_TIMER']