Skip to content

Commit 366bb54

Browse files
committed
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
1 parent 9757a93 commit 366bb54

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

libcxxabi/test/catch_function_03.pass.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
//===----------------------------------------------------------------------===//
99

1010
// Can a noexcept function pointer be caught by a non-noexcept catch clause?
11-
// UNSUPPORTED: c++98, c++03, c++11, c++14
12-
// UNSUPPORTED: libcxxabi-no-exceptions
11+
// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type
1312

1413
#include <cassert>
1514

16-
#ifdef __cpp_noexcept_function_type
1715
template<bool Noexcept> void f() noexcept(Noexcept) {}
1816
template<bool Noexcept> using FnType = void() noexcept(Noexcept);
1917

@@ -64,6 +62,3 @@ int main()
6462
check<true, true>();
6563
check_deep();
6664
}
67-
#else
68-
int main() {}
69-
#endif

libcxxabi/test/catch_member_function_pointer_02.pass.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99

1010
// Can a noexcept member function pointer be caught by a non-noexcept catch
1111
// clause?
12-
// UNSUPPORTED: c++98, c++03, c++11, c++14
13-
// UNSUPPORTED: libcxxabi-no-exceptions
12+
// UNSUPPORTED: libcxxabi-no-exceptions, libcxxabi-no-noexcept-function-type
1413

1514
#include <cassert>
1615

17-
#ifdef __cpp_noexcept_function_type
1816
struct X {
1917
template<bool Noexcept> void f() noexcept(Noexcept) {}
2018
};
@@ -67,6 +65,3 @@ int main()
6765
check<true, true>();
6866
check_deep();
6967
}
70-
#else
71-
int main() {}
72-
#endif

libcxxabi/test/libcxxabi/test/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,15 @@ def configure_obj_root(self):
3333
self.libcxxabi_obj_root = self.get_lit_conf('libcxxabi_obj_root')
3434
super(Configuration, self).configure_obj_root()
3535

36+
def has_cpp_feature(self, feature, required_value):
37+
return int(self.cxx.dumpMacros().get('__cpp_' + feature, 0)) >= required_value
38+
3639
def configure_features(self):
3740
super(Configuration, self).configure_features()
3841
if not self.get_lit_bool('enable_exceptions', True):
3942
self.config.available_features.add('libcxxabi-no-exceptions')
43+
if not self.has_cpp_feature('noexcept_function_type', 201510):
44+
self.config.available_features.add('libcxxabi-no-noexcept-function-type')
4045

4146
def configure_compile_flags(self):
4247
self.cxx.compile_flags += ['-DLIBCXXABI_NO_TIMER']

0 commit comments

Comments
 (0)