aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2018-08-24 10:33:10 +0100
committerAlan Hayward <alan.hayward@arm.com>2018-10-01 14:51:09 +0100
commit6bb8890e2ccf2b1ae7860fcb6fe4579c4aa9ebf6 (patch)
tree519bab07d7f97fad7569d711795970ca0f076f3d /gdb/testsuite/lib
parent05c71722fc5d9407d712b58b80eaf469ffbc406f (diff)
downloadgdb-6bb8890e2ccf2b1ae7860fcb6fe4579c4aa9ebf6.zip
gdb-6bb8890e2ccf2b1ae7860fcb6fe4579c4aa9ebf6.tar.gz
gdb-6bb8890e2ccf2b1ae7860fcb6fe4579c4aa9ebf6.tar.bz2
Add aarch64-sighandler-regs.exp test
Add Aarch64 test to check register values of a previous frame can be shown correctly across a signal. gdb/testsuite/ChangeLog: * gdb.arch/aarch64-sighandler-regs.c: New test. * gdb.arch/aarch64-sighandler-regs.exp: New file. * lib/gdb.exp (skip_aarch64_sve_tests): New proc.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp50
1 files changed, 50 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1eea922..9284291 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2825,6 +2825,56 @@ gdb_caching_proc skip_btrace_pt_tests {
return $skip_btrace_tests
}
+# Run a test on the target to see if it supports Aarch64 SVE hardware.
+# Return 0 if so, 1 if it does not. Note this causes a restart of GDB.
+
+gdb_caching_proc skip_aarch64_sve_tests {
+ global srcdir subdir gdb_prompt inferior_exited_re
+
+ set me "skip_aarch64_sve_tests"
+
+ if { ![is_aarch64_target]} {
+ return 1
+ }
+
+ set compile_flags "{additional_flags=-march=armv8-a+sve}"
+
+ # Compile a test program containing SVE instructions.
+ set src {
+ int main() {
+ asm volatile ("ptrue p0.b");
+ return 0;
+ }
+ }
+ if {![gdb_simple_compile $me $src executable $compile_flags]} {
+ return 1
+ }
+
+ # Compilation succeeded so now run it via gdb.
+ clean_restart $obj
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Illegal instruction.*${gdb_prompt} $" {
+ verbose -log "\n$me sve hardware not detected"
+ set skip_sve_tests 1
+ }
+ -re ".*$inferior_exited_re normally.*${gdb_prompt} $" {
+ verbose -log "\n$me: sve hardware detected"
+ set skip_sve_tests 0
+ }
+ default {
+ warning "\n$me: default case taken"
+ set skip_sve_tests 1
+ }
+ }
+ gdb_exit
+ remote_file build delete $obj
+
+ verbose "$me: returning $skip_sve_tests" 2
+ return $skip_sve_tests
+}
+
+
# A helper that compiles a test case to see if __int128 is supported.
proc gdb_int128_helper {lang} {
return [gdb_can_simple_compile "i128-for-$lang" {