[libcxxabi] r288543 - Check for SD-6 feature test macro when determining which tests should be
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 2 14:14:59 PST 2016
Author: rsmith
Date: Fri Dec 2 16:14:59 2016
New Revision: 288543
URL: http://llvm.org/viewvc/llvm-project?rev=288543&view=rev
Log:
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.
Modified:
libcxxabi/trunk/test/catch_function_03.pass.cpp
libcxxabi/trunk/test/catch_member_function_pointer_02.pass.cpp
libcxxabi/trunk/test/libcxxabi/test/config.py
Modified: libcxxabi/trunk/test/catch_function_03.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_function_03.pass.cpp?rev=288543&r1=288542&r2=288543&view=diff
==============================================================================
--- libcxxabi/trunk/test/catch_function_03.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_function_03.pass.cpp Fri Dec 2 16:14:59 2016
@@ -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 <cassert>
-#ifdef __cpp_noexcept_function_type
template<bool Noexcept> void f() noexcept(Noexcept) {}
template<bool Noexcept> using FnType = void() noexcept(Noexcept);
@@ -64,6 +62,3 @@ int main()
check<true, true>();
check_deep();
}
-#else
-int main() {}
-#endif
Modified: libcxxabi/trunk/test/catch_member_function_pointer_02.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_function_pointer_02.pass.cpp?rev=288543&r1=288542&r2=288543&view=diff
==============================================================================
--- libcxxabi/trunk/test/catch_member_function_pointer_02.pass.cpp (original)
+++ libcxxabi/trunk/test/catch_member_function_pointer_02.pass.cpp Fri Dec 2 16:14:59 2016
@@ -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 <cassert>
-#ifdef __cpp_noexcept_function_type
struct X {
template<bool Noexcept> void f() noexcept(Noexcept) {}
};
@@ -67,6 +65,3 @@ int main()
check<true, true>();
check_deep();
}
-#else
-int main() {}
-#endif
Modified: libcxxabi/trunk/test/libcxxabi/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/libcxxabi/test/config.py?rev=288543&r1=288542&r2=288543&view=diff
==============================================================================
--- libcxxabi/trunk/test/libcxxabi/test/config.py (original)
+++ libcxxabi/trunk/test/libcxxabi/test/config.py Fri Dec 2 16:14:59 2016
@@ -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']
More information about the cfe-commits
mailing list