This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] |
My original attempt at writing options.exp didn't work for Hans-Peter Nilsson, as his target uses testglue. Using -xc was causing problems when reading testglue.o as a C program :-) Here is a patch that creates a real C program and links it into a real executable, deleting both afterwards. Okay for mainline?
* gcc.misc-tests/options.exp (check_for_options): Create a real C program, compile it into a real executable and then delete the .c and .x files afterwards, to avoid problems on testglue targets.
Index: options.exp =================================================================== RCS file: /home/bje/gcc-cvs/gcc/gcc/testsuite/gcc.misc-tests/options.exp,v retrieving revision 1.1 diff -u -p -r1.1 options.exp --- options.exp 4 Mar 2005 05:15:52 -0000 1.1 +++ options.exp 15 Mar 2005 05:03:34 -0000 @@ -20,15 +20,20 @@ # respectively.
proc check_for_options {language gcc_options compiler_pattern as_pattern ld_pat tern} { + set fd [open test.c w] + puts $fd "int main() \{ return 0; \}" + close $fd + remote_download host test.c + set test "compiler driver $gcc_options option(s)" set gcc_options "\{additional_flags=$gcc_options -v\}" - set src "-x$language /dev/null"
switch "$language" { "c" { set compiler cc1 } default { error "unknown language" } } - set gcc_output [gcc_target_compile $src /dev/null executable $gcc_options] + set gcc_output [gcc_target_compile test.c test.x executable $gcc_options] + remote_file build delete test.c test.x
if {![regexp -- "/$compiler -quiet.*$compiler_pattern" $gcc_output]} { fail "$test (compiler options)"
Attachment:
signature.asc
Description: OpenPGP digital signature
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |