aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-05-30 22:00:57 +0000
committerTom de Vries <vries@gcc.gnu.org>2017-05-30 22:00:57 +0000
commitbcce980ef4e8223685ba4a05f0b9cc8f189aacdf (patch)
tree69296084ab417145e0ef457d806aa9ba7c9cf16b /gcc
parentef9200aa356119b87c4e1b8d995e7d767dace57a (diff)
downloadgcc-bcce980ef4e8223685ba4a05f0b9cc8f189aacdf.zip
gcc-bcce980ef4e8223685ba4a05f0b9cc8f189aacdf.tar.gz
gcc-bcce980ef4e8223685ba4a05f0b9cc8f189aacdf.tar.bz2
Test if host compiler supports -std=c++11 in ms-sysv.exp
2017-05-30 Tom de Vries <tom@codesourcery.com> PR testsuite/80910 * gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp: Exit with status unsupported if host compiler does not support c++11. (host_supports_c++11): New proc. From-SVN: r248701
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp36
2 files changed, 40 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1754a38..1e8c11b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-30 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/80910
+ * gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp: Exit with status
+ unsupported if host compiler does not support c++11.
+ (host_supports_c++11): New proc.
+
2017-05-30 Martin Sebor <msebor@redhat.com>
PR c/80731
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
index e317af9..26777e0 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
+++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
@@ -23,17 +23,47 @@
# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# <http://www.gnu.org/licenses/>.
+load_lib gcc-dg.exp
+
+proc host_supports_c++11 {} {
+ global HOSTCXX HOSTCXXFLAGS
+
+ set pidstr [pid]
+ set src "host_supports_c++11_$pidstr.C"
+ set asm "host_supports_c++11_$pidstr.s"
+
+ set f [open $src "w"]
+ puts $f ""
+ close $f
+
+ set cxx "$HOSTCXX $HOSTCXXFLAGS"
+
+ # Temporarily switch to the environment for the host compiler.
+ restore_ld_library_path_env_vars
+ set status [remote_exec host "$cxx -S $src -std=c++11 -o $asm"]
+ # And switch back.
+ set_ld_library_path_env_vars
+
+ file delete $src $asm
+
+ set status [lindex $status 0]
+ if { $status != 0 } {
+ return 0
+ }
+
+ return 1
+}
+
# Exit immediately if this isn't a native x86_64 target.
if { (![istarget x86_64-*-*] && ![istarget i?86-*-*])
- || ![is-effective-target lp64] || ![isnative] } then {
+ || ![is-effective-target lp64] || ![isnative]
+ || ![host_supports_c++11] } then {
unsupported "$subdir"
return
}
global GCC_RUNTEST_PARALLELIZE_DIR
-load_lib gcc-dg.exp
-
proc runtest_ms_sysv { cflags generator_args } {
global GCC_UNDER_TEST HOSTCXX HOSTCXXFLAGS tmpdir srcdir subdir \
parallel_dir next_test