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

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