Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Will Newton <will.newton@linaro.org>
To: gdb-patches@sourceware.org
Cc: patches@linaro.org
Subject: [PATCH] testsuite/gdb.base: Make skip test not rely on undefined behaviour.
Date: Fri, 07 Jun 2013 18:58:00 -0000	[thread overview]
Message-ID: <51B22951.1000601@linaro.org> (raw)


The skip test currently relies on the order of evaluation of
arguments which is not defined. Use an arithmetic expression
where order is defined instead.

gdb/testsuite/ChangeLog:

2013-06-07  Will Newton  <will.newton@linaro.org>

	* gdb.base/skip.c: Add 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(-)

diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c
index 565ba93..1281d17 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;
 }
-- 
1.8.1.4


             reply	other threads:[~2013-06-07 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 18:58 Will Newton [this message]
2013-06-11 23:02 ` Andrew Pinski
2013-06-12  9:54   ` Will Newton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B22951.1000601@linaro.org \
    --to=will.newton@linaro.org \
    --cc=gdb-patches@sourceware.org \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox