1 # Test procedures in lib/target.exp. -*- Tcl -*-
3 # Copyright (C) 1996-2019, 2020 Free Software Foundation, Inc.
5 # This file is part of DejaGnu.
7 # DejaGnu is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # DejaGnu is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with DejaGnu; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
21 if [ file exists $srcdir/$subdir/default_procs.tcl ] {
22 source $srcdir/$subdir/default_procs.tcl
24 puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
27 if [ file exists $srcdir/$subdir/mockutil.tcl ] {
28 source $srcdir/$subdir/mockutil.tcl
30 puts "ERROR: $srcdir/$subdir/mockutil.tcl doesn't exist"
33 proc load_lib { lib } {
35 source $srcdir/../lib/$lib
38 foreach lib { targetdb target } {
39 set file $srcdir/../lib/${lib}.exp
40 if [ file exists $file] {
43 puts "ERROR: $file doesn't exist"
48 # Create a false board config array
50 set board_info(idp,name) "idp"
51 set board_info(idp,ldscript) "-Tidp.ld"
52 set board_info(idp,config) m68k-unknown-aout
54 set board_info(mvme,name) "mvme"
55 set board_info(mvme,ldscript) "-Tmvme.ld"
56 set board_info(mvme,config) m68k-unknown-aout
57 # testing default host
58 set board_info(unix,cflags_for_target) "-DUNIX_CROSS_BUILD"
61 # Test push_config/pop_config
64 # test push_config target
65 push_config target idp
66 if { $target_info(target,name) eq "idp" } {
67 puts "PASSED: push_config target"
69 puts "FAILED: push_config target"
72 # test pop_config target
74 if { ![info exists target_info(target,name)] } {
75 puts "PASSED: pop_config target"
77 puts "FAILED: pop_config target"
81 if { $target_info(host,name) eq "idp" } {
82 puts "PASSED: push_config target"
84 puts "FAILED: push_config target"
87 # test pop_config host
89 if { ![info exists target_info(host,name)] } {
90 puts "PASSED: pop_config host"
92 puts "FAILED: pop_config host"
96 # Test default_target_compile
99 # init call trace list
101 # build test environment
102 create_test_interpreter compile_test {
103 copy_procs { default_target_compile }
104 link_procs { verbose }
105 shim_procs { board_info host_info target_info }
107 build_triplet "bogus-build-host"
108 host_triplet "bogus-test-host"
109 target_triplet "bogus-test-target"
113 which { what } { $what }
114 remote_exec { args } { [list 0 "<exec_output>"] }
116 prune_warnings { text } { $text }
117 # avoid the losing search for a libstdc++
118 isnative { args } { 0 }
119 # provide the special cases for C++
120 g++_include_flags { } { " -I/usr/include/g++" }
121 g++_link_flags { } { " -L/usr/lib/g++" }
122 # force local mode for initial testing
123 isremote { args } { 0 }
126 # mock find_* procedures from libgloss.exp
127 foreach { prog } { gcc gcj g++ gdc g77 gfortran go go_linker rustc gnatmake
129 establish_mock compile_test find_$prog {} [list found-$prog]
133 # each item in testlist: { name code checks... }
134 proc eval_tests { sicmd testlist } {
135 set testlist [strip_comment_lines $testlist]
136 foreach { test } $testlist {
137 if { [llength $test] > 2 } {
138 eval [list test_proc_with_mocks [lindex $test 0] $sicmd \
139 [lindex $test 1]] [lrange $test 2 end]
141 $sicmd eval [lindex $test 1]
147 push_config target idp
149 eval_tests compile_test {
150 { "host defaults to 'unix' if not set"
151 { default_target_compile "foo.c" "foo.o" object {} }
153 "board_info unix" * { 2 exists 3 cflags_for_target }
154 "board_info unix" * { 2 cflags_for_target }
156 { 2 {found-gcc -DUNIX_CROSS_BUILD -c -o foo.o foo.c} }
162 push_config host mvme
164 eval_tests compile_test {
165 { "query compiler configuration"
166 # This is an example adapted from the GCC testsuite.
167 { default_target_compile "-dumpspecs" "" none {} }
169 "remote_exec host" U { 2 {found-gcc -dumpspecs\s*} }
174 eval_tests compile_test {
175 { "minimal simple preprocess"
176 { default_target_compile "foo.c" "" preprocess {} }
178 "remote_exec host" U { 2 {found-gcc foo.c -E} }
181 { "minimal simple preprocess with output redirection"
182 { default_target_compile "foo.c" "" preprocess {
186 "remote_exec host" U {
187 2 {found-gcc foo.c -E}
192 { "minimal simple preprocess with timeout"
193 { default_target_compile "foo.c" "" preprocess {
197 "remote_exec host" U {
198 2 {found-gcc foo.c -E}
203 { "minimal simple compile to assembly"
204 { default_target_compile "foo.c" "foo.s" assembly {} }
206 "remote_exec host" U { 2 {found-gcc foo.c -S -o foo.s} }
209 { "minimal simple compile to object"
210 { default_target_compile "foo.c" "foo.o" object {} }
212 "remote_exec host" U { 2 {found-gcc -c -o foo.o foo.c} }
215 { "minimal simple compile and link"
216 { default_target_compile "foo.c" "foo" executable {} }
218 "remote_exec host" U { 2 {found-gcc foo.c -lm -Tidp.ld -o foo} }
221 { "minimal simple compile and link with debug option"
222 { default_target_compile "foo.c" "foo" executable {debug} }
224 "remote_exec host" U { 2 {found-gcc foo.c -g -lm -Tidp.ld -o foo} }
228 { "minimal simple preprocess with early flags"
229 { default_target_compile "foo.c" "" preprocess {
230 "early_flags=-fearly"
233 "remote_exec host" U { 2 {found-gcc -fearly foo.c -E} }
236 { "minimal simple compile to assembly with early flags"
237 { default_target_compile "foo.c" "foo.s" assembly {
238 "early_flags=-fearly"
241 "remote_exec host" U { 2 {found-gcc -fearly foo.c -S -o foo.s} }
244 { "minimal simple compile to object with early flags"
245 { default_target_compile "foo.c" "foo.o" object {
246 "early_flags=-fearly"
249 "remote_exec host" U { 2 {found-gcc -fearly -c -o foo.o foo.c} }
252 { "minimal simple compile and link with early flags"
253 { default_target_compile "foo.c" "foo" executable {
254 "early_flags=-fearly"
257 "remote_exec host" U { 2 {found-gcc -fearly foo.c -lm -Tidp.ld -o foo} }
262 # add more keys to the board_info array for a more complex target description
263 set board_info(idp,cflags) "-I/usr/gnemul/idp/include"
264 set board_info(idp,compiler) "$board_info(idp,config)-gcc"
265 set board_info(idp,debug_flags) "-ggdb"
266 set board_info(idp,ldflags) "-L/usr/gnemul/idp/lib"
267 set board_info(idp,libs) "-lidpsup"
268 set board_info(idp,mathlib) "-lm_idp"
269 set board_info(idp,multilib_flags) "-midp"
271 eval_tests compile_test {
272 { "preprocess with target compiler"
273 { default_target_compile "foo.c" "" preprocess {} }
278 {m68k-unknown-aout-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
281 { "compile to assembly with target compiler"
282 { default_target_compile "foo.c" "foo.s" assembly {} }
286 { 2 {m68k-unknown-aout-gcc foo.c -midp -S -I/usr/gnemul/idp/include
290 { "compile to object with target compiler"
291 { default_target_compile "foo.c" "foo.o" object {} }
295 { 2 {m68k-unknown-aout-gcc -midp -c -I/usr/gnemul/idp/include
299 { "compile and link with target compiler"
300 { default_target_compile "foo.c" "foo" executable {} }
304 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
305 -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld -o foo} }
308 { "compile and link with target compiler and target debug"
309 { default_target_compile "foo.c" "foo" executable {debug} }
313 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
314 -L/usr/gnemul/idp/lib -ggdb -lidpsup -lm_idp -Tidp.ld -o foo} }
319 # add a few more keys for the remaining cases...
320 set board_info(idp,remote_link) idp_remote_link
321 set board_info(idp,output_format) coff
323 eval_tests compile_test {
324 { "compile and link for remote linking"
325 { default_target_compile "foo.c" "foo" executable {} }
329 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
330 -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld
331 -Wl,-r -Wl,-oformat,coff -o foo} }
334 { "compile and link for remote linking with debug"
335 { default_target_compile "foo.c" "foo" executable {debug} }
339 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
340 -L/usr/gnemul/idp/lib -ggdb -lidpsup -lm_idp -Tidp.ld
341 -Wl,-r -Wl,-oformat,coff -o foo} }
346 # simplify by removing the most unusual options
347 unset board_info(idp,remote_link) board_info(idp,output_format)
349 eval_tests compile_test {
350 { "setup CFLAGS_FOR_TARGET"
351 { set CFLAGS_FOR_TARGET "-DTARGET_FLAG" }
353 { "preprocess with target compiler and CFLAGS_FOR_TARGET"
354 { default_target_compile "foo.c" "" preprocess {} }
359 {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG -E
360 -I/usr/gnemul/idp/include} }
363 { "compile to assembly with target compiler and CFLAGS_FOR_TARGET"
364 { default_target_compile "foo.c" "foo.s" assembly {} }
368 { 2 {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG -S
369 -I/usr/gnemul/idp/include -o foo.s} }
372 { "compile to object with target compiler and CFLAGS_FOR_TARGET"
373 { default_target_compile "foo.c" "foo.o" object {} }
377 { 2 {m68k-unknown-aout-gcc -midp -DTARGET_FLAG -c
378 -I/usr/gnemul/idp/include -o foo.o foo.c} }
381 { "compile and link with target compiler and CFLAGS_FOR_TARGET"
382 { default_target_compile "foo.c" "foo" executable {} }
386 { 2 {m68k-unknown-aout-gcc foo.c -midp -DTARGET_FLAG
387 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
388 -lidpsup -lm_idp -Tidp.ld -o foo} }
391 { "clean up CFLAGS_FOR_TARGET"
392 { unset CFLAGS_FOR_TARGET }
394 { "setup LDFLAGS_FOR_TARGET"
395 { set LDFLAGS_FOR_TARGET "-ltarget" }
397 { "preprocess with target compiler and LDFLAGS_FOR_TARGET"
398 { default_target_compile "foo.c" "" preprocess {} }
403 {m68k-unknown-aout-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
406 { "compile to assembly with target compiler and LDFLAGS_FOR_TARGET"
407 { default_target_compile "foo.c" "foo.s" assembly {} }
411 { 2 {m68k-unknown-aout-gcc foo.c -midp -S -I/usr/gnemul/idp/include
415 { "compile to object with target compiler and LDFLAGS_FOR_TARGET"
416 { default_target_compile "foo.c" "foo.o" object {} }
420 { 2 {m68k-unknown-aout-gcc -midp -c -I/usr/gnemul/idp/include
424 { "compile and link with target compiler and LDFLAGS_FOR_TARGET"
425 { default_target_compile "foo.c" "foo" executable {} }
429 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/gnemul/idp/include
430 -L/usr/gnemul/idp/lib -ltarget -lidpsup -lm_idp -Tidp.ld
434 { "clean up LDFLAGS_FOR_TARGET"
435 { unset LDFLAGS_FOR_TARGET }
437 { "setup CC_FOR_TARGET"
438 { set CC_FOR_TARGET "target-gcc" }
440 { "preprocess with CC_FOR_TARGET"
441 { default_target_compile "foo.c" "" preprocess {} }
444 "remote_exec host" U { 2
445 {target-gcc foo.c -midp -E -I/usr/gnemul/idp/include} }
448 { "compile to assembly with CC_FOR_TARGET"
449 { default_target_compile "foo.c" "foo.s" assembly {} }
453 { 2 {target-gcc foo.c -midp -S -I/usr/gnemul/idp/include
457 { "compile to object with CC_FOR_TARGET"
458 { default_target_compile "foo.c" "foo.o" object {} }
462 { 2 {target-gcc -midp -c -I/usr/gnemul/idp/include
466 { "compile and link with CC_FOR_TARGET"
467 { default_target_compile "foo.c" "foo" executable {} }
471 { 2 {target-gcc foo.c -midp -I/usr/gnemul/idp/include
472 -L/usr/gnemul/idp/lib -lidpsup -lm_idp -Tidp.ld -o foo} }
475 { "clean up CC_FOR_TARGET"
476 { unset CC_FOR_TARGET }
480 eval_tests compile_test {
481 { "override destination to host and compile and link"
482 { default_target_compile "foo.c" "foo" executable {"dest=host"} }
484 "board_info host" * { 2 exists 3 name }
485 "board_info host" * { 2 name }
487 { 2 {found-gcc foo.c -lm -Tmvme.ld -o foo} }
490 { "override destination to host and compile and link with host-gcc"
491 { default_target_compile "foo.c" "foo" executable {
492 "dest=host" "compiler=host-gcc"
496 "board_info host" * { 2 exists 3 name }
497 "board_info host" * { 2 name }
499 { 2 {host-gcc foo.c -lm -Tmvme.ld -o foo} }
502 { "override destination to host and compile and link with host-gcc via linker"
503 { default_target_compile "foo.c" "foo" executable {
504 "dest=host" "linker=host-gcc"
508 "board_info host" * { 2 exists 3 name }
509 "board_info host" * { 2 name }
511 { 2 {host-gcc foo.c -lm -Tmvme.ld -o foo} }
514 { "override destination to host and compile and link with host-gcc-ld via linker"
515 { default_target_compile "foo.c" "foo" executable {
516 "dest=host" "compiler=host-gcc" "linker=host-gcc-ld"
520 "board_info host" * { 2 exists 3 name }
521 "board_info host" * { 2 name }
523 { 2 {host-gcc-ld foo.c -lm -Tmvme.ld -o foo} }
526 { "override ldscript"
527 { default_target_compile "foo.c" "foo" executable {
528 "ldscript=-Tspecial.ld"
532 { 2 {m68k-unknown-aout-gcc foo.c -midp
533 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
534 -lidpsup -lm_idp -Tspecial.ld -o foo} }
539 eval_tests compile_test {
540 { "insert additional flags"
541 { default_target_compile "foo.c" "foo" executable {
542 "additional_flags=-fextra-flag-for-test"
546 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
547 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
548 -lidpsup -lm_idp -Tidp.ld -o foo} }
551 { "insert additional flags and ldflags"
552 { default_target_compile "foo.c" "foo" executable {
553 "additional_flags=-fextra-flag-for-test"
554 "ldflags=-Wl,--extra-linker-flag"
558 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
559 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
560 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
563 { "insert additional flags, ldflags, and incdir"
564 { default_target_compile "foo.c" "foo" executable {
565 "additional_flags=-fextra-flag-for-test"
566 "ldflags=-Wl,--extra-linker-flag"
567 "incdir=/usr/test/include"
571 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
573 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
574 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
577 { "insert additional flags, ldflags, and incdirs"
578 { default_target_compile "foo.c" "foo" executable {
579 "additional_flags=-fextra-flag-for-test"
580 "ldflags=-Wl,--extra-linker-flag"
581 "incdir=/usr/test/include" "incdir=/usr/test/include2"
585 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
586 -I/usr/test/include -I/usr/test/include2
587 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
588 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
591 { "insert additional flags, ldflags, incdirs, and libdir"
592 { default_target_compile "foo.c" "foo" executable {
593 "additional_flags=-fextra-flag-for-test"
594 "ldflags=-Wl,--extra-linker-flag"
595 "incdir=/usr/test/include" "incdir=/usr/test/include2"
596 "libdir=/usr/test/lib"
600 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
601 -I/usr/test/include -I/usr/test/include2
603 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
604 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
607 { "insert additional flags, ldflags, incdirs, and libdirs"
608 { default_target_compile "foo.c" "foo" executable {
609 "additional_flags=-fextra-flag-for-test"
610 "ldflags=-Wl,--extra-linker-flag"
611 "incdir=/usr/test/include" "incdir=/usr/test/include2"
612 "libdir=/usr/test/lib" "libdir=/usr/test/lib2"
616 { 2 {m68k-unknown-aout-gcc foo.c -midp -fextra-flag-for-test
617 -I/usr/test/include -I/usr/test/include2
618 -L/usr/test/lib -L/usr/test/lib2
619 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
620 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
623 { "insert additional flags, ldflags, incdirs, and libdirs shuffled"
624 { default_target_compile "foo.c" "foo" executable {
625 "incdir=/usr/test/include"
626 "additional_flags=-fextra-flag-for-test" "libdir=/usr/test/lib"
627 "ldflags=-Wl,--extra-linker-flag"
628 "additional_flags=-fanother-extra-flag"
629 "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
633 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
634 -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
635 -I/usr/test/include2 -L/usr/test/lib2
636 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
637 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
640 { "previous test with optimization flag added"
641 { default_target_compile "foo.c" "foo" executable {
642 "incdir=/usr/test/include" "optimize=-O2 -foptimize"
643 "additional_flags=-fextra-flag-for-test" "libdir=/usr/test/lib"
644 "ldflags=-Wl,--extra-linker-flag"
645 "additional_flags=-fanother-extra-flag"
646 "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
650 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
651 -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
652 -I/usr/test/include2 -L/usr/test/lib2
653 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
655 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
658 { "previous test with optimization flag added and debugging selected"
659 { default_target_compile "foo.c" "foo" executable {
660 "incdir=/usr/test/include" "debug"
661 "additional_flags=-fextra-flag-for-test" "libdir=/usr/test/lib"
662 "ldflags=-Wl,--extra-linker-flag" "optimize=-O2 -foptimize-debug"
663 "additional_flags=-fanother-extra-flag"
664 "incdir=/usr/test/include2" "libdir=/usr/test/lib2"
668 { 2 {m68k-unknown-aout-gcc foo.c -midp -I/usr/test/include
669 -fextra-flag-for-test -L/usr/test/lib -fanother-extra-flag
670 -I/usr/test/include2 -L/usr/test/lib2
671 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
672 -ggdb -O2 -foptimize-debug
673 -Wl,--extra-linker-flag -lidpsup -lm_idp -Tidp.ld -o foo} }
678 # add more keys to the board_info array for testing other language support
679 set board_info(idp,adaflags) "-fada"
680 set board_info(idp,cxxflags) "-fgnu-c++"
681 set board_info(idp,dflags) "-fdflag"
682 set board_info(idp,f77flags) "-flong-f77-flag"
683 set board_info(idp,f90flags) "-flonger-f90-flag"
684 set board_info(idp,goflags) "-fgo"
685 set board_info(idp,rustflags) "-frust"
687 gnatmake gnatmake c++compiler g++ dcompiler gdc
688 f77compiler g77 f90compiler gfortran rustcompiler rustc
689 gocompiler gccgo golinker gccgo-ld
690 } { set board_info(idp,$k) "$board_info(idp,config)-$v" }
692 eval_tests compile_test {
695 # TODO FIXME: These tests verify the currently-known-broken Ada support.
696 { "preprocess Ada with target compiler"
697 { default_target_compile "foo.adb" "" preprocess {ada} }
702 { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -largs -midp -margs
703 -fada -E -I/usr/gnemul/idp/include} }
706 { "compile Ada to assembly with target compiler"
707 { default_target_compile "foo.adb" "foo.s" assembly {ada} }
712 { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -largs -midp -margs
713 -fada -S -I/usr/gnemul/idp/include -o foo.s} }
716 { "compile Ada to object with target compiler"
717 { default_target_compile "foo.adb" "foo.o" object {ada} }
722 { 2 {m68k-unknown-aout-gnatmake -midp -largs -midp -margs -fada
723 -c -I/usr/gnemul/idp/include
727 { "compile and link Ada with target compiler"
728 { default_target_compile "foo.adb" "foo" executable {ada} }
733 { 2 {m68k-unknown-aout-gnatmake foo.adb -midp -largs -midp -margs
734 -fada -I/usr/gnemul/idp/include -largs -L/usr/gnemul/idp/lib
735 -margs -largs -lidpsup -lm_idp -Tidp.ld -margs -o foo} }
739 { "setup GNATMAKE_FOR_TARGET"
740 { set GNATMAKE_FOR_TARGET "target-gnatmake" }
742 { "preprocess Ada with GNATMAKE_FOR_TARGET"
743 { default_target_compile "foo.adb" "" preprocess {ada} }
748 { 2 {target-gnatmake foo.adb -midp -largs -midp -margs -fada
749 -E -I/usr/gnemul/idp/include} }
752 { "compile Ada to assembly with GNATMAKE_FOR_TARGET"
753 { default_target_compile "foo.adb" "foo.s" assembly {ada} }
758 { 2 {target-gnatmake foo.adb -midp -largs -midp -margs -fada
759 -S -I/usr/gnemul/idp/include -o foo.s} }
762 { "compile Ada to object with GNATMAKE_FOR_TARGET"
763 { default_target_compile "foo.adb" "foo.o" object {ada} }
768 { 2 {target-gnatmake -midp -largs -midp -margs -fada
769 -c -I/usr/gnemul/idp/include
773 { "compile and link Ada with GNATMAKE_FOR_TARGET"
774 { default_target_compile "foo.adb" "foo" executable {ada} }
779 { 2 {target-gnatmake foo.adb -midp -largs -midp -margs -fada
780 -I/usr/gnemul/idp/include -largs -L/usr/gnemul/idp/lib -margs
781 -largs -lidpsup -lm_idp -Tidp.ld -margs -o foo} }
784 { "clean up GNATMAKE_FOR_TARGET"
785 { unset GNATMAKE_FOR_TARGET }
788 { "override destination to host and compile and link Ada"
789 { default_target_compile "foo.adb" "foo" executable {
794 { 2 {found-gnatmake foo.adb -largs -lm -Tmvme.ld -margs -o foo} }
797 { "override destination to host and compile and link Ada with host-gnatmake"
798 { default_target_compile "foo.adb" "foo" executable {
799 "dest=host" ada "compiler=host-gnatmake"
803 { 2 {host-gnatmake foo.adb -largs -lm -Tmvme.ld -margs -o foo} }
808 { "preprocess C++ with target compiler"
809 { default_target_compile "foo.cxx" "" preprocess {c++} }
814 { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
815 -I/usr/include/g\+\+ -E -I/usr/gnemul/idp/include} }
818 { "compile C++ to assembly with target compiler"
819 { default_target_compile "foo.cxx" "foo.s" assembly {c++} }
824 { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
825 -I/usr/include/g\+\+ -S -I/usr/gnemul/idp/include -o foo.s} }
828 { "compile C++ to object with target compiler"
829 { default_target_compile "foo.cxx" "foo.o" object {c++} }
834 { 2 {m68k-unknown-aout-g\+\+ -midp -fgnu-c\+\+
835 -I/usr/include/g\+\+ -c -I/usr/gnemul/idp/include
839 { "compile and link C++ with target compiler"
840 { default_target_compile "foo.cxx" "foo" executable {c++} }
845 { 2 {m68k-unknown-aout-g\+\+ foo.cxx -midp -fgnu-c\+\+
846 -I/usr/include/g\+\+ -I/usr/gnemul/idp/include
847 -L/usr/gnemul/idp/lib -L/usr/lib/g\+\+
848 -lidpsup -lm_idp -Tidp.ld -o foo} }
852 { "setup CXX_FOR_TARGET"
853 { set CXX_FOR_TARGET "target-g++" }
855 { "preprocess C++ with CXX_FOR_TARGET"
856 { default_target_compile "foo.cxx" "" preprocess {c++} }
861 { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
862 -I/usr/include/g\+\+ -E -I/usr/gnemul/idp/include} }
865 { "compile C++ to assembly with CXX_FOR_TARGET"
866 { default_target_compile "foo.cxx" "foo.s" assembly {c++} }
871 { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
872 -I/usr/include/g\+\+ -S -I/usr/gnemul/idp/include -o foo.s} }
875 { "compile C++ to object with CXX_FOR_TARGET"
876 { default_target_compile "foo.cxx" "foo.o" object {c++} }
881 { 2 {target-g\+\+ -midp -fgnu-c\+\+
882 -I/usr/include/g\+\+ -c -I/usr/gnemul/idp/include
886 { "compile and link C++ with CXX_FOR_TARGET"
887 { default_target_compile "foo.cxx" "foo" executable {c++} }
892 { 2 {target-g\+\+ foo.cxx -midp -fgnu-c\+\+
893 -I/usr/include/g\+\+ -I/usr/gnemul/idp/include
894 -L/usr/gnemul/idp/lib -L/usr/lib/g\+\+
895 -lidpsup -lm_idp -Tidp.ld -o foo} }
898 { "clean up CXX_FOR_TARGET"
899 { unset CXX_FOR_TARGET }
902 { "override destination to host and compile and link C++"
903 { default_target_compile "foo.cxx" "foo" executable {
908 { 2 {found-g\+\+ foo.cxx -I/usr/include/g\+\+ -L/usr/lib/g\+\+
909 -lm -Tmvme.ld -o foo} }
912 { "override destination to host and compile and link C++ with host-g++"
913 { default_target_compile "foo.cxx" "foo" executable {
914 "dest=host" c++ "compiler=host-g++"
918 { 2 {host-g\+\+ foo.cxx -I/usr/include/g\+\+ -L/usr/lib/g\+\+
919 -lm -Tmvme.ld -o foo} }
924 { "preprocess D with target compiler"
925 { default_target_compile "foo.d" "" preprocess {d} }
930 { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
931 -E -I/usr/gnemul/idp/include} }
934 { "compile D to assembly with target compiler"
935 { default_target_compile "foo.d" "foo.s" assembly {d} }
940 { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
941 -S -I/usr/gnemul/idp/include -o foo.s} }
944 { "compile D to object with target compiler"
945 { default_target_compile "foo.d" "foo.o" object {d} }
950 { 2 {m68k-unknown-aout-gdc -midp -fdflag
951 -c -I/usr/gnemul/idp/include
955 { "compile and link D with target compiler"
956 { default_target_compile "foo.d" "foo" executable {d} }
961 { 2 {m68k-unknown-aout-gdc foo.d -midp -fdflag
962 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
963 -lidpsup -lm_idp -Tidp.ld -o foo} }
967 { "setup D_FOR_TARGET"
968 { set D_FOR_TARGET "target-gdc" }
970 { "preprocess D with D_FOR_TARGET"
971 { default_target_compile "foo.d" "" preprocess {d} }
976 { 2 {target-gdc foo.d -midp -fdflag
977 -E -I/usr/gnemul/idp/include} }
980 { "compile D to assembly with D_FOR_TARGET"
981 { default_target_compile "foo.d" "foo.s" assembly {d} }
986 { 2 {target-gdc foo.d -midp -fdflag
987 -S -I/usr/gnemul/idp/include -o foo.s} }
990 { "compile D to object with D_FOR_TARGET"
991 { default_target_compile "foo.d" "foo.o" object {d} }
996 { 2 {target-gdc -midp -fdflag
997 -c -I/usr/gnemul/idp/include
1001 { "compile and link D with D_FOR_TARGET"
1002 { default_target_compile "foo.d" "foo" executable {d} }
1006 "remote_exec host" U
1007 { 2 {target-gdc foo.d -midp -fdflag
1008 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1009 -lidpsup -lm_idp -Tidp.ld -o foo} }
1012 { "clean up D_FOR_TARGET"
1013 { unset D_FOR_TARGET }
1016 { "override destination to host and compile and link D"
1017 { default_target_compile "foo.d" "foo" executable {
1021 "remote_exec host" U { 2 {found-gdc foo.d -lm -Tmvme.ld -o foo} }
1024 { "override destination to host and compile and link D with host-gdc"
1025 { default_target_compile "foo.d" "foo" executable {
1026 "dest=host" d "compiler=host-gdc"
1029 "remote_exec host" U { 2 {host-gdc foo.d -lm -Tmvme.ld -o foo} }
1034 { "preprocess Fortran 77 with target compiler"
1035 { default_target_compile "foo.f" "" preprocess {f77} }
1039 "remote_exec host" U
1040 { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
1041 -E -I/usr/gnemul/idp/include} }
1044 { "compile Fortran 77 to assembly with target compiler"
1045 { default_target_compile "foo.f" "foo.s" assembly {f77} }
1049 "remote_exec host" U
1050 { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
1051 -S -I/usr/gnemul/idp/include -o foo.s} }
1054 { "compile Fortran 77 to object with target compiler"
1055 { default_target_compile "foo.f" "foo.o" object {f77} }
1059 "remote_exec host" U
1060 { 2 {m68k-unknown-aout-g77 -midp -flong-f77-flag
1061 -c -I/usr/gnemul/idp/include
1065 { "compile and link Fortran 77 with target compiler"
1066 { default_target_compile "foo.f" "foo" executable {f77} }
1070 "remote_exec host" U
1071 { 2 {m68k-unknown-aout-g77 foo.f -midp -flong-f77-flag
1072 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1073 -lidpsup -lm_idp -Tidp.ld -o foo} }
1077 { "setup F77_FOR_TARGET"
1078 { set F77_FOR_TARGET "target-g77" }
1080 { "preprocess Fortran 77 with F77_FOR_TARGET"
1081 { default_target_compile "foo.f" "" preprocess {f77} }
1085 "remote_exec host" U
1086 { 2 {target-g77 foo.f -midp -flong-f77-flag
1087 -E -I/usr/gnemul/idp/include} }
1090 { "compile Fortran 77 to assembly with F77_FOR_TARGET"
1091 { default_target_compile "foo.f" "foo.s" assembly {f77} }
1095 "remote_exec host" U
1096 { 2 {target-g77 foo.f -midp -flong-f77-flag
1097 -S -I/usr/gnemul/idp/include -o foo.s} }
1100 { "compile Fortran 77 to object with F77_FOR_TARGET"
1101 { default_target_compile "foo.f" "foo.o" object {f77} }
1105 "remote_exec host" U
1106 { 2 {target-g77 -midp -flong-f77-flag
1107 -c -I/usr/gnemul/idp/include
1111 { "compile and link Fortran 77 with F77_FOR_TARGET"
1112 { default_target_compile "foo.f" "foo" executable {f77} }
1116 "remote_exec host" U
1117 { 2 {target-g77 foo.f -midp -flong-f77-flag
1118 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1119 -lidpsup -lm_idp -Tidp.ld -o foo} }
1122 { "clean up F77_FOR_TARGET"
1123 { unset F77_FOR_TARGET }
1126 { "override destination to host and compile and link Fortran 77"
1127 { default_target_compile "foo.f" "foo" executable {
1131 "remote_exec host" U { 2 {found-g77 foo.f -lm -Tmvme.ld -o foo} }
1134 { "override destination to host and compile and link Fortran 77 with host-g77"
1135 { default_target_compile "foo.f" "foo" executable {
1136 "dest=host" f77 "compiler=host-g77"
1139 "remote_exec host" U { 2 {host-g77 foo.f -lm -Tmvme.ld -o foo} }
1144 { "preprocess Fortran 90 with target compiler"
1145 { default_target_compile "foo.f90" "" preprocess {f90} }
1148 "find_gfortran" ! {}
1149 "remote_exec host" U
1150 { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
1151 -E -I/usr/gnemul/idp/include} }
1154 { "compile Fortran 90 to assembly with target compiler"
1155 { default_target_compile "foo.f90" "foo.s" assembly {f90} }
1158 "find_gfortran" ! {}
1159 "remote_exec host" U
1160 { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
1161 -S -I/usr/gnemul/idp/include -o foo.s} }
1164 { "compile Fortran 90 to object with target compiler"
1165 { default_target_compile "foo.f90" "foo.o" object {f90} }
1168 "find_gfortran" ! {}
1169 "remote_exec host" U
1170 { 2 {m68k-unknown-aout-gfortran -midp -flonger-f90-flag
1171 -c -I/usr/gnemul/idp/include
1175 { "compile and link Fortran 90 with target compiler"
1176 { default_target_compile "foo.f90" "foo" executable {f90} }
1179 "find_gfortran" ! {}
1180 "remote_exec host" U
1181 { 2 {m68k-unknown-aout-gfortran foo.f90 -midp -flonger-f90-flag
1182 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1183 -lidpsup -lm_idp -Tidp.ld -o foo} }
1187 { "setup F90_FOR_TARGET"
1188 { set F90_FOR_TARGET "target-gfortran" }
1190 { "preprocess Fortran 90 with F90_FOR_TARGET"
1191 { default_target_compile "foo.f90" "" preprocess {f90} }
1194 "find_gfortran" ! {}
1195 "remote_exec host" U
1196 { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
1197 -E -I/usr/gnemul/idp/include} }
1200 { "compile Fortran 90 to assembly with F90_FOR_TARGET"
1201 { default_target_compile "foo.f90" "foo.s" assembly {f90} }
1204 "find_gfortran" ! {}
1205 "remote_exec host" U
1206 { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
1207 -S -I/usr/gnemul/idp/include -o foo.s} }
1210 { "compile Fortran 90 to object with F90_FOR_TARGET"
1211 { default_target_compile "foo.f90" "foo.o" object {f90} }
1214 "find_gfortran" ! {}
1215 "remote_exec host" U
1216 { 2 {target-gfortran -midp -flonger-f90-flag
1217 -c -I/usr/gnemul/idp/include
1221 { "compile and link Fortran 90 with F90_FOR_TARGET"
1222 { default_target_compile "foo.f90" "foo" executable {f90} }
1225 "find_gfortran" ! {}
1226 "remote_exec host" U
1227 { 2 {target-gfortran foo.f90 -midp -flonger-f90-flag
1228 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1229 -lidpsup -lm_idp -Tidp.ld -o foo} }
1232 { "clean up F90_FOR_TARGET"
1233 { unset F90_FOR_TARGET }
1236 { "override destination to host and compile and link Fortran 77"
1237 { default_target_compile "foo.f90" "foo" executable {
1241 "remote_exec host" U
1242 { 2 {found-gfortran foo.f90 -lm -Tmvme.ld -o foo} }
1245 { "override destination to host and compile and link Fortran 90 with host-gfortran"
1246 { default_target_compile "foo.f90" "foo" executable {
1247 "dest=host" f90 "compiler=host-gfortran"
1250 "remote_exec host" U
1251 { 2 {host-gfortran foo.f90 -lm -Tmvme.ld -o foo} }
1256 { "preprocess Go with target compiler"
1257 { default_target_compile "foo.go" "" preprocess {go} }
1261 "find_go_linker" ! {}
1262 "remote_exec host" U
1263 { 2 {m68k-unknown-aout-gccgo foo.go -midp -fgo
1264 -E -I/usr/gnemul/idp/include} }
1267 { "compile Go to assembly with target compiler"
1268 { default_target_compile "foo.go" "foo.s" assembly {go} }
1272 "find_go_linker" ! {}
1273 "remote_exec host" U
1274 { 2 {m68k-unknown-aout-gccgo foo.go -midp -fgo
1275 -S -I/usr/gnemul/idp/include -o foo.s} }
1278 { "compile Go to object with target compiler"
1279 { default_target_compile "foo.go" "foo.o" object {go} }
1283 "find_go_linker" ! {}
1284 "remote_exec host" U
1285 { 2 {m68k-unknown-aout-gccgo -midp -fgo
1286 -c -I/usr/gnemul/idp/include
1290 { "compile and link Go with target compiler"
1291 { default_target_compile "foo.go" "foo" executable {go} }
1295 "find_go_linker" ! {}
1296 "remote_exec host" U
1297 { 2 {m68k-unknown-aout-gccgo-ld foo.go -midp -fgo
1298 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1299 -lidpsup -lm_idp -Tidp.ld -o foo} }
1303 { "setup GO_FOR_TARGET"
1304 { set GO_FOR_TARGET "target-gccgo" }
1306 { "preprocess Go with GO_FOR_TARGET"
1307 { default_target_compile "foo.go" "" preprocess {go} }
1311 "find_go_linker" ! {}
1312 "remote_exec host" U
1313 { 2 {target-gccgo foo.go -midp -fgo
1314 -E -I/usr/gnemul/idp/include} }
1317 { "compile Go to assembly with GO_FOR_TARGET"
1318 { default_target_compile "foo.go" "foo.s" assembly {go} }
1322 "find_go_linker" ! {}
1323 "remote_exec host" U
1324 { 2 {target-gccgo foo.go -midp -fgo
1325 -S -I/usr/gnemul/idp/include -o foo.s} }
1328 { "compile Go to object with GO_FOR_TARGET"
1329 { default_target_compile "foo.go" "foo.o" object {go} }
1333 "find_go_linker" ! {}
1334 "remote_exec host" U
1335 { 2 {target-gccgo -midp -fgo
1336 -c -I/usr/gnemul/idp/include
1340 { "clean up GO_FOR_TARGET"
1341 { unset GO_FOR_TARGET }
1343 { "setup GO_LD_FOR_TARGET"
1344 { set GO_LD_FOR_TARGET "target-gccgo-ld" }
1346 { "compile and link Go with GO_LD_FOR_TARGET"
1347 { default_target_compile "foo.go" "foo" executable {go} }
1351 "find_go_linker" ! {}
1352 "remote_exec host" U
1353 { 2 {target-gccgo-ld foo.go -midp -fgo
1354 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1355 -lidpsup -lm_idp -Tidp.ld -o foo} }
1358 { "clean up GO_LD_FOR_TARGET"
1359 { unset GO_LD_FOR_TARGET }
1362 { "override destination to host and compile Go to object"
1363 { default_target_compile "foo.go" "foo.o" object {
1367 "remote_exec host" U { 2 {found-go -c -o foo.o foo.go} }
1370 { "override destination to host and compile Go to object with host-gccgo"
1371 { default_target_compile "foo.go" "foo.o" object {
1372 "dest=host" go "compiler=host-gccgo"
1375 "remote_exec host" U { 2 {host-gccgo -c -o foo.o foo.go} }
1378 { "override destination to host and compile and link Go"
1379 { default_target_compile "foo.go" "foo" executable {
1383 "remote_exec host" U
1384 { 2 {found-go_linker foo.go -lm -Tmvme.ld -o foo} }
1387 { "override destination to host and compile and link Go with host-gccgo-ld"
1388 { default_target_compile "foo.go" "foo" executable {
1389 "dest=host" go "compiler=host-gccgo" "linker=host-gccgo-ld"
1392 "remote_exec host" U
1393 { 2 {host-gccgo-ld foo.go -lm -Tmvme.ld -o foo} }
1398 { "preprocess Rust with target compiler"
1399 { default_target_compile "foo.rs" "" preprocess {rust} }
1403 "remote_exec host" U
1404 { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
1405 -E -I/usr/gnemul/idp/include} }
1408 { "compile Rust to assembly with target compiler"
1409 { default_target_compile "foo.rs" "foo.s" assembly {rust} }
1413 "remote_exec host" U
1414 { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
1415 --emit asm -I/usr/gnemul/idp/include -o foo.s} }
1418 { "compile Rust to object with target compiler"
1419 { default_target_compile "foo.rs" "foo.o" object {rust} }
1423 "remote_exec host" U
1424 { 2 {m68k-unknown-aout-rustc -midp -frust
1425 --emit obj -I/usr/gnemul/idp/include
1429 { "compile and link Rust with target compiler"
1430 { default_target_compile "foo.rs" "foo" executable {rust} }
1434 "remote_exec host" U
1435 { 2 {m68k-unknown-aout-rustc foo.rs -midp -frust
1436 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1437 -lidpsup -lm_idp -Tidp.ld -o foo} }
1441 { "setup RUSTC_FOR_TARGET"
1442 { set RUSTC_FOR_TARGET "target-rustc" }
1444 { "preprocess Rust with RUSTC_FOR_TARGET"
1445 { default_target_compile "foo.rs" "" preprocess {rust} }
1449 "remote_exec host" U
1450 { 2 {target-rustc foo.rs -midp -frust
1451 -E -I/usr/gnemul/idp/include} }
1454 { "compile Rust to assembly with RUSTC_FOR_TARGET"
1455 { default_target_compile "foo.rs" "foo.s" assembly {rust} }
1459 "remote_exec host" U
1460 { 2 {target-rustc foo.rs -midp -frust
1461 --emit asm -I/usr/gnemul/idp/include -o foo.s} }
1464 { "compile Rust to object with RUSTC_FOR_TARGET"
1465 { default_target_compile "foo.rs" "foo.o" object {rust} }
1469 "remote_exec host" U
1470 { 2 {target-rustc -midp -frust
1471 --emit obj -I/usr/gnemul/idp/include
1475 { "compile and link Rust with RUSTC_FOR_TARGET"
1476 { default_target_compile "foo.rs" "foo" executable {rust} }
1480 "remote_exec host" U
1481 { 2 {target-rustc foo.rs -midp -frust
1482 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1483 -lidpsup -lm_idp -Tidp.ld -o foo} }
1486 { "clean up RUSTC_FOR_TARGET"
1487 { unset RUSTC_FOR_TARGET }
1490 { "override destination to host and compile and link Rust"
1491 { default_target_compile "foo.rs" "foo" executable {
1495 "remote_exec host" U { 2 {found-rustc foo.rs -lm -Tmvme.ld -o foo} }
1498 { "override destination to host and compile and link Rust with host-rustc"
1499 { default_target_compile "foo.rs" "foo" executable {
1500 "dest=host" rust "compiler=host-rustc"
1503 "remote_exec host" U { 2 {host-rustc foo.rs -lm -Tmvme.ld -o foo} }
1509 # mock [file exists ...] in slave interpreter for testing libs= option
1510 establish_mock_log_alias compile_test file
1512 proc file { op name } {
1513 logcall_file $op $name
1514 if { $op eq "exists" } {
1515 if { $name eq "bar_src" } {
1521 error "unimplemented"
1526 eval_tests compile_test {
1527 { "test libs= as linker option"
1528 { default_target_compile "foo.c" "foo" executable {
1532 "remote_exec host" U
1533 { 2 {m68k-unknown-aout-gcc foo.c -midp
1534 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1535 -lbar -lidpsup -lm_idp -Tidp.ld -o foo} }
1538 { "test libs= as extra source"
1539 { default_target_compile "foo.c" "foo" executable {
1543 "remote_exec host" U
1544 { 2 {m68k-unknown-aout-gcc foo.c bar_src -midp
1545 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1546 -lidpsup -lm_idp -Tidp.ld -o foo} }
1551 delete_test_interpreter compile_test
1553 create_test_interpreter compile_remote_test {
1554 copy_procs { default_target_compile }
1555 link_procs { verbose }
1556 shim_procs { board_info host_info target_info }
1558 build_triplet "bogus-build-host"
1559 host_triplet "bogus-test-host"
1560 target_triplet "bogus-test-target"
1564 which { what } { $what }
1565 remote_download { where what } { "remote-$what" }
1566 remote_exec { args } { [list 0 "<exec_output>"] }
1567 remote_file { where op what } { [list $op $what] }
1568 remote_upload { where what to } { [list $what $to] }
1570 prune_warnings { text } { $text }
1571 # avoid the losing search for a libstdc++
1572 isnative { args } { 0 }
1573 # provide the special cases for C++
1574 g++_include_flags { } { " -I/usr/include/g++" }
1575 g++_link_flags { } { " -L/usr/lib/g++" }
1576 # force remote mode for remote testing
1577 isremote { args } { 1 }
1578 # catch writing "atfile"
1579 open { what how } { "iofile0" }
1580 close { what } { "" }
1581 puts { args } { "" }
1584 # mock find_* procedures from libgloss.exp
1585 foreach { prog } { gcc gcj g++ gdc g77 gfortran gnatmake nm gas ld } {
1586 establish_mock compile_remote_test find_$prog {} [list found-$prog]
1589 eval_tests compile_remote_test {
1590 { "simple remote preprocess"
1591 { default_target_compile "foo.c" "foo.i" preprocess {} }
1594 "remote_download host" U { 2 foo.c }
1595 "remote_file host" 0 { 2 delete 3 a.out }
1596 "remote_exec host" U
1597 { 2 {m68k-unknown-aout-gcc remote-foo.c -midp -E
1598 -I/usr/gnemul/idp/include -o a.out} }
1599 "remote_upload host" U { 2 a.out 3 foo.i }
1600 "remote_file host" 1 { 2 delete 3 a.out }
1603 { "simple remote compile and link"
1604 { default_target_compile "foo.c bar.c" "foobar" executable {} }
1607 "remote_download host" 0 { 2 foo.c }
1608 "remote_download host" 1 { 2 bar.c }
1609 "remote_file host" 0 { 2 delete 3 a.out }
1610 "remote_exec host" U
1611 { 2 {m68k-unknown-aout-gcc remote-foo.c remote-bar.c -midp
1612 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1613 -lidpsup -lm_idp -Tidp.ld -o a.out} }
1614 "remote_upload host" U { 2 a.out 3 foobar }
1615 "remote_file host" 1 { 2 delete 3 a.out }
1620 set board_info(mvme,use_at) 1
1622 eval_tests compile_remote_test {
1623 { "simple remote preprocess with atfile"
1624 { default_target_compile "foo.c" "foo.i" preprocess {} }
1627 "remote_download host" 0 { 2 foo.c }
1628 "remote_file host" 0 { 2 delete 3 a.out }
1629 "open atfile w" U { 1 atfile }
1631 { 2 {\s*remote-foo.c -midp -E -I/usr/gnemul/idp/include -o a.out} }
1632 "close iofile0" U { 1 iofile0 }
1633 "remote_download host" 1 { 2 atfile }
1634 "remote_file build delete" U { 3 atfile }
1635 "remote_exec host" U
1636 { 2 {m68k-unknown-aout-gcc @remote-atfile} }
1637 "remote_upload host" U { 2 a.out 3 foo.i }
1638 "remote_file host" 1 { 2 delete 3 a.out }
1641 { "simple remote compile and link with atfile"
1642 { default_target_compile "foo.c bar.c" "foobar" executable {} }
1645 "remote_download host" 0 { 2 foo.c }
1646 "remote_download host" 1 { 2 bar.c }
1647 "remote_file host" 0 { 2 delete 3 a.out }
1648 "open atfile w" U { 1 atfile }
1650 { 2 {\s*remote-foo.c remote-bar.c -midp
1651 -I/usr/gnemul/idp/include -L/usr/gnemul/idp/lib
1652 -lidpsup -lm_idp -Tidp.ld -o a.out} }
1653 "close iofile0" U { 1 iofile0 }
1654 "remote_download host" 2 { 2 atfile }
1655 "remote_file build delete" U { 3 atfile }
1656 "remote_exec host" U
1657 { 2 {m68k-unknown-aout-gcc @remote-atfile} }
1658 "remote_upload host" U { 2 a.out 3 foobar }
1659 "remote_file host" 1 { 2 delete 3 a.out }
1664 delete_test_interpreter compile_remote_test
1666 puts "END target.test"