From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15600 invoked by alias); 14 Mar 2010 22:02:23 -0000 Received: (qmail 15418 invoked by uid 22791); 14 Mar 2010 22:02:20 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 14 Mar 2010 22:02:12 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id C3C361B4017; Sun, 14 Mar 2010 22:02:10 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Cc: Jie Zhang Subject: [PATCH] sim: tests: support .S files Date: Sun, 14 Mar 2010 22:02:00 -0000 Message-Id: <1268604229-26466-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00508.txt.bz2 From: Jie Zhang 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 Signed-off-by: Mike Frysinger --- 2010-03-14 Jie Zhang * lib/sim-defs.exp (run_sim_test): Run source file through preprocessor when it matches "*.S". 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 3cef394..9314f2f 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -301,7 +301,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.0