-# Copyright 2015 Free Software Foundation, Inc.
+# Copyright 2015-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
remote_exec build "mkdir $coredir"
}
-if { [prepare_for_testing ${testfile}.exp $testfile $srcfile \
+if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
[list "additional_flags=-mzarch"]] } {
return -1
}
# directory.
if { $coredir != "" } {
- gdb_test {print setrlimit (4, &(unsigned long [2]){~0UL, ~0UL})} \
+ gdb_test {print (int) setrlimit (4, &(unsigned long [2]){~0UL, ~0UL})} \
" = .*" "setrlimit"
- gdb_test "print chdir (\"${coredir}\")" " = 0" "chdir"
+ gdb_test "print (int) chdir (\"${coredir}\")" " = 0" "chdir"
}
# Initialize all vector registers with GDB "set" commands, using
gdb_continue_to_breakpoint "change vrs"
set vregs [capture_command_output "info registers vector" ""]
+# Format a 128-bit value, given individual 4-byte values, as hex.
+# Suppress leading zeros.
+proc hex128 {a_high a_low b_high b_low} {
+ set result [format "%x%08x%08x%08x" $a_high $a_low $b_high $b_low]
+ regsub -- "^0*" $result "" result
+ if { $result eq "" } { set result 0 }
+ return $result
+}
+
set j 1
foreach {- r i val} [regexp -all -inline -line \
{^(\D*)(\d+)\s+.*?uint128 = 0x([0-9a-f]+?)} $vregs] {
if { $r ne "v" } {
fail "info registers vector: bad line $j"
- } elseif { $val ne [format %08x%08x%08x%08x \
+ } elseif { $val ne [hex128 \
[expr $a_high * ($i + 1) * $a_high ] \
[expr $a_low * ($i + 1) * $a_low ] \
[expr $b_high * (32 - $i) * $b_high * 32] \