gdb.base/gnu_vector.exp: Don't test output from the inferior
authorYao Qi <yao.qi@linaro.org>
Fri, 13 Nov 2015 15:03:25 +0000 (15:03 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 13 Nov 2015 15:03:25 +0000 (15:03 +0000)
gdb.base/gnu_vector.c printf the vector and gdb.base/gnu_vector.exp
expects the output by gdb_test_multiple.  Nowadays, the test doesn't
expect the output from inferior_spawn_id, which is wrong.  Even we
change the test to expect from inferior_spawn_id for the inferior
output, it is still possible the inferior exit before tcl/expect gets
the inferior output.  We see this fail on both s390x-linux and
ppc-linux on buildbot,

  FAIL: gdb.base/gnu_vector.exp: verify vector return value (the program exited)

https://sourceware.org/ml/gdb-testers/2015-q4/msg04922.html
https://sourceware.org/ml/gdb-testers/2015-q4/msg04952.html

In order to address these two shortcomings above in gnu_vector.exp,
this patch rewrites the test a little bit.  Get rid of checking the
inferior output, and instead checking them by printing them.  In this
way, the test can also be run on the target without inferior io
(gdb,noinferiorio is set in the board file).

gdb/testsuite:

2015-11-13  Yao Qi  <yao.qi@linaro.org>

* gdb.base/gnu_vector.exp: Check the return value by "p res".
* gdb.base/gnu_vector.c: Don't include stdio.h.
(main): Don't print res and call add_some_intvecs.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gnu_vector.c
gdb/testsuite/gdb.base/gnu_vector.exp

index 85dcbe92dec54bd57edb187d89af01cde421a6f2..8730d2cb6b68c5dd873d042aaa92fe8873eb58f7 100644 (file)
@@ -1,3 +1,9 @@
+2015-11-13  Yao Qi  <yao.qi@linaro.org>
+
+       * gdb.base/gnu_vector.exp: Check the return value by "p res".
+       * gdb.base/gnu_vector.c: Don't include stdio.h.
+       (main): Don't print res and call add_some_intvecs.
+
 2015-11-11  Marcin Koƛcielnicki  <koriakin@0x04.net>
 
        * gdb.trace/change-loc.h: include "trace-common.h", remove SYMBOL
index 4e505d1e262a2ff9145e800ee344653a24f98578..b6ed9f790fc4b6e6a97c0e3e72616839a30e86b9 100644 (file)
@@ -18,7 +18,6 @@
    Contributed by Ken Werner <ken.werner@de.ibm.com>  */
 
 #include <stdarg.h>
-#include <stdio.h>
 
 #define VECTOR(n, type)                                        \
   type __attribute__ ((vector_size (n * sizeof(type))))
@@ -139,10 +138,10 @@ main ()
   int4 res;
 
   res = add_some_intvecs (i4a, i4a + i4b, i4b);
-  printf ("%d %d %d %d\n", res[0], res[1], res[2], res[3]);
 
   res = add_some_intvecs (i4a, i4a + i4b, i4b);
-  printf ("%d %d %d %d\n", res[0], res[1], res[2], res[3]);
+
+  add_some_intvecs (i4a, i4a + i4b, i4b);
 
   return 0;
 }
index 09593d25efe80e102f40bf08550f656cf76d6f06..ba35ab516fc0643e74d57b390e39610bfe9ba8e9 100644 (file)
@@ -216,8 +216,13 @@ gdb_test_multiple "finish" $test {
     }
 }
 
-# Test "return" from vector-valued function.
 gdb_continue "add_some_intvecs"
+gdb_test "up" ""
+gdb_test "p res" "\\{10, 20, 48, 72\\}.*"
+gdb_test "down" ""
+
+
+# Test "return" from vector-valued function.
 set test "return from vector-valued function"
 set should_kfail 0
 gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
@@ -233,16 +238,6 @@ gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
        exp_continue
     }
 }
-set test "verify vector return value"
-gdb_test_multiple "continue" $test {
-    -re "4 2 7 6\r\n.*$gdb_prompt $" {
-       pass $test
-    }
-    -re "10 20 48 72\r\n.*$gdb_prompt $" {
-       if { $should_kfail } {
-           kfail "gdb/8549" $test
-       } else {
-           fail $test
-       }
-    }
-}
+
+gdb_test "next" ""
+gdb_test "p res" "\\{4, 2, 7, 6\\}.*" "verify vector return value"
This page took 0.033502 seconds and 4 git commands to generate.