From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57979 invoked by alias); 30 May 2017 22:04:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 57964 invoked by uid 89); 30 May 2017 22:04:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 May 2017 22:04:56 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1dFpG6-0000Eu-0A from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Tue, 30 May 2017 15:04:58 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 30 May 2017 23:04:54 +0100 To: GCC Patches From: Tom de Vries Subject: [testsuite, committed] Test if host compiler supports -std=c++11 in ms-sysv.exp Message-ID: <48432957-1126-012e-fef4-fc42bb64a053@mentor.com> Date: Tue, 30 May 2017 22:20:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------51343512E02C5D40C43DE4E1" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-SW-Source: 2017-05/txt/msg02295.txt.bz2 --------------51343512E02C5D40C43DE4E1 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 161 Hi, this patch adds a test to see if the host compiler supports -std=c++11 in ms-sysv.exp, and if not marks ms-sysv as unsupported. Committed. Thanks, - Tom --------------51343512E02C5D40C43DE4E1 Content-Type: text/x-patch; name="0001-Test-if-host-compiler-supports-std-c-11-in-ms-sysv.exp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-Test-if-host-compiler-supports-std-c-11-in-ms-sysv.exp."; filename*1="patch" Content-length: 2014 Test if host compiler supports -std=c++11 in ms-sysv.exp 2017-05-30 Tom de Vries 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. --- .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) 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 # . +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 --------------51343512E02C5D40C43DE4E1--