|
|
0b42f8 |
commit 77ae9c1933b5007fdcbd222b0eaa2d775ea6ae43
|
|
|
0b42f8 |
Author: Yao Qi <yao.qi@linaro.org>
|
|
|
0b42f8 |
Date: Fri Nov 13 15:03:25 2015 +0000
|
|
|
0b42f8 |
|
|
|
0b42f8 |
gdb.base/gnu_vector.exp: Don't test output from the inferior
|
|
|
0b42f8 |
|
|
|
0b42f8 |
gdb.base/gnu_vector.c printf the vector and gdb.base/gnu_vector.exp
|
|
|
0b42f8 |
expects the output by gdb_test_multiple. Nowadays, the test doesn't
|
|
|
0b42f8 |
expect the output from inferior_spawn_id, which is wrong. Even we
|
|
|
0b42f8 |
change the test to expect from inferior_spawn_id for the inferior
|
|
|
0b42f8 |
output, it is still possible the inferior exit before tcl/expect gets
|
|
|
0b42f8 |
the inferior output. We see this fail on both s390x-linux and
|
|
|
0b42f8 |
ppc-linux on buildbot,
|
|
|
0b42f8 |
|
|
|
0b42f8 |
FAIL: gdb.base/gnu_vector.exp: verify vector return value (the program exited)
|
|
|
0b42f8 |
|
|
|
0b42f8 |
https://sourceware.org/ml/gdb-testers/2015-q4/msg04922.html
|
|
|
0b42f8 |
https://sourceware.org/ml/gdb-testers/2015-q4/msg04952.html
|
|
|
0b42f8 |
|
|
|
0b42f8 |
In order to address these two shortcomings above in gnu_vector.exp,
|
|
|
0b42f8 |
this patch rewrites the test a little bit. Get rid of checking the
|
|
|
0b42f8 |
inferior output, and instead checking them by printing them. In this
|
|
|
0b42f8 |
way, the test can also be run on the target without inferior io
|
|
|
0b42f8 |
(gdb,noinferiorio is set in the board file).
|
|
|
0b42f8 |
|
|
|
0b42f8 |
gdb/testsuite:
|
|
|
0b42f8 |
|
|
|
0b42f8 |
2015-11-13 Yao Qi <yao.qi@linaro.org>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
* gdb.base/gnu_vector.exp: Check the return value by "p res".
|
|
|
0b42f8 |
* gdb.base/gnu_vector.c: Don't include stdio.h.
|
|
|
0b42f8 |
(main): Don't print res and call add_some_intvecs.
|
|
|
0b42f8 |
|
|
|
0b42f8 |
### a/gdb/testsuite/ChangeLog
|
|
|
0b42f8 |
### b/gdb/testsuite/ChangeLog
|
|
|
0b42f8 |
## -1,3 +1,9 @@
|
|
|
0b42f8 |
+2015-11-13 Yao Qi <yao.qi@linaro.org>
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ * gdb.base/gnu_vector.exp: Check the return value by "p res".
|
|
|
0b42f8 |
+ * gdb.base/gnu_vector.c: Don't include stdio.h.
|
|
|
0b42f8 |
+ (main): Don't print res and call add_some_intvecs.
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
2015-11-11 Marcin KoĆcielnicki <koriakin@0x04.net>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
* gdb.trace/change-loc.h: include "trace-common.h", remove SYMBOL
|
|
|
0b42f8 |
--- a/gdb/testsuite/gdb.base/gnu_vector.c
|
|
|
0b42f8 |
+++ b/gdb/testsuite/gdb.base/gnu_vector.c
|
|
|
0b42f8 |
@@ -18,7 +18,6 @@
|
|
|
0b42f8 |
Contributed by Ken Werner <ken.werner@de.ibm.com> */
|
|
|
0b42f8 |
|
|
|
0b42f8 |
#include <stdarg.h>
|
|
|
0b42f8 |
-#include <stdio.h>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
#define VECTOR(n, type) \
|
|
|
0b42f8 |
type __attribute__ ((vector_size (n * sizeof(type))))
|
|
|
0b42f8 |
@@ -139,10 +138,10 @@ main ()
|
|
|
0b42f8 |
int4 res;
|
|
|
0b42f8 |
|
|
|
0b42f8 |
res = add_some_intvecs (i4a, i4a + i4b, i4b);
|
|
|
0b42f8 |
- printf ("%d %d %d %d\n", res[0], res[1], res[2], res[3]);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
res = add_some_intvecs (i4a, i4a + i4b, i4b);
|
|
|
0b42f8 |
- printf ("%d %d %d %d\n", res[0], res[1], res[2], res[3]);
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ add_some_intvecs (i4a, i4a + i4b, i4b);
|
|
|
0b42f8 |
|
|
|
0b42f8 |
return 0;
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
|
|
|
0b42f8 |
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
|
|
|
0b42f8 |
@@ -216,8 +216,13 @@ gdb_test_multiple "finish" $test {
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
-# Test "return" from vector-valued function.
|
|
|
0b42f8 |
gdb_continue "add_some_intvecs"
|
|
|
0b42f8 |
+gdb_test "up" ""
|
|
|
0b42f8 |
+gdb_test "p res" "\\{10, 20, 48, 72\\}.*"
|
|
|
0b42f8 |
+gdb_test "down" ""
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+# Test "return" from vector-valued function.
|
|
|
0b42f8 |
set test "return from vector-valued function"
|
|
|
0b42f8 |
set should_kfail 0
|
|
|
0b42f8 |
gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
|
|
|
0b42f8 |
@@ -233,16 +238,6 @@ gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
|
|
|
0b42f8 |
exp_continue
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
-set test "verify vector return value"
|
|
|
0b42f8 |
-gdb_test_multiple "continue" $test {
|
|
|
0b42f8 |
- -re "4 2 7 6\r\n.*$gdb_prompt $" {
|
|
|
0b42f8 |
- pass $test
|
|
|
0b42f8 |
- }
|
|
|
0b42f8 |
- -re "10 20 48 72\r\n.*$gdb_prompt $" {
|
|
|
0b42f8 |
- if { $should_kfail } {
|
|
|
0b42f8 |
- kfail "gdb/8549" $test
|
|
|
0b42f8 |
- } else {
|
|
|
0b42f8 |
- fail $test
|
|
|
0b42f8 |
- }
|
|
|
0b42f8 |
- }
|
|
|
0b42f8 |
-}
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+gdb_test "next" ""
|
|
|
0b42f8 |
+gdb_test "p res" "\\{4, 2, 7, 6\\}.*" "verify vector return value"
|