This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sim: tests: support .S files
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Cc: toolchain-devel at blackfin dot uclinux dot org, Jie Zhang <jie at codesourcery dot com>
- Date: Sun, 13 Mar 2011 19:10:48 -0400
- Subject: [PATCH] sim: tests: support .S files
From: Jie Zhang <jie@codesourcery.com>
Rather than requiring all sim tests to be preprocessed .s files, add
support for .S files so we can easily write code using normal CPP
defines/macros.
Signed-off-by: Jie Zhang <jie@codesourcery.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
sim/testsuite/lib/sim-defs.exp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 1e65817..eacdf76 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -310,7 +310,18 @@ proc run_sim_test { name requested_machs } {
if [info exists cpu_option] {
set as_options "$as_options $cpu_option=$mach"
}
- set comp_output [target_assemble $sourcefile ${name}.o "$as_options $global_as_options"]
+ if [string match "*.S" $sourcefile] {
+ set comp_output [target_compile $sourcefile ${name}.s "preprocess" "incdir=$srcdir/$subdir"]
+ if ![string match "" $comp_output] {
+ verbose -log "$comp_output" 3
+ fail "$mach $testname (preprocessing)"
+ continue
+ }
+ set comp_output [target_assemble ${name}.s ${name}.o "$as_options $global_as_options"]
+ file delete ${name}.s
+ } else {
+ set comp_output [target_assemble $sourcefile ${name}.o "$as_options $global_as_options"]
+ }
if ![string match "" $comp_output] {
verbose -log "$comp_output" 3
--
1.7.4.1