This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Adjust gdb.multi tests for aarch64


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71be1fdc3655a170f4b14d795e5c9e81fcea06ef

commit 71be1fdc3655a170f4b14d795e5c9e81fcea06ef
Author: Yao Qi <yao.qi@linaro.org>
Date:   Tue Jul 7 16:58:19 2015 +0100

    Adjust gdb.multi tests for aarch64
    
    Multi-arch related tests under gdb.multi are to compile programs with
    the same compiler but different compiler options (-m64 vs -m32).  However,
    different compilers are needed to compile both aarch64 program and
    arm (aarch32) program.  This patch is to adjust these test cases to
    compile programs in different modes with different compiler.
    
    When we use gcc for arm-linux target, its file name can be different,
    arm-linux-gnueabihf-gcc, arm-linux-gnueabi-gcc, or arm-none-linux-gnueabi-gcc,
    so I add a variable ARM_CC_FOR_TARGET, so that user can set the name
    of gcc for arm-linux target on aarch64, like:
    
     $ make check RUNTESTFLAGS='ARM_CC_FOR_TARGET=arm-linux-gnueabihf-gcc multi-arch.exp'
    
    gdb/testsuite:
    
    2015-07-07  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
    	is aarch64.  If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
    	if it exists.
    	* gdb.multi/multi-arch.exp: Likewise.

Diff:
---
 gdb/testsuite/ChangeLog                     |  7 +++++++
 gdb/testsuite/gdb.multi/multi-arch-exec.exp | 18 +++++++++++++++++-
 gdb/testsuite/gdb.multi/multi-arch.exp      | 18 +++++++++++++++++-
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 5222118..a658090 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-07  Yao Qi  <yao.qi@linaro.org>
+
+	* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
+	is aarch64.  If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
+	if it exists.
+	* gdb.multi/multi-arch.exp: Likewise.
+
 2015-07-07  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* gdb.python/py-lazy-string.exp: Add missing parentheses to
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 4532108..67020d9 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -44,6 +44,9 @@ set binfile2 [standard_output_file ${exec2}]
 if [istarget "s390*-*-*"] {
     set march1 "-m64"
     set march2 "-m31"
+} elseif { [istarget "aarch64*-*-*"] } {
+    set march1 ""
+    set march2 ""
 } else {
     set march1 "-m64"
     set march2 "-m32"
@@ -57,8 +60,21 @@ if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
     return -1
 }
 
+set options [list debug nowarnings]
+
+if { [istarget "aarch64*-*-*"] } {
+    if {[info exists ARM_CC_FOR_TARGET]} {
+	lappend options "compiler=${ARM_CC_FOR_TARGET}"
+    } else {
+	unsupported "ARM compiler is not known"
+	return -1
+    }
+} else {
+    lappend options "additional_flags=${march2}"
+}
+
 if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
-	  [list debug nowarnings additional_flags=${march2}]] } {
+	  $options] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index 22ad4da..4b255ee 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -44,6 +44,9 @@ set binfile2 [standard_output_file ${exec2}]
 if [istarget "s390*-*-*"] {
     set march1 "-m64"
     set march2 "-m31"
+} elseif { [istarget "aarch64*-*-*"] } {
+    set march1 ""
+    set march2 ""
 } else {
     set march1 "-m64"
     set march2 "-m32"
@@ -54,8 +57,21 @@ if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
     return -1
 }
 
+set options [list debug nowarnings]
+
+if [istarget "aarch64*-*-*"] {
+    if {[info exists ARM_CC_FOR_TARGET]} {
+	lappend options "compiler=${ARM_CC_FOR_TARGET}"
+    } else {
+	unsupported "ARM compiler is not known"
+	return -1
+    }
+} else {
+    lappend options "additional_flags=${march2}"
+}
+
 if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" \
-	  [list debug nowarnings additional_flags=${march2}]] } {
+	 $options]} {
     return -1
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]