Blame SOURCES/gdb-rhbz1182151-ibm-z13-21of22.patch

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