|
|
0b42f8 |
commit 4c406179784990e349f3b554c93dc418e9a007a5
|
|
|
0b42f8 |
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
0b42f8 |
Date: Mon Oct 21 12:34:25 2013 +0000
|
|
|
0b42f8 |
|
|
|
0b42f8 |
2013-10-21 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
* gdb.base/gnu_vector.exp: Care about endianness when casting
|
|
|
0b42f8 |
scalars to vectors.
|
|
|
0b42f8 |
|
|
|
0b42f8 |
### a/gdb/testsuite/ChangeLog
|
|
|
0b42f8 |
### b/gdb/testsuite/ChangeLog
|
|
|
0b42f8 |
## -1,3 +1,8 @@
|
|
|
0b42f8 |
+2013-10-21 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
+ * gdb.base/gnu_vector.exp: Care about endianness when casting
|
|
|
0b42f8 |
+ scalars to vectors.
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
2013-10-18 Tom Tromey <tromey@redhat.com>
|
|
|
0b42f8 |
|
|
|
0b42f8 |
* lib/gdb.exp (build_executable_from_specs): Remove duplicate set
|
|
|
0b42f8 |
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
|
|
|
0b42f8 |
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
|
|
|
0b42f8 |
@@ -40,6 +40,14 @@ if { ![runto main] } {
|
|
|
0b42f8 |
return -1
|
|
|
0b42f8 |
}
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+# Get endianess for the scalar->vector casts
|
|
|
0b42f8 |
+gdb_test_multiple "show endian" "show endian" {
|
|
|
0b42f8 |
+ -re ".* (big|little) endian.*$gdb_prompt $" {
|
|
|
0b42f8 |
+ set endian $expect_out(1,string)
|
|
|
0b42f8 |
+ pass "endianness: $endian"
|
|
|
0b42f8 |
+ }
|
|
|
0b42f8 |
+}
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
# Test printing of character vector types
|
|
|
0b42f8 |
gdb_test "print c4" "\\\$$decimal = \\{1, 2, 3, 4\\}"
|
|
|
0b42f8 |
gdb_test "print c4\[2\]" "\\\$$decimal = 3"
|
|
|
0b42f8 |
@@ -83,9 +91,14 @@ gdb_test "print -f4a" "\\\$$decimal = \\{-2, -4, -8, -16\\}"
|
|
|
0b42f8 |
# When casting to vector the input type must have the same length as
|
|
|
0b42f8 |
# the total length of the vector.
|
|
|
0b42f8 |
gdb_test "print (char4) 0x01010101" "\\\$$decimal = \\{1, 1, 1, 1\\}"
|
|
|
0b42f8 |
-gdb_test "print (char4) ia" "\\\$$decimal = \\{2, 0, 0, 0\\}"
|
|
|
0b42f8 |
gdb_test "print (int2) lla" "\\\$$decimal = \\{1, 1\\}"
|
|
|
0b42f8 |
|
|
|
0b42f8 |
+if { ![string compare $endian big] } then {
|
|
|
0b42f8 |
+ gdb_test "print (char4) ia" "\\\$$decimal = \\{0, 0, 0, 2\\}"
|
|
|
0b42f8 |
+} else {
|
|
|
0b42f8 |
+ gdb_test "print (char4) ia" "\\\$$decimal = \\{2, 0, 0, 0\\}"
|
|
|
0b42f8 |
+}
|
|
|
0b42f8 |
+
|
|
|
0b42f8 |
gdb_test "print (int2) 1" "can only cast scalar to vector of same size"
|
|
|
0b42f8 |
gdb_test "print (longlong2) 2" "can only cast scalar to vector of same size"
|
|
|
0b42f8 |
gdb_test "print (float2) 3" "can only cast scalar to vector of same size"
|