New proc is_aarch64_target
authorYao Qi <yao.qi@linaro.org>
Tue, 7 Jul 2015 15:58:20 +0000 (16:58 +0100)
committerYao Qi <yao.qi@linaro.org>
Tue, 7 Jul 2015 15:58:20 +0000 (16:58 +0100)
Some tests expect the the target is aarch64, but checking target
triplet is not accurate, because target triplet can be aarch64 but
the program is in arm (or aarch32) state.

This patch addes a new proc is_aarch64_target which returns true
if the target is on aarch64 state.

gdb/testsuite:

2015-07-07  Yao Qi  <yao.qi@linaro.org>

* gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
instead of istarget "aarch64*-*-*".
* gdb.arch/aarch64-fp.exp: Likewise.
* gdb.base/float.exp: Likewise.
* gdb.reverse/aarch64.exp: Likewise.
* lib/gdb.exp (is_aarch64_target): New proc.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
gdb/testsuite/gdb.arch/aarch64-fp.exp
gdb/testsuite/gdb.base/float.exp
gdb/testsuite/gdb.reverse/aarch64.exp
gdb/testsuite/lib/gdb.exp

index 11f6424c9814ecaedfc28236151d5ac9ff534049..c5386b283000923262c99f85ab0171d4f10cdd9d 100644 (file)
@@ -1,3 +1,12 @@
+2015-07-07  Yao Qi  <yao.qi@linaro.org>
+
+       * gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
+       instead of istarget "aarch64*-*-*".
+       * gdb.arch/aarch64-fp.exp: Likewise.
+       * gdb.base/float.exp: Likewise.
+       * gdb.reverse/aarch64.exp: Likewise.
+       * lib/gdb.exp (is_aarch64_target): New proc.
+
 2015-07-07  Yao Qi  <yao.qi@linaro.org>
 
        * lib/gdb.exp (is_aarch32_target): New proc.
index 885cfb163b2b9246dbbf13aa3157e667a3f2d548..19a98cdb1ff98f37bc07ecec9eb97bd8ff20a206 100644 (file)
@@ -19,7 +19,7 @@
 # Test single stepping through atomic sequences beginning with
 # a ldxr instruction and ending with a stxr instruction.
 
-if {![istarget "aarch64*"]} {
+if {![is_aarch64_target]} {
     verbose "Skipping ${gdb_test_file_name}."
     return
 }
index 0cd734f7aeadf6d67cca08f01e80f42af9507aaf..aaf56405a687f829b51bed0543773178013416d3 100644 (file)
@@ -19,7 +19,7 @@
 # PR server/17457
 # Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
 
-if {![istarget "aarch64*"]} {
+if {![is_aarch64_target]} {
     verbose "Skipping ${gdb_test_file_name}."
     return
 }
index a7183cfa6d560511385991ec543c127ba5045b1d..91c2d45a4449aa80239d0dd4398b1ed44636cce6 100644 (file)
@@ -36,7 +36,7 @@ if ![runto_main] then {
 
 # Test "info float".
 
-if { [istarget "aarch64*-*-*"] } then {
+if { [is_aarch64_target] } then {
     gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*" "info float"
 } elseif { [istarget "alpha*-*-*"] } then {
     gdb_test "info float" "f0.*" "info float"
index 800645e02ddcc72094ae2ccfc4514d82fc7388e4..1c5f181e2730b6e8424d65a34dc797ad3c1a17d2 100644 (file)
@@ -19,7 +19,7 @@ if ![supports_reverse] {
 
 # Test aarch64 instruction recording.
 
-if {![istarget "aarch64*-*-*"]} then {
+if {![is_aarch64_target]} then {
     verbose "Skipping aarch64 instruction recording tests."
     return
 }
index e8ae08c483ebf7622f2ecd1ee6d6820a07ebb51e..0805de9c3e938dd12761a07caafc390994bb7232 100644 (file)
@@ -2308,6 +2308,16 @@ gdb_caching_proc is_aarch32_target {
     return 1
 }
 
+# Return 1 if this target is an aarch64, either lp64 or ilp32.
+
+proc is_aarch64_target {} {
+    if { ![istarget "aarch64*-*-*"] } {
+       return 0
+    }
+
+    return [expr ![is_aarch32_target]]
+}
+
 # Return 1 if displaced stepping is supported on target, otherwise, return 0.
 proc support_displaced_stepping {} {