[PATCH] Make check_effective_target_c++ work for libstdc++

Jonathan Wakely jwakely@redhat.com
Wed Dec 7 11:24:00 GMT 2016


On 29/07/16 20:43 +0100, Jonathan Wakely wrote:
>I've been working on some changes to let the libstdc++ testsuite use
>the same approach as G++ to specify a minimum language dialect for
>tests. That means instead of hardcoding { dg-options "-std=gnu++11" }
>we can use { dg-do run { target c++11 } } and the test will be run for
>any implicit or explicit -std mode that meets that minimum.
>
>For that to work I need check_effective_target_c++ to return true when
>the dg tool is "libstdc++".
>
>The patch looks a bit messy, because it's fixing some messy
>indentiation.
>
>Tested x86_64-linux.
>
>OK for trunk?
>
>	* lib/target-supports.exp (check_effective_target_c): Fix indentation.
>	(check_effective_target_c++): Likewise. Also match for libstdc++.
>

I'd like to backport this (r238916) to the gcc-6-branch too.

It's been very useful on trunk. The only problems are when we backport
new tests from trunk to the branch and forget that the effective
target doesn't work there (which leads to those new tests being
skipped on the branch as UNSUPPORTED).

Backporting this change to the branch would allow us to backport tests
without having to tweak them.

OK?


>commit 56250fec9250e6864a9d7471ead2b08a77b89952
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date:   Tue Jul 26 15:49:07 2016 +0100
>
>    Make check_effective_target_c++ work for libstdc++
>
>    	* lib/target-supports.exp (check_effective_target_c): Fix indentation.
>    	(check_effective_target_c++): Likewise. Also match for libstdc++.
>
>diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
>index 770268f..9c5194d 100644
>--- a/gcc/testsuite/lib/target-supports.exp
>+++ b/gcc/testsuite/lib/target-supports.exp
>@@ -7001,9 +7001,9 @@ proc check_effective_target_masm_intel  {} {
> # Return 1 if the language for the compiler under test is C.
>
> proc check_effective_target_c { } {
>- global tool
>+    global tool
>     if [string match $tool "gcc"] {
>-   return 1
>+	return 1
>     }
>  return 0
> }
>@@ -7011,9 +7011,9 @@ proc check_effective_target_c { } {
> # Return 1 if the language for the compiler under test is C++.
>
> proc check_effective_target_c++ { } {
>- global tool
>-    if [string match $tool "g++"] {
>-   return 1
>+    global tool
>+    if { [string match $tool "g++"] || [string match $tool "libstdc++"] } {
>+	return 1
>     }
>  return 0
> }



More information about the Libstdc++ mailing list