From patchwork Mon Jun 17 11:20:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 17950 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BD6DA2100B for ; Mon, 17 Jun 2013 11:20:30 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id w16sf3503374vbb.0 for ; Mon, 17 Jun 2013 04:20:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:message-id :date:from:user-agent:mime-version:to:cc:subject:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=QcVGlAH3L1a/zu+8UpuZv2KhTkrZn5EcK6vAp8YMzo0=; b=aNCIsVdKdq8s9+2hFnF/ErUxi9W7Z87/VONltvHegAgE+Hz9+pVA7OI4HBadWQINm+ tfKElsvUWD8XKW6CsVbLtxmrrsH9jLgfLksIFMrWCfFmDtYw+oG63OBx92b9/5/44wSO cFvEpKemKYbzcYrlhoi4sQZI5sZm3Y2794GK4UrCp6c8sLJyRRofngw2nZdX+uxqbHUm s5lRTax3LibsSSO7atGNfQ9B0pHLEqSHcr+mJP2bzLVrHpdeBTgDdDtm9FI87un/mBq0 uyY5+bs/dwNIarNjbzghC8UXV6MP/vGG2mLZ/zQoRndyV7C+xxQj+x22tZ0KsctAOgGA wrtw== X-Received: by 10.58.135.70 with SMTP id pq6mr1791285veb.22.1371468030168; Mon, 17 Jun 2013 04:20:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.26.137 with SMTP id l9ls962007qeg.35.gmail; Mon, 17 Jun 2013 04:20:30 -0700 (PDT) X-Received: by 10.221.23.71 with SMTP id qz7mr4345193vcb.13.1371468029994; Mon, 17 Jun 2013 04:20:29 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id mu5si2798628vec.103.2013.06.17.04.20.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 04:20:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so1878839vcb.12 for ; Mon, 17 Jun 2013 04:20:29 -0700 (PDT) X-Received: by 10.52.95.113 with SMTP id dj17mr93495vdb.82.1371468029827; Mon, 17 Jun 2013 04:20:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp30145veb; Mon, 17 Jun 2013 04:20:29 -0700 (PDT) X-Received: by 10.204.183.135 with SMTP id cg7mr1216468bkb.79.1371468028490; Mon, 17 Jun 2013 04:20:28 -0700 (PDT) Received: from mail-bk0-x22d.google.com (mail-bk0-x22d.google.com [2a00:1450:4008:c01::22d]) by mx.google.com with ESMTPS id u1si1513023bkh.245.2013.06.17.04.20.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 04:20:28 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4008:c01::22d is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=2a00:1450:4008:c01::22d; Received: by mail-bk0-f45.google.com with SMTP id je9so1128530bkc.32 for ; Mon, 17 Jun 2013 04:20:27 -0700 (PDT) X-Received: by 10.204.225.73 with SMTP id ir9mr1855334bkb.45.1371468027668; Mon, 17 Jun 2013 04:20:27 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id ch16sm3920719bkb.17.2013.06.17.04.20.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Jun 2013 04:20:26 -0700 (PDT) Message-ID: <51BEF0F9.6060504@linaro.org> Date: Mon, 17 Jun 2013 12:20:25 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH v2] testsuite/gdb.base: Make skip test not rely on undefined behaviour. X-Gm-Message-State: ALoCoQn9bXKx1F1wAAY21XUDhvs30j0DaeMk7tiluzN4P7oIz3dICBSfg3ymQKGMghevFluhurES X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The skip test currently relies on the order of evaluation of arguments which is not defined. Use the comma operator where order is defined instead. gdb/testsuite/ChangeLog: 2013-06-17 Will Newton * gdb.base/skip.c: Use comma to evaluate results of foo() and bar() before passing to baz(). * gdb.base/skip.c: baz() now takes one argument instead of two. --- gdb/testsuite/gdb.base/skip.c | 4 ++-- gdb/testsuite/gdb.base/skip1.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Changes in v2: - Use comma operator instead of addition. diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c index 565ba93..c4f5535 100644 --- a/gdb/testsuite/gdb.base/skip.c +++ b/gdb/testsuite/gdb.base/skip.c @@ -1,10 +1,10 @@ int foo(); int bar(); -int baz(int, int); +int baz(int); int main() { - return baz(foo(), bar()); + return baz((bar(), foo())); } int foo() diff --git a/gdb/testsuite/gdb.base/skip1.c b/gdb/testsuite/gdb.base/skip1.c index 2dab5c3..fe63cd6 100644 --- a/gdb/testsuite/gdb.base/skip1.c +++ b/gdb/testsuite/gdb.base/skip1.c @@ -3,7 +3,7 @@ int bar() return 1; } -int baz(int a, int b) +int baz(int a) { - return a + b; + return a + 1; }