From patchwork Thu Mar 7 18:34:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 225895 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 BCEEE2C0398 for ; Fri, 8 Mar 2013 05:35:11 +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=1363286112; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=dvy+FaI nU/tnXJoajvaRltmx9K4=; b=x0/ZtAO87qXOBxepZdjFLsHsDu9EiCTL07yBZhZ Kw0KKp/KWw5wF285EBFOIqI2tl9wOMk+0NOsDNSfqGIDPTsZyJNBg0RbTGYsjtVa s+sfuZkz0e/vVe159HCIg5RkAP9xAFKzH/ATYjcWhCXeGIiqwRrFaejHMmsVc2mQ HQS4= 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:MIME-Version:X-Received:Received:Date:Message-ID:Subject:From:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Vh4G/8co8QB5UglUSZEFVjmVTA2WwYimhsEEGPtkFgp+JydbxWof9+T3Xd7B1Z VxRlkLHNvRylXp6cJ0oFoleCE6bB5NkCO8Z3MHVR6GtlI+l7FOHbyAqTkhOPm79S OwaFhTpJ6Ego62VuUid6uyBRzg+tb9YkZWH7KIP30Ore8=; Received: (qmail 17845 invoked by alias); 7 Mar 2013 18:34:55 -0000 Received: (qmail 17787 invoked by uid 22791); 7 Mar 2013 18:34:53 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f174.google.com (HELO mail-ie0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Mar 2013 18:34:46 +0000 Received: by mail-ie0-f174.google.com with SMTP id k10so961891iea.5 for ; Thu, 07 Mar 2013 10:34:46 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.50.94.201 with SMTP id de9mr15077237igb.99.1362681285917; Thu, 07 Mar 2013 10:34:45 -0800 (PST) Received: by 10.64.14.129 with HTTP; Thu, 7 Mar 2013 10:34:45 -0800 (PST) Date: Thu, 7 Mar 2013 19:34:45 +0100 Message-ID: Subject: [patch testsuite]: Fixes in gcc.dg for mingw-targets From: Kai Tietz To: 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 Hi, this patch fixes some remaining issue for mingw-targets in gcc.dg's testsuite. ChangeLog 2013-03-07 Kai Tietz * gcc.dg/pr14092-1.c: Mark intptr_t typedef to use extension. * gcc.dg/pr24683.c: Avoid warning about casting constant string. * gcc.dg/pr52549.c: Add LLP64 case. * gcc.dg/pr53701.c: Use for uintptr_t typedef __UINTPTR_TYPE__. * gcc.dg/pr56510.c: Adjust for LLP64 targets. * gcc.dg/torture/pr51071-2.c: Likewise. * gcc.dg/tree-ssa/vrp72.c: Likewise. * gcc.dg/tree-ssa/vrp73.c: Likewise. * gcc.dg/tree-ssa/vrp75.c: Likewise. * gcc.dg/torture/pr53922.c: Skike for mingw-targets. * gcc.dg/weak/weak-1.c: Likewise. * gcc.dg/weak/weak-2.c: Likewise. * gcc.dg/weak/weak-3.c: Likewise. * gcc.dg/weak/weak-4.c: Likewise. * gcc.dg/weak/weak-5.c: Likewise. * gcc.dg/weak/weak-15.c: Likewise. * gcc.dg/weak/weak-16.c: Likewise. ok for apply? Kai Index: gcc.dg/pr14092-1.c =================================================================== --- gcc.dg/pr14092-1.c (Revision 196507) +++ gcc.dg/pr14092-1.c (Arbeitskopie) @@ -6,7 +6,7 @@ /* Define this so that we are more portable. The testcase in the PR failed on 64-bit hosts. */ -typedef __INTPTR_TYPE__ intptr_t; +__extension__ typedef __INTPTR_TYPE__ intptr_t; typedef struct _PLCI { unsigned char x; Index: gcc.dg/pr24683.c =================================================================== --- gcc.dg/pr24683.c (Revision 196507) +++ gcc.dg/pr24683.c (Arbeitskopie) @@ -1,11 +1,11 @@ /* { dg-do compile { target fpic } } */ /* { dg-options "-O2 -fPIC" } */ -int *block; +const int *block; void final(unsigned int j) { unsigned int i; - unsigned char *data = (unsigned char *)"\0"; + const unsigned char *data = (const unsigned char *)"\0"; for (i = 0; i < 8; i++) for (; j + 63 < 1; j += 64) - block = (int *) &data[j]; + block = (const int *) &data[j]; } Index: gcc.dg/pr52549.c =================================================================== --- gcc.dg/pr52549.c (Revision 196507) +++ gcc.dg/pr52549.c (Arbeitskopie) @@ -10,4 +10,9 @@ _mark (int obj, int i, char *a) { (char *)&(((int *)(obj)) [i]) - a; } +#elif __SIZEOF_POINTER__ == __SIZEOF_LONG_LONG__ +__extension__ _mark (long long obj, int i, char *a) +{ + (char *)&(((int *)(obj)) [i]) - a; +} #endif Index: gcc.dg/pr53701.c =================================================================== --- gcc.dg/pr53701.c (Revision 196507) +++ gcc.dg/pr53701.c (Arbeitskopie) @@ -1,7 +1,7 @@ /* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */ /* { dg-options "-O3 -fselective-scheduling2 -fsel-sched-pipelining" } */ typedef unsigned short int uint16_t; -typedef unsigned long int uintptr_t; +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; typedef struct GFX_VTABLE { int color_depth; Index: gcc.dg/pr56510.c =================================================================== --- gcc.dg/pr56510.c (Revision 196507) +++ gcc.dg/pr56510.c (Arbeitskopie) @@ -2,11 +2,12 @@ /* { dg-do compile } */ /* { dg-options "-O2 -g" } */ +__extension__ typedef __INTPTR_TYPE__ intptr_t; struct S { unsigned long s1; void **s2[0]; }; void **a, **b, **c, **d, **e, **f; static void ** -baz (long x, long y) +baz (intptr_t x, intptr_t y) { void **s = f; *f = (void **) (y << 8 | (x & 0xff)); Index: gcc.dg/torture/pr51071-2.c =================================================================== --- gcc.dg/torture/pr51071-2.c (Revision 196507) +++ gcc.dg/torture/pr51071-2.c (Arbeitskopie) @@ -1,9 +1,11 @@ /* { dg-do compile } */ /* { dg-options "-fno-delete-null-pointer-checks" } */ +__extension__ typedef __UINTPTR_TYPE__ uintptr_t; + extern struct module __this_module; static inline void -trace_module_get (struct module *mod, unsigned long ip) { } +trace_module_get (struct module *mod, uintptr_t ip) { } struct module; static inline __attribute__((no_instrument_function)) int try_module_get(struct module *module) @@ -16,7 +18,7 @@ int try_module_get(struct module *module) __label__ __here; asm(""); __here: - trace_module_get(module, (unsigned long)&&__here); + trace_module_get(module, (uintptr_t)&&__here); } else ret = 0; Index: gcc.dg/torture/pr53922.c =================================================================== --- gcc.dg/torture/pr53922.c (Revision 196507) +++ gcc.dg/torture/pr53922.c (Arbeitskopie) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-require-weak "" } */ +/* { dg-skip-if "No undefined" { *-*-mingw* } { "*" } { "" } } */ /* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */ /* { dg-options "-Wl,-undefined,dynamic_lookup" { target *-*-darwin* } } */ Index: gcc.dg/tree-ssa/vrp72.c =================================================================== --- gcc.dg/tree-ssa/vrp72.c (Revision 196507) +++ gcc.dg/tree-ssa/vrp72.c (Arbeitskopie) @@ -1,14 +1,15 @@ /* { dg-options "-O2" } */ +typedef __INTPTR_TYPE__ intptr_t; typedef unsigned long long uint64_t; static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) { - *(volatile uint64_t *)(long)addr = val; + *(volatile uint64_t *)(intptr_t)addr = val; }; static inline uint64_t cvmx_read64_uint64(uint64_t addr) { - return *(volatile uint64_t *)(long)addr; + return *(volatile uint64_t *)(intptr_t)addr; }; static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) Index: gcc.dg/tree-ssa/vrp73.c =================================================================== --- gcc.dg/tree-ssa/vrp73.c (Revision 196507) +++ gcc.dg/tree-ssa/vrp73.c (Arbeitskopie) @@ -1,14 +1,16 @@ /* { dg-options "-O2" } */ +__extension__ typedef __INTPTR_TYPE__ intptr_t; + typedef unsigned long long uint64_t; static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) { - *(volatile uint64_t *)(long)addr = val; + *(volatile uint64_t *)(intptr_t)addr = val; }; static inline uint64_t cvmx_read64_uint64(uint64_t addr) { - return *(volatile uint64_t *)(long)addr; + return *(volatile uint64_t *)(intptr_t)addr; }; static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) Index: gcc.dg/tree-ssa/vrp75.c =================================================================== --- gcc.dg/tree-ssa/vrp75.c (Revision 196507) +++ gcc.dg/tree-ssa/vrp75.c (Arbeitskopie) @@ -1,14 +1,15 @@ /* { dg-options "-O2" } */ +__extension__ typedef __INTPTR_TYPE__ intptr_t; typedef unsigned long long uint64_t; static inline void cvmx_write64_uint64(uint64_t addr, uint64_t val) { - *(volatile uint64_t *)(long)addr = val; + *(volatile uint64_t *)(intptr_t)addr = val; }; static inline uint64_t cvmx_read64_uint64(uint64_t addr) { - return *(volatile uint64_t *)(long)addr; + return *(volatile uint64_t *)(intptr_t)addr; }; static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val) { Index: gcc.dg/weak/weak-1.c =================================================================== --- gcc.dg/weak/weak-1.c (Revision 196507) +++ gcc.dg/weak/weak-1.c (Arbeitskopie) @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-weak "" } */ /* { dg-options "-fno-common" } */ +/* { dg-skip-if "" { *-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?b" } } */ Index: gcc.dg/weak/weak-15.c =================================================================== --- gcc.dg/weak/weak-15.c (Revision 196507) +++ gcc.dg/weak/weak-15.c (Arbeitskopie) @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-weak "" } */ /* { dg-options "-fno-common" } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */ /* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?b" } } */ Index: gcc.dg/weak/weak-16.c =================================================================== --- gcc.dg/weak/weak-16.c (Revision 196507) +++ gcc.dg/weak/weak-16.c (Arbeitskopie) @@ -4,6 +4,7 @@ /* { dg-options "-fno-common -Os" } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_index" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?kallsyms_token_table" } } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ extern int kallsyms_token_index[] __attribute__((weak)); extern int kallsyms_token_table[] __attribute__((weak)); Index: gcc.dg/weak/weak-2.c =================================================================== --- gcc.dg/weak/weak-2.c (Revision 196507) +++ gcc.dg/weak/weak-2.c (Arbeitskopie) @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-weak "" } */ /* { dg-options "-fno-common" } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */ Index: gcc.dg/weak/weak-3.c =================================================================== --- gcc.dg/weak/weak-3.c (Revision 196507) +++ gcc.dg/weak/weak-3.c (Arbeitskopie) @@ -2,6 +2,7 @@ /* { dg-require-alias "" } */ /* { dg-require-weak "" } */ /* { dg-options "-fno-common -Waddress" } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1a" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?ffoo1b" } } */ Index: gcc.dg/weak/weak-4.c =================================================================== --- gcc.dg/weak/weak-4.c (Revision 196507) +++ gcc.dg/weak/weak-4.c (Arbeitskopie) @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-weak "" } */ /* { dg-options "-fno-common" } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */ Index: gcc.dg/weak/weak-5.c =================================================================== --- gcc.dg/weak/weak-5.c (Revision 196507) +++ gcc.dg/weak/weak-5.c (Arbeitskopie) @@ -2,6 +2,7 @@ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ /* { dg-options "-fno-common" } */ +/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */ /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */