From patchwork Thu Feb 23 17:23:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 142678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AE92FB6EEC for ; Fri, 24 Feb 2012 04:24:04 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1330622646; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Received-SPF:Received:MIME-Version:Received:Received:In-Reply-To: References:Date:Message-ID:Subject:From:To:Cc:Content-Type: Content-Transfer-Encoding:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=rJlKpcUgvJSIbHsHCPQ+llT+Vd8=; b=H/F2dgBJkR4qc0p AHi/m2xE2/3uOpDDBTAIWsO109E3zRZ5wXE++tIiRUNbqblMg/YE/YWKBK+G2DA9 zNhp7EXR2MBPXK+RFzqMD7WqLXT11ZJP3/aZ84vnvF9tNjVTKDqbFFqM7DwrTuXo /irUtDDNOq8PwXFimEETnmm6yQ1Y= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received-SPF:Authentication-Results:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=BczdgXuHL7nbN+y90fqGkPCQpDtXdeaU9pStDx5+satstyfXYupRe9m1+TvDcw h11mv828Totxvx49QPpv7U+EdDL8UomwaWOJ9inLtlULP017Ji6awYiwOMQaYF2L td1Fhmwr8DEtbgFc7SBEWxp65yC2IuctIqQNiJWb/6sLY=; Received: (qmail 7911 invoked by alias); 23 Feb 2012 17:23:58 -0000 Received: (qmail 7902 invoked by uid 22791); 23 Feb 2012 17:23:56 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_DF, TW_FN X-Spam-Check-By: sourceware.org Received: from mail-tul01m020-f175.google.com (HELO mail-tul01m020-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Feb 2012 17:23:40 +0000 Received: by obhx4 with SMTP id x4so1786316obh.20 for ; Thu, 23 Feb 2012 09:23:39 -0800 (PST) Received-SPF: pass (google.com: domain of ktietz70@googlemail.com designates 10.182.14.97 as permitted sender) client-ip=10.182.14.97; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ktietz70@googlemail.com designates 10.182.14.97 as permitted sender) smtp.mail=ktietz70@googlemail.com; dkim=pass header.i=ktietz70@googlemail.com Received: from mr.google.com ([10.182.14.97]) by 10.182.14.97 with SMTP id o1mr832723obc.57.1330017819776 (num_hops = 1); Thu, 23 Feb 2012 09:23:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.14.97 with SMTP id o1mr731757obc.57.1330017819671; Thu, 23 Feb 2012 09:23:39 -0800 (PST) Received: by 10.182.33.103 with HTTP; Thu, 23 Feb 2012 09:23:39 -0800 (PST) In-Reply-To: References: <20120223170602.GT18768@tyan-ft48-01.lab.bos.redhat.com> Date: Thu, 23 Feb 2012 18:23:39 +0100 Message-ID: Subject: Re: [patch testsuite]: Adjust some tests of gcc.dg and gcc.c-torture for mingw targets From: Kai Tietz To: Jakub Jelinek Cc: GCC Patches X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2012/2/23 Kai Tietz : > 2012/2/23 Jakub Jelinek : >> Why?  I don't see extensions anywhere.  Or is __SIZE_TYPE__ on mingw >> long long and requires __extension__?  If yes, it should at least go >> right before the argument, but perhaps then it should be already >> in the __SIZE_TYPE__ macro. > > The issue is that for LLP64 target __SIZE_TYPE__ is 'unsigned long long'. And the underlying issue is that __extension__ can't be use before __SIZE_TYPE__ here. gcc lacks to parse that proper. You would get opt-11.c:6:35: error: expected declaration specifiers or '...' before '__extension__' opt-11.c: In function 'main': opt-11.c:28:3: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default] So here is the updated version. ChangeLog 2012-02-23 Kai Tietz * gcc.dg/pack-test-5.c: Add -mno-ms-bitfields option for mingw-targets. * gcc.dg/Wpadded.c: Likewise. * gcc.dg/bf-ms-layout-2.c: Adjust offsets to fit ms-bitfield structure-layout. * gcc.dg/di-sync-multithread.c: Replace for mingw-target the use for sleep by Sleep and add windows.h include for this function. * gcc.dg/format/dfp-printf-1.c: Adjust dg-skip-if rule for mingw targets. * gcc.dg/stack-usage-1.c (SIZE): Provide proper SIZE for x64 mingw target. * gcc.dg/tls/thr-cse-1.c: Provide proper pattern for x64 mingw target. * gcc.dg/tls/opt-11.c (memset): Use __extension__ to avoid fail on x64 mingw target. * gcc.dg/bf-ms-attrib.c: Adjust expected size for ms_struct layout. * gcc.dg/pr50251.c: Disable test for x64 mingw target. * gcc.c-torture/execute/930930-1.c (long): Replace by ptr_t to avoid failure on LLP64 target. Tested for i686-w64-mingw32, x86_64-w64-mingw32, and x86_64-unknown-linux-gnu. Ok for apply? Regards, Kai Index: gcc.dg/pack-test-5.c =================================================================== --- gcc.dg/pack-test-5.c (revision 184486) +++ gcc.dg/pack-test-5.c (working copy) @@ -1,6 +1,7 @@ /* PR c/11446: packed on a struct takes precedence over aligned on the type of a field. */ /* { dg-do run } */ +/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */ extern void abort (void); Index: gcc.dg/bf-ms-layout-2.c =================================================================== --- gcc.dg/bf-ms-layout-2.c (revision 184503) +++ gcc.dg/bf-ms-layout-2.c (working copy) @@ -158,27 +158,27 @@ struct ten test_ten; #if defined (_TEST_MS_LAYOUT) || defined (_MSC_VER) - size_t exp_sizeof_one = 12; - size_t exp_sizeof_two = 16; + size_t exp_sizeof_one = 8; + size_t exp_sizeof_two = 12; size_t exp_sizeof_three =6; size_t exp_sizeof_four = 8; size_t exp_sizeof_five = 3; size_t exp_sizeof_six = 8; size_t exp_sizeof_seven = 3; - size_t exp_sizeof_eight = 4; + size_t exp_sizeof_eight = 2; size_t exp_sizeof_nine = 8; - size_t exp_sizeof_ten = 16; + size_t exp_sizeof_ten = 8; - unsigned char exp_one_c = 8; - unsigned char exp_two_c = 12; + unsigned char exp_one_c = 7; + unsigned char exp_two_c = 9; unsigned char exp_three_c = 4; unsigned char exp_four_c = 4; char exp_five_c = 2; char exp_six_c = 5; char exp_seven_c = 2; - char exp_eight_c = 2; + char exp_eight_c = 1; char exp_nine_c = 0; - char exp_ten_c = 8; + char exp_ten_c = 1; #else /* testing -mno-ms-bitfields */ Index: gcc.dg/di-sync-multithread.c =================================================================== --- gcc.dg/di-sync-multithread.c (revision 184486) +++ gcc.dg/di-sync-multithread.c (working copy) @@ -10,6 +10,9 @@ #include #include +#ifdef _WIN32 +#include +#endif /*#define DEBUGIT 1 */ @@ -175,7 +178,11 @@ t, err); }; +#ifdef _WIN32 + Sleep (5000); +#else sleep (5); +#endif /* Stop please. */ __sync_lock_test_and_set (&doquit, 1ll); Index: gcc.dg/format/dfp-printf-1.c =================================================================== --- gcc.dg/format/dfp-printf-1.c (revision 184486) +++ gcc.dg/format/dfp-printf-1.c (working copy) @@ -3,7 +3,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target dfp } */ /* { dg-options "-Wformat" } */ -/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } } */ +/* { dg-skip-if "No scanf/printf dfp support" { *-*-mingw* } { "*" } { "" } } */ extern int printf (const char *restrict, ...); Index: gcc.dg/Wpadded.c =================================================================== --- gcc.dg/Wpadded.c (revision 184486) +++ gcc.dg/Wpadded.c (working copy) @@ -5,7 +5,8 @@ packing to be larger than 1, which cannot be guaranteed for all targets. We won't get a warning anyway if the target has "packed" structure layout. */ -/* { dg-options "-Wpadded -fpack-struct=8" } */ +/* { dg-additional-options "-Wpadded -fpack-struct=8" } */ +/* { dg-additional-options "-mno-ms-bitfields" { target *-*-mingw* } } */ struct foo { char bar; Index: gcc.dg/stack-usage-1.c =================================================================== --- gcc.dg/stack-usage-1.c (revision 184486) +++ gcc.dg/stack-usage-1.c (working copy) @@ -10,7 +10,11 @@ #if defined(__i386__) # define SIZE 248 #elif defined(__x86_64__) -# define SIZE 356 +# ifndef _WIN64 +# define SIZE 356 +# else +# define SIZE (256 - 24) +# endif #elif defined (__sparc__) # if defined (__arch64__) # define SIZE 76 Index: gcc.dg/pr49544.c =================================================================== --- gcc.dg/pr49544.c (revision 184486) +++ gcc.dg/pr49544.c (working copy) @@ -3,6 +3,8 @@ /* { dg-options "-g -O2" } */ /* { dg-require-effective-target ptr32plus } */ +__extension__ typedef __PTRDIFF_TYPE__ ptr_t; + int baz (int, int, void *); static inline __attribute__ ((always_inline)) long @@ -16,5 +18,5 @@ long bar (long x, long y, long z) { - return foo (x, y, (void *) z); + return foo (x, y, (void *) (ptr_t) z); } Index: gcc.dg/tls/thr-cse-1.c =================================================================== --- gcc.dg/tls/thr-cse-1.c (revision 184486) +++ gcc.dg/tls/thr-cse-1.c (working copy) @@ -18,10 +18,11 @@ return a; } -/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks" "*-*-darwin8" "hppa*-*-hpux*" "spu-*-*" "i?86-*-mingw*" } } } } } */ +/* { dg-final { scan-assembler-not "emutls_get_address.*emutls_get_address.*" { target { ! { "*-wrs-vxworks" "*-*-darwin8" "hppa*-*-hpux*" "spu-*-*" "i?86-*-mingw*" "x86_64-*-mingw*" } } } } } */ /* { dg-final { scan-assembler-not "call\tL___emutls_get_address.stub.*call\tL___emutls_get_address.stub.*" { target "*-*-darwin8" } } } */ /* { dg-final { scan-assembler-not "(b,l|bl) __emutls_get_address.*(b,l|bl) __emutls_get_address.*" { target "hppa*-*-hpux*" } } } */ /* { dg-final { scan-assembler-not "(brsl|brasl)\t__emutls_get_address.*(brsl|brasl)\t__emutls_get_address.*" { target spu-*-* } } } */ /* { dg-final { scan-assembler-not "tls_lookup.*tls_lookup.*" { target *-wrs-vxworks } } } */ /* { dg-final { scan-assembler-not "call\t___emutls_get_address.*call\t___emutls_get_address" { target "i?86-*-mingw*" } } } */ +/* { dg-final { scan-assembler-not "call\t__emutls_get_address.*call\t__emutls_get_address" { target "x86_64-*-mingw*" } } } */ Index: gcc.dg/tls/opt-11.c =================================================================== --- gcc.dg/tls/opt-11.c (revision 184486) +++ gcc.dg/tls/opt-11.c (working copy) @@ -3,7 +3,7 @@ /* { dg-add-options tls } */ extern void abort (void); -extern void *memset (void *, int, __SIZE_TYPE__); +__extension__ extern void *memset (void *, int, __SIZE_TYPE__); struct A { Index: gcc.dg/bf-ms-attrib.c =================================================================== --- gcc.dg/bf-ms-attrib.c (revision 184486) +++ gcc.dg/bf-ms-attrib.c (working copy) @@ -32,7 +32,7 @@ /* As long as the sizes are as expected, we know attributes are working. bf-ms-layout.c makes sure the right thing happens when the attribute is on. */ - if (sizeof(struct one_ms) != 12) + if (sizeof(struct one_ms) != 8) abort(); if (sizeof(struct one_gcc) != 8) abort(); Index: gcc.dg/pr50251.c =================================================================== --- gcc.dg/pr50251.c (revision 184486) +++ gcc.dg/pr50251.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { ! { x86_64-*-mingw* } } } } */ /* { dg-options "-O2" } */ /* { dg-additional-options "-mpreferred-stack-boundary=12" { target x86_64-*-* } } */ Index: gcc.c-torture/execute/930930-1.c =================================================================== --- gcc.c-torture/execute/930930-1.c (revision 184486) +++ gcc.c-torture/execute/930930-1.c (working copy) @@ -1,23 +1,24 @@ -long *wm_TR; -long *wm_HB; -long *wm_SPB; +__extension__ typedef __PTRDIFF_TYPE__ ptr_t; +ptr_t *wm_TR; +ptr_t *wm_HB; +ptr_t *wm_SPB; -long mem[100]; +ptr_t mem[100]; f (mr_TR, mr_SPB, mr_HB, reg1, reg2) - long *mr_TR; - long *mr_SPB; - long *mr_HB; - long *reg1; - long *reg2; + ptr_t *mr_TR; + ptr_t *mr_SPB; + ptr_t *mr_HB; + ptr_t *reg1; + ptr_t *reg2; { - long *x = mr_TR; + ptr_t *x = mr_TR; for (;;) { if (reg1 < reg2) goto out; - if ((long *) *reg1 < mr_HB && (long *) *reg1 >= mr_SPB) + if ((ptr_t *) *reg1 < mr_HB && (ptr_t *) *reg1 >= mr_SPB) *--mr_TR = *reg1; reg1--; } @@ -29,7 +30,7 @@ main () { - mem[99] = (long) mem; + mem[99] = (ptr_t) mem; f (mem + 100, mem + 6, mem + 8, mem + 99, mem + 99); exit (0); }