From patchwork Sun Jul 22 15:45:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 172520 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 088282C010F for ; Mon, 23 Jul 2012 01:46:26 +1000 (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=1343576787; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Date:Message-Id:From:To: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=Pk19y2nbM6ZItyKJ3UBf 6+OzfGQ=; b=YNCVYP65zJ8Maw56cNJUNbDQkMqu9cGkKID0bnm5vg3nkpow661l r8IrE3do6q9QsjjjrD5u6VDgBv0CyXbLPzuC1OqCHnwPHuyDvKQ441zJwNbGg+1H Sqj5SERp5fh/ujdzvDFPnS3h/lNXCPPb2RRbGDTjv/+L0UCGJ2frHTM= 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:Received:Received:Received:Received:Date:Message-Id:From:To:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=F91Z61aQheZBnq6/hfJ1SljIYlIWE1el9rToeU9bNftg6MAbTp8dcW3jtcaMXx FwRSAWUBD6e2brrr1oEIT3R2s2rDYFKmxWIAufFdXxYqTj8PzInSw2X4TTjCQztG k3lZyZ5q/f4gNEqxNTUBaiNjaHcnAyo+tSXSn5gim6e74=; Received: (qmail 19404 invoked by alias); 22 Jul 2012 15:46:23 -0000 Received: (qmail 19396 invoked by uid 22791); 22 Jul 2012 15:46:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ra.se.axis.com (HELO ra.se.axis.com) (195.60.68.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Jul 2012 15:46:04 +0000 Received: from localhost (localhost [127.0.0.1]) by ra.se.axis.com (Postfix) with ESMTP id 2BA5E11E69 for ; Sun, 22 Jul 2012 17:46:03 +0200 (CEST) Received: from ra.se.axis.com ([127.0.0.1]) by localhost (ra.se.axis.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cHPhndBpI83W for ; Sun, 22 Jul 2012 17:45:59 +0200 (CEST) Received: from thoth.se.axis.com (thoth.se.axis.com [10.0.2.173]) by ra.se.axis.com (Postfix) with ESMTP id 01A4711EA6 for ; Sun, 22 Jul 2012 17:45:59 +0200 (CEST) Received: from ignucius.se.axis.com (ignucius.se.axis.com [10.88.21.50]) by thoth.se.axis.com (Postfix) with ESMTP id F325F340B8; Sun, 22 Jul 2012 17:45:58 +0200 (CEST) Received: from ignucius.se.axis.com (localhost [127.0.0.1]) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) with ESMTP id q6MFjwd0026910; Sun, 22 Jul 2012 17:45:58 +0200 Received: (from hp@localhost) by ignucius.se.axis.com (8.12.8p1/8.12.8/Debian-2woody1) id q6MFjwT1026906; Sun, 22 Jul 2012 17:45:58 +0200 Date: Sun, 22 Jul 2012 17:45:58 +0200 Message-Id: <201207221545.q6MFjwT1026906@ignucius.se.axis.com> From: Hans-Peter Nilsson To: gcc-patches@gcc.gnu.org Subject: Committed: testsuite updates for recent changes in atomics for cris*-linux* MIME-Version: 1.0 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 I changed the defaults for cris*-linux*, but didn't fix the test-suite to go with that, so with unaligned accesses working, the test-suite still checked that they trapped, doh. Here's the update, checked trunk cris-elf and crisv32-elf (because of difference in atomics) and crisv32-linux* on the local 4.7 import - sorry, no actual trunk results. Some new tests piggy-backed to check that unaligned atomics don't fall over when exposed to actual unaligned accesses, but the results of the operations aren't properly checked. A buglet fixed; a local var shadowed the intended global var. Committed. gcc/testsuite: Handle recent changes in default atomics for cris*-*-linux*. * gcc.target/cris/torture/sync-mis-xchg-i-1ml.c, gcc.target/cris/torture/sync-mis-xchg-i-2ml.c, gcc.target/cris/torture/sync-mis-xchg-i-3ml.c, gcc.target/cris/torture/sync-mis-xchg-s-1ml.c, gcc.target/cris/torture/sync-mis-op-i-1ml.c, gcc.target/cris/torture/sync-mis-op-i-2ml.c, gcc.target/cris/torture/sync-mis-op-i-3ml.c, gcc.target/cris/torture/sync-mis-op-s-1ml.c: New tests. * gcc.target/cris/torture/sync-mis-op-i-2a.c: Make sure -mno-unaligned-atomic-may-use-library is in effect for cris*-*-linux*. * gcc.target/cris/torture/sync-mis-xchg-i-1.c, gcc.target/cris/torture/sync-mis-xchg-i-2.c, gcc.target/cris/torture/sync-mis-xchg-i-3.c, gcc.target/cris/torture/sync-mis-xchg-i-2a.c, gcc.target/cris/torture/sync-mis-xchg-s-1.c, gcc.target/cris/torture/sync-mis-op-i-1.c, gcc.target/cris/torture/sync-mis-op-i-2.c, gcc.target/cris/torture/sync-mis-op-i-1a.c, gcc.target/cris/torture/sync-mis-op-i-3.c, gcc.target/cris/torture/sync-mis-op-i-3a.c, gcc.target/cris/torture/sync-mis-op-s-1a.c, gcc.target/cris/torture/sync-mis-xchg-i-1a.c, gcc.target/cris/torture/sync-mis-xchg-i-3a.c, gcc.target/cris/torture/sync-mis-xchg-s-1a.c: Similar. * gcc.target/cris/torture/sync-mis-op-s-1.c: Ditto. (main): Remove local variable x. [mis_ok]: Check that atomics don't fail. brgds, H-P Index: gcc.target/cris/torture/sync-mis-op-i-2a.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-2a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-2a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-1ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-1ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-xchg-i-1ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dxchg -Dtype=int -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-2ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-2ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-xchg-i-2ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-3ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-3ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-xchg-i-3ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-1.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-1.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-1.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dxchg -Dtype=int" } */ +/* { dg-options "-Dxchg -Dtype=int -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-2.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-2.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-2.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2" } */ +/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-3.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-3.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-3.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3" } */ +/* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-2a.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-2a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-2a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-s-1ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-s-1ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-xchg-s-1ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dxchg -Dtype=short -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-s-1.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-s-1.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-s-1.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dxchg -Dtype=short" } */ +/* { dg-options "-Dxchg -Dtype=short -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-1ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-1ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-op-i-1ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dop -Dtype=int -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-2ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-2ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-op-i-2ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-3ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-3ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-op-i-3ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-1.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-1.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-1.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dop -Dtype=int" } */ +/* { dg-options "-Dop -Dtype=int -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-2.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-2.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-2.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dop -Dtype=int -Dmisalignment=2" } */ +/* { dg-options "-Dop -Dtype=int -Dmisalignment=2 -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-1a.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-1a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-1a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dop -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-3.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-3.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-3.c (working copy) @@ -1,4 +1,4 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dop -Dtype=int -Dmisalignment=3" } */ +/* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -mno-unaligned-atomic-may-use-library" } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-i-3a.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-i-3a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-i-3a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dop -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-s-1ml.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-s-1ml.c (revision 0) +++ gcc.target/cris/torture/sync-mis-op-s-1ml.c (revision 0) @@ -0,0 +1,4 @@ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-additional-sources "../sync-1.c" } */ +/* { dg-options "-Dop -Dtype=short -Dmis_ok" } */ +#include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-op-s-1.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-s-1.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-s-1.c (working copy) @@ -1,6 +1,6 @@ /* { dg-do run { target *-*-linux* } } */ /* { dg-additional-sources "../sync-1.c" } */ -/* { dg-options "-Dop -Dtype=short" } */ +/* { dg-options "-Dop -Dtype=short -mno-unaligned-atomic-may-use-library" } */ /* Make sure we get a SIGTRAP or equivalent when passing unaligned but otherwise valid pointers to the atomic builtins. */ @@ -76,7 +76,6 @@ void trap_handler(int signum) int main(void) { - type x = 0; type ret; #ifndef TRAP_USING_ABORT @@ -86,7 +85,9 @@ int main(void) #endif #endif +#ifndef mis_ok trap_expected = 1; +#endif #if op sfa (&s.i, &s.i, 42); @@ -98,10 +99,24 @@ int main(void) should do it. */ trap_expected = 0; +#ifdef mis_ok + /* We're missing a sequence point, but we shouldn't have the initial + value. */ + if (s.i == (type) 0xdeadbeef) + abort (); + exit (0); +#endif + sfa (&x, &x, 1); #else acen (&s.i, &x, &ret); +#ifdef mis_ok + if (s.i != 2 || x != 2 || ret != (type) 0xdeadbeef) + abort (); + exit (0); +#endif + trap_expected = 0; acen (&x, &x, &ret); Index: gcc.target/cris/torture/sync-mis-op-s-1a.c =================================================================== --- gcc.target/cris/torture/sync-mis-op-s-1a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-op-s-1a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dop -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-1a.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-1a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-1a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dxchg -Dtype=int -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-i-3a.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-i-3a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-i-3a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dxchg -Dtype=int -Dmisalignment=3 -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c" Index: gcc.target/cris/torture/sync-mis-xchg-s-1a.c =================================================================== --- gcc.target/cris/torture/sync-mis-xchg-s-1a.c (revision 189754) +++ gcc.target/cris/torture/sync-mis-xchg-s-1a.c (working copy) @@ -2,4 +2,5 @@ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dxchg -Dtype=short -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ +/* { dg-additional-options "-mno-unaligned-atomic-may-use-library" { target cris*-*-linux* } } */ #include "sync-mis-op-s-1.c"