summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorwillnewton <willnewton>2013-06-18 18:16:15 +0000
committerwillnewton <willnewton>2013-06-18 18:16:15 +0000
commit75f45fe57b0f1bb1de9485a9175e0bba723ccda2 (patch)
tree6d7080445be6adf1c03c0f1364d9e0ca2908ff54 /gdb
parentde1e5bbb865c27c372bc49912777506376517a9a (diff)
downloadgdb-75f45fe57b0f1bb1de9485a9175e0bba723ccda2.tar.gz
testsuite/gdb.base: Make skip test use defined behaviour.
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-18 Will Newton <will.newton@linaro.org> * 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/skip.c5
-rw-r--r--gdb/testsuite/gdb.base/skip1.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2c9e13a263d..395b86b82b8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-18 Will Newton <will.newton@linaro.org>
+
+ * 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.
+
2013-06-18 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2/implptrpiece.exp: New file.
diff --git a/gdb/testsuite/gdb.base/skip.c b/gdb/testsuite/gdb.base/skip.c
index 565ba93fcf8..1467fe36913 100644
--- a/gdb/testsuite/gdb.base/skip.c
+++ b/gdb/testsuite/gdb.base/skip.c
@@ -1,10 +1,11 @@
int foo();
int bar();
-int baz(int, int);
+int baz(int);
int main()
{
- return baz(foo(), bar());
+ /* Use comma operator to sequence evaluation of bar and foo. */
+ return baz((bar(), foo()));
}
int foo()
diff --git a/gdb/testsuite/gdb.base/skip1.c b/gdb/testsuite/gdb.base/skip1.c
index 2dab5c3f618..fe63cd65779 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;
}