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

2c2fa1
commit 77c365df78441f7b968ec0f62c7ed9f5de36dc60
2c2fa1
Author: Andreas Arnez <arnez@linux.vnet.ibm.com>
2c2fa1
Date:   Mon Aug 24 15:37:40 2015 +0200
2c2fa1
2c2fa1
    gnu_vector.exp: Avoid some more known FAILs
2c2fa1
    
2c2fa1
    This avoids two more types of FAILs with the gnu_vector test case.
2c2fa1
    
2c2fa1
    First, for POWER targets newer GCCs emit an ABI note when invoked with
2c2fa1
    "-mcpu=native".  Then the test case fell back to non-native compile,
2c2fa1
    producing code for a non-vector ABI.  But that is not supported by GDB.
2c2fa1
    Thus the compiler note is now suppressed with "-Wno-psabi".
2c2fa1
    
2c2fa1
    Second, on s390 the test case produced FAILs after falling back to a
2c2fa1
    non-vector ABI when using "finish" or "return" in a vector-valued
2c2fa1
    function.  This was due to a long-standing known bug (Bug 8549).  This
2c2fa1
    case is now detected, and KFAILs are emitted instead.
2c2fa1
    
2c2fa1
    gdb/testsuite/ChangeLog:
2c2fa1
    
2c2fa1
    	* gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native
2c2fa1
    	-Wno-psabi" if "-mcpu=native" fails.  For the tests with "finish"
2c2fa1
    	and "return" use KFAIL when GDB can not read/write the vector
2c2fa1
    	return value.
2c2fa1
2c2fa1
### a/gdb/testsuite/ChangeLog
2c2fa1
### b/gdb/testsuite/ChangeLog
2c2fa1
## -1,3 +1,10 @@
2c2fa1
+2015-08-24  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2c2fa1
+
2c2fa1
+	* gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native
2c2fa1
+	-Wno-psabi" if "-mcpu=native" fails.  For the tests with "finish"
2c2fa1
+	and "return" use KFAIL when GDB can not read/write the vector
2c2fa1
+	return value.
2c2fa1
+
2c2fa1
 2015-08-21  Gary Benson <gbenson@redhat.com>
2c2fa1
 
2c2fa1
 	* gdb.trace/pending.exp: Cope with remote transfer warnings.
2c2fa1
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
2c2fa1
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
2c2fa1
@@ -25,11 +25,19 @@ standard_testfile .c
2c2fa1
 # without a CPU option.  If all variants fail, assume that the
2c2fa1
 # compiler can not handle GNU vectors.
2c2fa1
 
2c2fa1
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet additional_flags=-mcpu=native}] != ""
2c2fa1
-     && [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet additional_flags=-march=native}] != ""
2c2fa1
-     && [gdb_compile "${srcdir}/${subdir}/${srcfile}" ${binfile} executable {debug quiet}] != ""} {
2c2fa1
-    untested "compiler can't handle the vector_size attribute?"
2c2fa1
-    return -1
2c2fa1
+proc do_compile { {opts {}} } {
2c2fa1
+    global srcdir subdir srcfile binfile
2c2fa1
+    set ccopts {debug quiet}
2c2fa1
+    foreach opt $opts {lappend ccopts "additional_flags=$opt"}
2c2fa1
+    gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable $ccopts
2c2fa1
+}
2c2fa1
+
2c2fa1
+if { [do_compile {-mcpu=native}] != ""
2c2fa1
+     && [do_compile {-mcpu=native -Wno-psabi}] != ""
2c2fa1
+     && [do_compile {-march=native}] != ""
2c2fa1
+     && [do_compile] != ""} {
2c2fa1
+	untested "compiler can't handle vector_size attribute?"
2c2fa1
+	return -1
2c2fa1
 }
2c2fa1
 
2c2fa1
 clean_restart ${binfile}
2c2fa1
@@ -195,14 +203,46 @@ gdb_test "print add_structvecs(i2, (struct just_int2)\{2*i2\}, (struct two_int2)
2c2fa1
 gdb_test "print add_singlevecs((char1) \{6\}, (int1) \{12\}, (double1) \{24\})" "= \\{42\\}" \
2c2fa1
     "call add_singlevecs"
2c2fa1
 
2c2fa1
-# Test vector return value handling with "finish" and "return".
2c2fa1
+# Test "finish" from vector-valued function.
2c2fa1
 gdb_breakpoint "add_some_intvecs"
2c2fa1
 gdb_continue "add_some_intvecs"
2c2fa1
-gdb_test "finish" "Value returned is .* = \\{10, 20, 48, 72\\}" \
2c2fa1
-    "finish shows vector return value"
2c2fa1
+set test "finish shows vector return value"
2c2fa1
+gdb_test_multiple "finish" $test {
2c2fa1
+    -re "Value returned is .* = \\{10, 20, 48, 72\\}.*$gdb_prompt $" {
2c2fa1
+	pass $test
2c2fa1
+    }
2c2fa1
+    -re "Value returned has type: .* Cannot determine contents.*$gdb_prompt $" {
2c2fa1
+	kfail "gdb/8549" $test
2c2fa1
+    }
2c2fa1
+}
2c2fa1
+
2c2fa1
+# Test "return" from vector-valued function.
2c2fa1
 gdb_continue "add_some_intvecs"
2c2fa1
-gdb_test "return (int4) \{4, 2, 7, 6\}" \
2c2fa1
-    "#0 .* main .*" \
2c2fa1
-    "set vector return value" \
2c2fa1
-    "Make add_some_intvecs return now. .y or n.*" "y"
2c2fa1
-gdb_test "continue" "4 2 7 6\r\n.*" "verify vector return value"
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
+    -re "#0 .* main .*$gdb_prompt $" {
2c2fa1
+	pass $test
2c2fa1
+    }
2c2fa1
+    -re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" {
2c2fa1
+	set should_kfail 1
2c2fa1
+	exp_continue
2c2fa1
+    }
2c2fa1
+    -re "Make add_some_intvecs return now. .y or n. $" {
2c2fa1
+	send_gdb "y\n"
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
+}