This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

PATCH: Run 32bit and 64bit CFI tests for x86 targets


I am checking in this patch to run 32bit and 64bit CFI tests for x86
targets if they are supportd.


H.J.
----
2008-02-18  H.J. Lu  <hongjiu.lu@intel.com>

	* cfi/cfi.exp (gas_x86_64_check): New.
	(gas_x86_32_check): Likewise.
	Run 32bit and 64bit tests for x86 targets if they are supportd.

--- gas/cfi/cfi.exp.x86	2007-08-28 06:49:03.000000000 -0700
+++ gas/cfi/cfi.exp	2008-02-18 13:00:21.000000000 -0800
@@ -2,11 +2,38 @@ if ![is_elf_format] then {
     return
 }
 
-if [istarget "x86_64-*"] then {
-    run_dump_test "cfi-x86_64"
+proc gas_x86_64_check { } {
+    global NM
+    global NMFLAGS
+
+    set status [gas_host_run "$NM $NMFLAGS --help" ""]
+    return [regexp "targets:.*x86-64" [lindex $status 1]];
+}
+
+proc gas_x86_32_check { } {
+    global NM
+    global NMFLAGS
 
-} elseif [istarget "i?86-*"] then {
-    run_dump_test "cfi-i386"
+    set status [gas_host_run "$NM $NMFLAGS --help" ""]
+    return [regexp "targets:.*i386" [lindex $status 1]];
+}
+
+if  { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then {
+
+    global ASFLAGS
+    set old_ASFLAGS "$ASFLAGS"
+
+    if { [gas_x86_64_check] } then {
+	set ASFLAGS "$ASFLAGS --64"
+	run_dump_test "cfi-x86_64"
+	set ASFLAGS "$old_ASFLAGS"
+    }
+
+    if { [gas_x86_32_check] }  then {
+	set ASFLAGS "$ASFLAGS --32"
+	run_dump_test "cfi-i386"
+	set ASFLAGS "$old_ASFLAGS"
+    }
 
 } elseif { [istarget alpha*-*-*] } then {
     run_dump_test "cfi-alpha-1"


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