From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32112 invoked by alias); 19 May 2017 06:29:26 -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 32001 invoked by uid 89); 19 May 2017 06:29:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=cleaner X-HELO: sasl.smtp.pobox.com Received: from pb-smtp1.pobox.com (HELO sasl.smtp.pobox.com) (64.147.108.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 06:29:24 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 08481771CA; Fri, 19 May 2017 02:29:26 -0400 (EDT) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id F3156771C9; Fri, 19 May 2017 02:29:25 -0400 (EDT) Received: from localhost.localdomain (unknown [76.215.41.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 26762771C4; Fri, 19 May 2017 02:29:24 -0400 (EDT) From: Daniel Santos To: Mike Stump , gcc-patches Cc: Rainer Orth , Bernd Edlinger Subject: [PATCH 2/2] [testsuite] PR 80759 Remove gas extensions from do-test.S, fix other problems Date: Fri, 19 May 2017 06:50:00 -0000 Message-Id: <20170519063418.7836-2-daniel.santos@pobox.com> In-Reply-To: <3c867dc8-7d4a-ae82-c875-d03ff6d88776@pobox.com> References: <3c867dc8-7d4a-ae82-c875-d03ff6d88776@pobox.com> X-Pobox-Relay-ID: 80D6E834-3C5C-11E7-878A-EFB41968708C-06139138!pb-smtp1.pobox.com X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01516.txt.bz2 Use of .struct in do_test.S causes breakages when gas isn't the assembler (e.g., Solaris). I also wasn't including TEST_ALWAYS_FLAGS in my CFLAGS resulting in super-ugly log files. Finally, this patch eliminates spam of "test unsupported" (limiting it to one printing). Signed-off-by: Daniel Santos --- .../gcc.target/x86_64/abi/ms-sysv/do-test.S | 26 +++++----------------- .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.c | 7 ++++++ .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp | 24 ++++++++++++-------- 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S index 1395235fd1e..967eb959fbc 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S @@ -46,22 +46,6 @@ fn: # define MOVAPS movaps # endif -/* TODO: Is there a cleaner way to provide these offsets? */ - .struct 0 -test_data_save: - - .struct test_data_save + 224 -test_data_input: - - .struct test_data_save + 448 -test_data_output: - - .struct test_data_save + 672 -test_data_fn: - - .struct test_data_save + 680 -test_data_retaddr: - .text regs_to_mem: @@ -132,23 +116,23 @@ L0: call regs_to_mem # Load register with random data - lea test_data + test_data_input(%rip), %rax + lea test_data + 224(%rip), %rax call mem_to_regs # Save original return address pop %rax - movq %rax, test_data + test_data_retaddr(%rip) + movq %rax, test_data + 680(%rip) # Call the test function - call *test_data + test_data_fn(%rip) + call *test_data + 672(%rip) # Restore the original return address - movq test_data + test_data_retaddr(%rip), %rcx + movq test_data + 680(%rip), %rcx push %rcx # Save test function return value and store resulting register values push %rax - lea test_data + test_data_output(%rip), %rax + lea test_data + 448(%rip), %rax call regs_to_mem # Restore registers diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c index 2a011f5103d..7cec312c386 100644 --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c @@ -346,6 +346,13 @@ int main (int argc, char *argv[]) assert (!((long)&test_data.regdata[REG_SET_INPUT] & 15)); assert (!((long)&test_data.regdata[REG_SET_OUTPUT] & 15)); + /* Verify offsets hard-coded into assembly. */ + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_SAVE]) == 0); + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_INPUT]) == 224); + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_OUTPUT]) == 448); + assert (__builtin_offsetof (struct test_data, fn) == 672); + assert (__builtin_offsetof (struct test_data, retaddr) == 680); + while ((c = getopt (argc, argv, "s:f")) != -1) { switch (c) 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 77c40dbf349..a9571f194b1 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,18 +23,12 @@ # see the files COPYING3 and COPYING.RUNTIME respectively. If not, see # . -# Exit immediately if this isn't a native x86_64 target. -if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) - || ![is-effective-target lp64] || ![isnative] } then { - unsupported "$subdir" - return -} - load_lib gcc-dg.exp load_lib parallelize.exp proc runtest_ms_sysv { cflags generator_args } { - global GCC_UNDER_TEST HOSTCXX HOSTCXXFLAGS tmpdir srcdir subdir + global GCC_UNDER_TEST HOSTCXX HOSTCXXFLAGS tmpdir srcdir subdir \ + TEST_ALWAYS_FLAGS set objdir "$tmpdir/ms-sysv" set generator "$tmpdir/ms-sysv-generate.exe" @@ -93,7 +87,7 @@ proc runtest_ms_sysv { cflags generator_args } { } } - set cc "$GCC_UNDER_TEST -I$objdir -I$srcdir/$subdir $cflags $warn_flags" + set cc "$GCC_UNDER_TEST -I$objdir -I$srcdir/$subdir $TEST_ALWAYS_FLAGS $cflags $warn_flags" # Assemble do-test.S set src "$srcdir/$subdir/do-test.S" @@ -142,6 +136,18 @@ if { [parallel-init "ms2sysv"] != 0 } then { return; } +# Exit if this isn't a native x86_64 target. +if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) + || ![is-effective-target lp64] || ![isnative] } then { + + # The first call to parallel-should-run-test is used so we only print the + # "unsupported" message once. + if { [parallel-should-run-test] == 0 } { + unsupported "$subdir" + } + return +} + set gen_opts "-p0-5" set all_options [list "-O2" "-O0 -g3"] -- 2.11.0