From patchwork Wed Aug 13 22:11:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 379765 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4490914008C for ; Thu, 14 Aug 2014 08:12:06 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:subject; q=dns; s=default; b=XstgIWhF0JpMSaC zQebjhne4ldj9rYH+ou52fAqSK0rsJiDT1Z5kKq7PCGlxNR14DKRLS0R3PR4ivkh ej0JR6ifTtqoyJzFTocfnpi6zMeC4Mf8pqSc5kVesZo3lfdHpUdc3yrNObkZG5kd nRVV3Ld9Zom7vFDPTw1S6Aa4sooA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:subject; s=default; bh=SPhCMKfDr7B7ZtYPnkrrj fiLWe4=; b=xHuzOI9JvSA8JXFHNXWndd/R7eDN61g9jy4Yre9NOokqqPSrv41Xe hOx7WzWCbfnTmq5tpCGFFqu+xkbszGdnZVQkQ5930WDs+hXQYKrHY/PJ4QiBbBRa mgXR7CbFHCs0KE9/A5ZMszAcq0/gF3iR3Tk40DJEKy/DSX6M+KvYy4= Received: (qmail 8842 invoked by alias); 13 Aug 2014 22:11:39 -0000 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 Received: (qmail 8760 invoked by uid 89); 13 Aug 2014 22:11:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 13 Aug 2014 22:11:36 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7DMBYT7026318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 13 Aug 2014 18:11:34 -0400 Received: from greed.delorie.com (ovpn-113-70.phx2.redhat.com [10.3.113.70]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7DMBXTR018994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 13 Aug 2014 18:11:34 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id s7DMBXmY016395 for ; Wed, 13 Aug 2014 18:11:33 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id s7DMBXb7016394; Wed, 13 Aug 2014 18:11:33 -0400 Date: Wed, 13 Aug 2014 18:11:33 -0400 Message-Id: <201408132211.s7DMBXb7016394@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: __intN patch 4/5: testsuite updates X-IsSubscribed: yes Changes to the testsuite to make tests more portable to targets with unusual address spaces. * testsuite/ * lib/target-supports.exp (check_effective_target_size32plus): Increase size to avoid false positives on 24-bit address spaces. * gcc.c-torture/compile/limits-stringlit.c: Skip if msp430. * gcc.dg/lto/pr54709_1.c: Fix memcpy prototype. * gcc.dg/torture/pta-ptrarith-3.c: Use __SIZE_TYPE__ instead of "int". * gcc.dg/torture/pr36373-10.c: Use __SIZE_TYPE__ if present. * gcc.dg/torture/pr57864.c: Use __SIZE_TYPE__. * gcc.dg/torture/pr26763-2.c: Use __SIZE_TYPE__ instead of "int". * gcc.dg/tree-ssa/isolate-3.c: Use __SIZE_TYPE__ instead of "long unsigned int". * gcc.dg/tree-ssa/isolate-3.c: Likewise. * gcc.dg/pr52549.c: Use __SIZE_TYPE__ if present. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 213886) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -1806,17 +1806,18 @@ proc check_effective_target_ptr32plus { return [check_no_compiler_messages ptr32plus object { int dummy[sizeof (void *) >= 4 ? 1 : -1]; }] } # Return 1 if we support 32-bit or larger array and structure sizes -# using default options, 0 otherwise. +# using default options, 0 otherwise. Avoid false positive on +# targets with 20 or 24 bit address spaces. proc check_effective_target_size32plus { } { return [check_no_compiler_messages size32plus object { - char dummy[65537]; + char dummy[16777217L]; }] } # Returns 1 if we're generating 16-bit or smaller integers with the # default options, 0 otherwise. Index: gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c (revision 213886) +++ gcc/testsuite/gcc.c-torture/compile/limits-stringlit.c (working copy) @@ -1,7 +1,7 @@ -/* { dg-skip-if "Array too big" { avr-*-* picochip-*-* m32c-*-* pdp11-*-* } { "*" } { "" } } */ +/* { dg-skip-if "Array too big" { avr-*-* picochip-*-* m32c-*-* pdp11-*-* msp430-*-* } { "*" } { "" } } */ #define STR2 "012345678901234567890123456789012345678901234567890123456789\ 0123456789012345678901234567890123456789" #define STR3 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 STR2 #define STR4 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 STR3 #define STR5 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 STR4 Index: gcc/testsuite/gcc.dg/lto/pr54709_1.c =================================================================== --- gcc/testsuite/gcc.dg/lto/pr54709_1.c (revision 213886) +++ gcc/testsuite/gcc.dg/lto/pr54709_1.c (working copy) @@ -1,5 +1,5 @@ -void * memcpy (void *, void *, long); +void * memcpy (void *, void *, __SIZE_TYPE__); void bar (void *p, void *q, unsigned s) { memcpy (p, q, s); } Index: gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c (revision 213886) +++ gcc/testsuite/gcc.dg/torture/pta-ptrarith-3.c (working copy) @@ -6,13 +6,13 @@ extern void abort (void); struct X { int *p; int *q; int *r; }; int __attribute__((noinline)) -foo(int i, int j, int k, int off) +foo(int i, int j, int k, __SIZE_TYPE__ off) { struct X x; int **p, *q; x.p = &i; x.q = &j; x.r = &k; Index: gcc/testsuite/gcc.dg/torture/pr36373-10.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr36373-10.c (revision 213886) +++ gcc/testsuite/gcc.dg/torture/pr36373-10.c (working copy) @@ -1,9 +1,11 @@ /* { dg-do run } */ -#if (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) +#ifdef __SIZE_TYPE__ +typedef __SIZE_TYPE__ uintptr_t; +#elif (__SIZEOF_LONG_LONG__ == __SIZEOF_POINTER__) typedef unsigned long long uintptr_t; #elif (__SIZEOF_LONG__ == __SIZEOF_POINTER__) typedef unsigned long uintptr_t; #elif (__SIZEOF_INT__ == __SIZEOF_POINTER__) typedef unsigned int uintptr_t; #else Index: gcc/testsuite/gcc.dg/torture/pr57864.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr57864.c (revision 213886) +++ gcc/testsuite/gcc.dg/torture/pr57864.c (working copy) @@ -12,18 +12,18 @@ int c; static void fn1(union U *p1, int p2, _Bool p3) { union U *e; if (p2 == 0) - a = ((union U*)((unsigned long)p1 & ~1))->val; + a = ((union U*)((__SIZE_TYPE__)p1 & ~1))->val; if (b) { e = p1; } else if (c) { - e = ((union U*)((unsigned long)p1 & ~1))->ptr; + e = ((union U*)((__SIZE_TYPE__)p1 & ~1))->ptr; d = e; } else { e = 0; d = ((union U*)0)->ptr; } Index: gcc/testsuite/gcc.dg/torture/pr26763-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr26763-2.c (revision 213886) +++ gcc/testsuite/gcc.dg/torture/pr26763-2.c (working copy) @@ -1,11 +1,11 @@ /* { dg-do run } */ extern void abort(void); -int try (char *a, int d) +int try (char *a, __SIZE_TYPE__ d) { return a + d > a; } int main(void) { Index: gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c (revision 213886) +++ gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c (working copy) @@ -1,12 +1,12 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-isolate-paths" } */ /* { dg-skip-if "" keeps_null_pointer_checks } */ -typedef long unsigned int size_t; +typedef __SIZE_TYPE__ size_t; extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1))); struct rtx_def; typedef struct rtx_def *rtx; typedef struct VEC_rtx_base Index: gcc/testsuite/gcc.dg/pr52549.c =================================================================== --- gcc/testsuite/gcc.dg/pr52549.c (revision 213886) +++ gcc/testsuite/gcc.dg/pr52549.c (working copy) @@ -1,9 +1,14 @@ /* { dg-do compile } */ -#if __SIZEOF_POINTER__ == __SIZEOF_LONG__ +#ifdef __SIZE_TYPE__ +_mark (__SIZE_TYPE__ obj, int i, char *a) +{ + (char *)&(((long *)(obj)) [i]) - a; +} +#elif __SIZEOF_POINTER__ == __SIZEOF_LONG__ _mark (long obj, int i, char *a) { (char *)&(((long *)(obj)) [i]) - a; } #elif __SIZEOF_POINTER__ == __SIZEOF_INT__ _mark (int obj, int i, char *a)