libstdc++: Refactor dejagnu effective-target checks
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Nov 2020 00:21:52 +0000 (00:21 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 27 Nov 2020 15:50:49 +0000 (15:50 +0000)
commite8f83fa4fcf4f7e97046ef6b521b78dcd25c95b7
tree365888cfade8a9ffed0a123e9d0efb7bbc0f5a7c
parent9df6c9c7a3936ff0a38a7066281842128cdd6914
libstdc++: Refactor dejagnu effective-target checks

This introduces two new procs to replace boilerplate in the
effective-target checks.

libstdc++-v3/ChangeLog:

* testsuite/lib/libstdc++.exp (v3_try_preprocess): Define
new proc to preprocess a chunk of code.
(v3_check_preprocessor_condition): Define new proc to test
a preprocessor condition depending on GCC or libstdc++ macros.
(check_v3_target_debug_mode, check_v3_target_normal_mode):
Use v3_try_preprocess.
(check_v3_target_normal_namespace)
(check_v3_target_parallel_mode, check_v3_target_cstdint)
(check_v3_target_cmath, check_v3_target_atomic_builtins)
(check_v3_target_gthreads, check_v3_target_gthreads_timed)
(check_v3_target_sleep, check_v3_target_sched_yield)
(check_v3_target_string_conversions, check_v3_target_swprintf)
(check_v3_target_binary_io, check_v3_target_nprocs): Use
v3_check_preprocessor_condition.
(check_effective_target_cxx11): Likewise.
(check_effective_target_random_device): Likewise.
(check_effective_target_tbb-backend): Likewise.
(check_effective_target_futex): Likewise.
(check_v3_target_little_endian) Call check_effective_target_le.
(check_effective_target_atomic-builtins): New proc to define
new effective-target keyword.
(check_effective_target_gthreads-timed): Likewise.
libstdc++-v3/testsuite/lib/libstdc++.exp