]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add effective-target 'hosted' for testsuite [PR103626]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 30 Sep 2022 14:58:31 +0000 (16:58 +0200)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 3 Oct 2022 14:43:49 +0000 (15:43 +0100)
PR libstdc++/103626 - _GLIBCXX_HOSTED should respect -ffreestanding

libstdc++-v3/ChangeLog:

PR libstdc++/103626
* testsuite/lib/libstdc++.exp (check_effective_target_stacktrace):
Also require hosted.
(check_effective_target_hosted): New proc.

libstdc++-v3/testsuite/lib/libstdc++.exp

index d3256b6c8c415986d2600a100effd8f049ab869b..635f16db4e8887163198fd5e45361d9280a294f4 100644 (file)
@@ -1376,7 +1376,7 @@ proc check_effective_target_std_allocator_new { } {
 # Return 1 if libstdc++ was built as --enable-libstdcxx-backtrace
 proc check_effective_target_stacktrace { } {
     return [check_v3_target_prop_cached et_stacktrace {
-       set cond "_GLIBCXX_HAVE_STACKTRACE"
+       set cond "_GLIBCXX_HAVE_STACKTRACE && _GLIBCXX_HOSTED"
        return [v3_check_preprocessor_condition stacktrace $cond]
     }]
 }
@@ -1389,6 +1389,14 @@ proc check_effective_target_rtti { } {
     }]
 }
 
+# Return 1 if a hosted implementation is available (i.e. not freestanding).
+proc check_effective_target_hosted { } {
+    return [check_v3_target_prop_cached et_hosted {
+       set cond "_GLIBCXX_HOSTED"
+       return [v3_check_preprocessor_condition hosted $cond]
+    }]
+}
+
 set additional_prunes ""
 
 if { [info exists env(GCC_RUNTEST_PARALLELIZE_DIR)] \