* gcc.misc-tests/options.exp (check_for_options): Create a real C
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Mar 2005 00:15:32 +0000 (00:15 +0000)
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 22 Mar 2005 00:15:32 +0000 (00:15 +0000)
program, compile it into a real executable and then delete the .c
and .x files afterwards, to avoid problems on testglue targets.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96844 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.misc-tests/options.exp

index dd6774b..4c5939e 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-22  Ben Elliston  <bje@au.ibm.com>
+
+       * 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.
+
 2005-03-21  Stuart Hastings  <stuart@apple.com>
 
        * gcc.target/i386/sse-2.c: New.
index 9a0f9e4..1405513 100644 (file)
 # respectively.
 
 proc check_for_options {language gcc_options compiler_pattern as_pattern ld_pattern} {
+    set filename test-[pid]
+    set fd [open $filename.c w]
+    puts $fd "int main (void) \{ return 0; \}"
+    close $fd
+    remote_download host $filename.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 $filename.c $filename.x executable $gcc_options]
+    remote_file build delete $filename.c $filename.x $filename.gcno
 
     if {![regexp -- "/$compiler -quiet.*$compiler_pattern" $gcc_output]} {
        fail "$test (compiler options)"