libgo: update to Go1.10beta1
[official-gcc.git] / gcc / testsuite / go.test / go-test.exp
blob1c83ba11080119c6189748b4bb95fcbd2f2dd3a0
1 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
2 # Written by Ian Lance Taylor <iant@google.com>.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with GCC; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
19 # Test using the testsuite for the gc Go compiler. In these tests the
20 # first line is a shell script to run. That line expects the
21 # following environment variables to be set:
22 # A The file extension of the object file and the name of the executable
23 # G The name of the compiler
24 # L The name of the linker
25 # F The basename of the test
26 # D The directory of the test.
28 # Typical command lines:
29 # // compile
30 # // run
31 # // $G $D/$F.go && $L $F.$A && ./$A.out
32 # // $G $D/$F.go && $L $F.$A || echo BUG: known to fail incorrectly
33 # // $G $D/$F.go && echo BUG: compilation succeeds incorrectly
34 # // $G $D/$F.go || echo BUG: compilation should succeed
36 load_lib go-dg.exp
37 load_lib go-torture.exp
38 load_lib target-supports.exp
40 # Compare two files
41 proc filecmp { file1 file2 testname } {
42 set f1 [open $file1 r]
43 set f2 [open $file2 r]
44 set ok 1
45 while { [gets $f1 line1] >= 0 } {
46 if { [gets $f2 line2] < 0 } {
47 verbose -log "output mismatch: $file2 shorter than $file1"
48 set ok 0
49 break
51 if { $line1 != $line2 } {
52 verbose -log "output mismatch comparing $file1 and $file2"
53 verbose -log "expected \"$line1\""
54 verbose -log "got \"$line2\""
55 set ok 0
56 break
59 if { [gets $f2 line2] >= 0 } {
60 verbose -log "output mismatch: $file1 shorter than $file2"
61 set ok 0
63 close $f1
64 close $f2
65 if { ! $ok } {
66 fail $testname
67 } else {
68 pass $testname
72 # Implement errchk
73 proc errchk { test opts } {
74 global dg-do-what-default
75 global DEFAULT_GOCFLAGS
76 global runtests
78 set saved-dg-do-what-default ${dg-do-what-default}
79 set dg-do-what-default compile
80 set filename [file tail $test]
81 if { "$filename" == "$test" } {
82 set filename "errchk-$filename"
84 set fdin [open $test r]
85 fconfigure $fdin -encoding binary
86 set fdout [open $filename w]
87 fconfigure $fdout -encoding binary
88 while { [gets $fdin copy_line] >= 0 } {
89 if [string match "*////*" $copy_line] {
90 puts $fdout $copy_line
91 continue
94 # Combine quoted strings in comments, so that
95 # // ERROR "first error" "second error"
96 # turns into
97 # // ERROR "first error|second error"
98 # This format is used by the master testsuite to recognize
99 # multiple errors on a single line. We don't require that all
100 # the errors be present, but we do want to accept any of them.
101 set changed ""
102 while { $changed != $copy_line } {
103 set changed $copy_line
104 regsub "\(// \[^\"\]*\"\[^\"\]*\)\" \"" $copy_line "\\1|" out_line
105 set copy_line $out_line
108 regsub "// \(GCCGO_\)?ERROR \"\(\[^\"\]*\)\".*$" $copy_line "// \{ dg-error \"\\2\" \}" out_line
109 if [string match "*dg-error*\\\[*" $out_line] {
110 set index [string first "dg-error" $out_line]
111 regsub -start $index -all "\\\\\\\[" $out_line "\\\\\\\\\\\[" out_line
113 if [string match "*dg-error*\\\]*" $out_line] {
114 set index [string first "dg-error" $out_line]
115 regsub -start $index -all "\\\\\\\]" $out_line "\\\\\\\\\\\]" out_line
117 if [string match "*dg-error*.\**" $out_line] {
118 # I worked out the right number of backslashes by
119 # experimentation, not analysis.
120 regsub -all "\\.\\*" $out_line "\\\\\[ -~\\\\\]*" out_line
122 if [string match "*dg-error*\\\[?\\\]*" $out_line] {
123 set index [string first "dg-error" $out_line]
124 regsub -all "\\\[\(.\)\\\]" $out_line "\\\\\[\\1\\\\\]" out_line
126 if [string match "*dg-error*\{*" $out_line] {
127 set index [string first "dg-error" $out_line]
128 regsub -start $index -all "\(\[^\\\\]\)\{" $out_line "\\1\\\\\[\\\{\\\\\]" out_line
130 if [string match "*dg-error*\}*\}" $out_line] {
131 set index [string first "dg-error" $out_line]
132 regsub -start $index -all "\(\[^\\\\]\)\}\(.\)" $out_line "\\1\\\\\[\\\}\\\\\]\\2" out_line
134 if [string match "*dg-error*\(*" $out_line] {
135 set index [string first "dg-error" $out_line]
136 regsub -start $index -all "\\\\\\\(" $out_line "\\\\\[\\\(\\\\\]" out_line
138 if [string match "*dg-error*\)*\}" $out_line] {
139 set index [string first "dg-error" $out_line]
140 regsub -start $index -all "\\\\\\\)\(.\)" $out_line "\\\\\[\\\)\\\\\]\\1" out_line
142 # Special case for bug332, in which the error message wants to
143 # match the file name, which is not what dg-error expects.
144 if [string match "*dg-error*bug332*" $out_line] {
145 set index [string first "dg-error" $out_line]
146 regsub -start $index "bug332" $out_line "undefined type" out_line
148 puts $fdout $out_line
150 close $fdin
151 close $fdout
153 set hold_runtests $runtests
154 set runtests "go-test.exp"
155 go-dg-runtest $filename "" "-fno-show-column $DEFAULT_GOCFLAGS $opts"
156 set runtests $hold_runtests
158 file delete $filename
159 set dg-do-what-default ${saved-dg-do-what-default}
162 # This is an execution test which should fail.
163 proc go-execute-xfail { test } {
164 global DEFAULT_GOCFLAGS
165 global runtests
167 set filename [file tail $test]
168 set fdin [open $test r]
169 set fdout [open $filename w]
170 puts $fdout "// { dg-do run { xfail *-*-* } }"
171 while { [gets $fdin copy_line] >= 0 } {
172 puts $fdout $copy_line
174 close $fdin
175 close $fdout
177 set hold_runtests $runtests
178 set runtests "go-test.exp"
179 go-dg-runtest $filename "" "-w $DEFAULT_GOCFLAGS"
180 set runtests $hold_runtests
182 file delete $filename
185 # N.B. Keep in sync with libgo/configure.ac.
186 proc go-set-goarch { } {
187 global target_triplet
189 switch -glob $target_triplet {
190 "aarch64*-*-*" {
191 set goarch "arm64"
193 "alpha*-*-*" {
194 set goarch "alpha"
196 "arm*-*-*" -
197 "ep9312*-*-*" -
198 "strongarm*-*-*" -
199 "xscale-*-*" {
200 set goarch "arm"
202 "i?86-*-*" -
203 "x86_64-*-*" {
204 if [check_effective_target_ia32] {
205 set goarch "386"
206 } else {
207 set goarch "amd64"
210 "mips*-*-*" {
211 if [check_no_compiler_messages mipso32 assembly {
212 #if _MIPS_SIM != _ABIO32
213 #error FOO
214 #endif
215 }] {
216 set goarch "mips"
217 } elseif [check_no_compiler_messages mipsn32 assembly {
218 #if _MIPS_SIM != _ABIN32
219 #error FOO
220 #endif
221 }] {
222 set goarch "mips64p32"
223 } elseif [check_no_compiler_messages mipsn64 assembly {
224 #if _MIPS_SIM != _ABI64
225 #error FOO
226 #endif
227 }] {
228 set goarch "mips64"
229 } else {
230 perror "$target_triplet: unrecognized MIPS ABI"
231 return ""
234 if [istarget "mips*el-*-*"] {
235 append goarch "le"
238 "powerpc*-*-*" {
239 if [check_effective_target_ilp32] {
240 set goarch "ppc"
241 } else {
242 if [istarget "powerpc64le-*-*"] {
243 set goarch "ppc64le"
244 } else {
245 set goarch "ppc64"
249 "s390*-*-*" {
250 if [check_effective_target_ilp32] {
251 set goarch "s390"
252 } else {
253 set goarch "s390x"
256 "sparc*-*-*" {
257 if [check_effective_target_ilp32] {
258 set goarch "sparc"
259 } else {
260 set goarch "sparc64"
263 default {
264 perror "$target_triplet: unhandled architecture"
265 return ""
268 verbose -log "Setting GOARCH=$goarch" 1
269 setenv GOARCH $goarch
272 # Take a list of files and return a lists of lists, where each list is
273 # the set of files in the same package.
274 proc go-find-packages { test name files } {
275 set packages [list]
276 foreach f $files {
277 set fd [open $f r]
278 while 1 {
279 if { [gets $fd line] < 0 } {
280 close $fd
281 clone_output "$test: could not read $f"
282 unresolved $name
283 return [list]
286 if { [regexp "^package (\\w+)" $line match package] } {
287 set len [llength $packages]
288 for { set i 0 } { $i < $len } { incr i } {
289 set p [lindex $packages $i]
290 if { [lindex $p 0] == $package } {
291 lappend p $f
292 lset packages $i $p
293 break
296 if { $i >= $len } {
297 lappend packages [list $package $f]
300 close $fd
301 break
305 return $packages
308 proc go-gc-tests { } {
309 global srcdir subdir
310 global runtests
311 global GCC_UNDER_TEST
312 global TOOL_OPTIONS
313 global TORTURE_OPTIONS
314 global dg-do-what-default
315 global go_compile_args
316 global go_execute_args
317 global target_triplet
319 # If a testcase doesn't have special options, use these.
320 global DEFAULT_GOCFLAGS
321 if ![info exists DEFAULT_GOCFLAGS] {
322 set DEFAULT_GOCFLAGS " -pedantic-errors"
325 set options ""
326 lappend options "additional_flags=$DEFAULT_GOCFLAGS"
328 # Set GOARCH for tests that need it.
329 go-set-goarch
331 # Running all the torture options takes too long and, since the
332 # frontend ignores the standard options, it doesn't significantly
333 # improve testing.
334 set saved_torture_options $TORTURE_OPTIONS
335 set TORTURE_OPTIONS [list { -O2 -g }]
337 set saved-dg-do-what-default ${dg-do-what-default}
339 set testdir [pwd]
341 set tests [lsort [find $srcdir/$subdir *.go]]
342 foreach test $tests {
343 if ![runtest_file_p $runtests $test] {
344 continue
347 # Skip the files in bench; they are not tests.
348 if [string match "*go.test/test/bench/*" $test] {
349 continue
352 # Skip the files in stress; they are not tests.
353 if [string match "*go.test/test/stress/*" $test] {
354 continue
357 # Skip the files in safe; gccgo does not support safe mode.
358 if [string match "*go.test/test/safe/*" $test] {
359 continue
362 # Skip files in sub-subdirectories: they are components of
363 # other tests.
364 if [string match "*go.test/test/*/*/*" $test] {
365 continue
368 # Skip files in *.dir subdirectories: they are components of
369 # other tests.
370 if [string match "*go.test/test/*.dir/*" $test] {
371 continue
374 set name [dg-trim-dirname $srcdir $test]
376 # Skip certain tests if target is RTEMS OS.
377 if [istarget "*-*-rtems*"] {
378 if { [string match "*go.test/test/args.go" $test] \
379 || [string match "*go.test/test/env.go" $test] } {
380 untested "$name: uses the command-line or environment variables"
381 continue
384 if { [string match "*go.test/test/stack.go" $test] \
385 || [string match "*go.test/test/peano.go" $test] \
386 || [string match "*go.test/test/chan/goroutines.go" $test] } {
387 untested "$name: has very high memory requirement"
388 continue
392 # Handle certain tests in a target-dependant way.
393 if { [istarget "alpha*-*-*"] || [istarget "sparc*-*-solaris*"] || [istarget "powerpc*-*-*"] || [istarget "s390*-*-*"] } {
394 if { [string match "*go.test/test/nilptr.go" $test] } {
395 untested $test
396 continue
400 if [check_effective_target_pie_enabled] {
401 untested $test
402 continue
405 if { [file tail $test] == "init1.go" } {
406 # This tests whether GC runs during init, which for gccgo
407 # it currently does not.
408 untested $name
409 continue
412 if { [file tail $test] == "closure.go" } {
413 # This tests whether function closures do any memory
414 # allocation, which for gccgo they currently do.
415 untested $name
416 continue
419 if { ( [file tail $test] == "select2.go" \
420 || [file tail $test] == "stack.go" \
421 || [file tail $test] == "peano.go" \
422 || [file tail $test] == "nilptr2.go" ) \
423 && ! [check_effective_target_split_stack] } {
424 # These tests fails on targets without split stack.
425 untested $name
426 continue
429 if [string match "*go.test/test/rotate\[0123\].go" $test] {
430 # These tests produces a temporary file that takes too long
431 # to compile--5 minutes on my laptop without optimization.
432 # When compiling without optimization it tests nothing
433 # useful, since the point of the test is to see whether
434 # the compiler generates rotate instructions.
435 untested $name
436 continue
439 if { [file tail $test] == "bug347.go" \
440 || [file tail $test] == "bug348.go" } {
441 # These tests don't work if the functions are inlined.
442 set TORTURE_OPTIONS [list { -O0 -g }]
445 set fd [open $test r]
447 set lines_ok 1
449 while 1 {
450 if { [gets $fd test_line] < 0 } {
451 close $fd
452 clone_output "$test: could not read first line"
453 unresolved $name
454 set lines_ok 0
455 break
458 if { [ string match "*nacl*exit 0*" $test_line ] \
459 || [ string match "*exit 0*nacl*" $test_line ] \
460 || [ string match "*Android*exit 0*" $test_line ] \
461 || [ string match "*exit 0*Android*" $test_line ] \
462 || [ string match "*\"\$GOOS\" == windows*" $test_line ] } {
463 continue
466 if { [ string match "// +build *" $test_line ] } {
467 set matches_pos 0
468 set matches_neg 0
469 if { [ regexp -line "\[ \][getenv GOARCH]\(\[ \]\|\$\)" $test_line ] } {
470 set matches_pos 1
471 } elseif { [ regexp -line "\[ \]\![getenv GOARCH]\(\[ \]\|\$\)" $test_line ] } {
472 set matches_neg 1
473 } elseif { [ regexp -line "\[ \]linux\(\[ \]\|\$\)" $test_line ] } {
474 set matches_pos 1
475 } elseif { [ regexp -line "\[ \]\!linux\(\[ \]\|\$\)" $test_line ] } {
476 set matches_neg 1
477 } elseif { [ regexp -line "\[ \]\!windows\(\[ \]\|\$\)" $test_line ] } {
478 set matches_pos 1
479 } elseif { [ regexp -line "\[ \]windows\(\[ \]\|\$\)" $test_line ] } {
480 set matches_neg 1
482 if { $matches_pos == 1 && $matches_neg == 0 } {
483 continue
485 close $fd
486 unsupported $name
487 set lines_ok 0
490 break
493 if { $lines_ok == 0 } {
494 continue
497 set lineno 1
498 set test_line1 $test_line
500 while { [eval "string match \"//*&&\" \${test_line$lineno}"] } {
501 set lineno [expr $lineno + 1]
502 if { [eval "gets \$fd test_line$lineno"] < 0 } {
503 close $fd
504 clone_output "$test: could not read line $lineno"
505 unresolved $name
506 set lines_ok 0
507 break
510 if { $lines_ok == 0 } {
511 continue
514 close $fd
516 # runtest_file_p is already run above, and the code below can run
517 # runtest_file_p again, make sure everything for this test is
518 # performed if the above runtest_file_p decided this runtest
519 # instance should execute the test
520 gcc_parallel_test_enable 0
522 set go_compile_args ""
523 set go_execute_args ""
524 if { [regexp "// run (\[^|&>2\].*)\$" $test_line match progargs] \
525 && ! [string match "*.go*" "$progargs"] } {
526 set go_execute_args $progargs
527 verbose -log "$test: go_execute_args is $go_execute_args"
528 set index [string last " $progargs" $test_line]
529 set test_line [string replace $test_line $index end]
530 } elseif { [string match "*go.test/test/chan/goroutines.go" $test] \
531 && [getenv GCCGO_RUN_ALL_TESTS] == "" } {
532 # goroutines.go spawns by default 10000 threads, which is too much
533 # for many OSes.
534 if { [getenv GCC_TEST_RUN_EXPENSIVE] == "" } {
535 set go_execute_args 64
536 } elseif { ![is_remote host] && ![is_remote target] } {
537 # When using low ulimit -u limit, use maximum of
538 # a quarter of that limit and 10000 even when running expensive
539 # tests, otherwise parallel tests might fail after fork failures.
540 set nproc [lindex [remote_exec host {sh -c ulimit\ -u}] 1]
541 if { [string is integer -strict $nproc] } {
542 set nproc [expr $nproc / 4]
543 if { $nproc > 10000 } { set nproc 10000 }
544 if { $nproc < 16 } { set nproc 16 }
545 set go_execute_args $nproc
548 if { "$go_execute_args" != "" } {
549 verbose -log "$test: go_execute_args is $go_execute_args"
553 if { $test_line == "// compile"
554 || $test_line == "// echo bug395 is broken # takes 90+ seconds to break" } {
555 # This is a vanilla compile test.
556 set dg-do-what-default "assemble"
557 go-dg-runtest $test "" "-w $DEFAULT_GOCFLAGS"
558 } elseif { $test_line == "// run"
559 || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" } {
560 # This is a vanilla execution test.
561 go-torture-execute $test
562 file delete core [glob -nocomplain core.*]
563 } elseif { $test_line == "// build" } {
564 # This is a vanilla compile and link test.
565 set dg-do-what-default "link"
566 go-dg-runtest $test "" "-w $DEFAULT_GOCFLAGS"
567 } elseif { [string match "// runoutput*" $test_line] \
568 || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&"
569 && $test_line2 == "// ./\$A.out >tmp.go && \$G tmp.go && \$L -o \$A.out1 tmp.\$A && ./\$A.out1") } {
570 # Run the test to get a .go program to run.
571 set go_execute_args ""
572 set hold_runtests $runtests
573 set runtests "go-test.exp"
574 set files [list]
575 if { [string match "// runoutput*" $test_line] } {
576 set args ""
577 regsub "// runoutput\(.*\)" $test_line "\\1" args
578 foreach f $args {
579 lappend files "[file dirname $test]/$f"
582 set dg-do-what-default "link"
583 dg-test -keep-output $test "-O" "$files -w $DEFAULT_GOCFLAGS"
584 set output_file "./[file rootname [file tail $test]].exe"
585 set base "[file rootname [file tail $test]]"
586 if [isnative] {
587 if { [catch "exec $output_file >$base-out.go"] != 0 } {
588 fail "$name execution"
589 } else {
590 pass "$name execution"
591 file delete $base-out.x
592 # Disable optimizations as some of these tests
593 # take a long time to compile.
594 set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }]
595 go-torture-execute "./$base-out.go"
597 file delete $base-out.go
599 file delete $output_file
600 set runtests $hold_runtests
601 } elseif { $test_line == "// cmpout" \
602 || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } {
603 # This is an execution test for which we need to check the
604 # program output.
605 set hold_runtests $runtests
606 set runtests "go-test.exp"
607 set dg-do-what-default "link"
608 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
609 set output_file "./[file rootname [file tail $test]].exe"
610 set base "[file rootname [file tail $test]]"
611 if [isnative] {
612 verbose -log "$output_file >$base.p 2>&1"
613 if { [catch "exec $output_file 2>$base.p" catcherr] != 0 } {
614 verbose -log $catcherr
615 fail "$name execution"
616 untested "$name compare"
617 } else {
618 pass "$name execution"
619 regsub "\\.go$" $test ".out" expect
620 filecmp $expect $base.p "$name compare"
621 file delete $output_file
623 file delete $base.p
624 } else {
625 untested "$name execution"
626 untested "$name compare"
628 set runtests $hold_runtests
629 } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \
630 $test_line] } {
631 go-execute-xfail $test
632 } elseif { $test_line == "// errorcheck" } {
633 errchk $test ""
634 } elseif { $test_line == "// errorcheckdir" } {
635 set hold_runtests $runtests
636 set runtests "go-test.exp"
637 set dir "[file rootname $test].dir"
638 set files [lsort [glob "$dir/*.go"]]
639 set packages [go-find-packages $test $name $files]
640 if { [llength $packages] > 0 } {
641 set dg-do-what-default "assemble"
642 set del [list]
643 set last [lindex $packages end]
644 set packages [lreplace $packages end end]
645 foreach p $packages {
646 dg-test -keep-output [lrange $p 1 end] "-O" "-w $DEFAULT_GOCFLAGS"
647 lappend del "[file rootname [file tail [lindex $p 1]]].o"
649 errchk [lindex $last 1] "[lrange $last 2 end]"
650 foreach f $del {
651 file delete $f
654 set runtests $hold_runtests
655 } elseif { [string match "// errorcheckoutput*" $test_line] } {
656 # Run the test to get a .go program to error check.
657 set go_execute_args ""
658 set hold_runtests $runtests
659 set runtests "go-test.exp"
660 set files [list]
661 regsub "// errorcheckoutput\(.*\)" $test_line "\\1" args
662 foreach f $args {
663 lappend files "[file dirname $test]/$f"
665 set dg-do-what-default "link"
666 dg-test -keep-output $test "-O" "$files -w $DEFAULT_GOCFLAGS"
667 set output_file "./[file rootname [file tail $test]].exe"
668 set base "[file rootname [file tail $test]]"
669 if [isnative] {
670 if { [catch "exec $output_file >$base-out.go"] != 0 } {
671 fail "$name execution"
672 } else {
673 pass "$name execution"
674 errchk "$base-out.go" ""
676 file delete $base-out.go
678 file delete $output_file
679 set runtests $hold_runtests
680 } elseif { $test_line == "// compiledir" } {
681 set hold_runtests $runtests
682 set runtests "go-test.exp"
683 set dg-do-what-default "assemble"
684 set dir "[file rootname $test].dir"
685 set files [lsort [glob "$dir/*.go"]]
686 set packages [go-find-packages $test $name $files]
687 if { [llength $packages] > 0 } {
688 set del [list]
689 foreach p $packages {
690 dg-test -keep-output [lindex $p 1] "[lrange $p 2 end] -O" "-w $DEFAULT_GOCFLAGS"
691 lappend del "[file rootname [file tail [lindex $p 1]]].o"
693 foreach f $del {
694 file delete $f
697 set runtests $hold_runtests
698 } elseif { $test_line == "// rundir" } {
699 set hold_runtests $runtests
700 set runtests "go-test.exp"
701 set dir "[file rootname $test].dir"
702 set files [lsort [glob "$dir/*.go"]]
703 set packages [go-find-packages $test $name $files]
704 if { [llength $packages] > 0 } {
705 set dg-do-what-default "assemble"
706 set del [list]
707 set last [lindex $packages end]
708 set packages [lreplace $packages end end]
709 foreach p $packages {
710 dg-test -keep-output [lrange $p 1 end] "-O" "-w $DEFAULT_GOCFLAGS"
711 lappend del "[file rootname [file tail [lindex $p 1]]].o"
713 set dg-do-what-default "link"
714 set go_compile_args ""
715 append go_compile_args [lrange $last 2 end]
716 append go_compile_args $del
717 go-torture-execute [lindex $last 1]
718 foreach f $del {
719 file delete $f
722 set runtests $hold_runtests
723 } elseif { $test_line == "// rundircmpout" } {
724 set hold_runtests $runtests
725 set runtests "go-test.exp"
726 set dir "[file rootname $test].dir"
727 set files [lsort [glob "$dir/*.go"]]
728 set packages [go-find-packages $test $name $files]
729 if { [llength $packages] > 0 } {
730 set dg-do-what-default "assemble"
731 set del [list]
732 set last [lindex $packages end]
733 set packages [lreplace $packages end end]
734 foreach p $packages {
735 dg-test -keep-output [lrange $p 1 end] "-O" "-w $DEFAULT_GOCFLAGS"
736 lappend del "[file rootname [file tail [lindex $p 1]]].o"
738 set dg-do-what-default "link"
739 dg-test -keep-output [lrange $last 1 end] "$del -O" "-w $DEFAULT_GOCFLAGS"
740 set base "[file rootname [file tail [lindex $last 1]]]"
741 set output_file "./$base.exe"
742 lappend del $output_file
743 if [isnative] {
744 verbose -log "$output_file >$base.p 2>&1"
745 if { [catch "exec $output_file 2>$base.p" catcherr] != 0 } {
746 verbose -log $catcherr
747 fail "$name execution"
748 untested "$name compare"
749 } else {
750 pass "$name execution"
751 regsub "\\.go$" "$test" ".out" expect
752 filecmp $expect $base.p "$name compare"
754 lappend del $base.p
756 foreach f $del {
757 file delete $f
760 set runtests $hold_runtests
761 } elseif { "$test_line" == ""
762 || [string match "// true*" $test_line]
763 || [string match "// skip*" $test_line] } {
764 # Not a real test, just ignore.
765 } elseif { [string match \
766 "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \
767 $test_line] \
768 || [string match \
769 "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \
770 $test_line] } {
771 if { [string match \
772 "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \
773 $test_line] } {
774 set name1 "bug0.go"
775 set name2 "bug1.go"
776 } elseif { [string match \
777 "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \
778 $test_line] } {
779 set name1 "io.go"
780 set name2 "main.go"
782 set hold_runtests $runtests
783 set runtests "go-test.exp"
784 set dg-do-what-default "assemble"
785 regsub "\\.go$" $test ".dir/$name1" file1
786 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
787 regsub "\\.go$" $test ".dir/$name2" file2
788 errchk $file2 ""
789 file delete "[file rootname [file tail $file1]].o"
790 set runtests $hold_runtests
791 } elseif { [string match \
792 "// \$G \$D/\${F}1.go && errchk \$G \$D/\$F.go" \
793 $test_line ] } {
794 set hold_runtests $runtests
795 set runtests "go-test.exp"
796 set dg-do-what-default "assemble"
797 regsub "\\.go$" $test "1.go" file1
798 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
799 errchk $test ""
800 file delete "[file rootname [file tail $file1]].o"
801 set runtests $hold_runtests
802 } elseif { [string match \
803 "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && errchk \$G \$D/\$F.dir/bug2.go" \
804 $test_line] } {
805 set hold_runtests $runtests
806 set runtests "go-test.exp"
807 set dg-do-what-default "assemble"
808 regsub "\\.go$" $test ".dir/bug0.go" file1
809 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
810 regsub "\\.go$" $test ".dir/bug1.go" file2
811 dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
812 regsub "\\.go$" $test ".dir/bug2.go" file3
813 errchk $file3 ""
814 file delete "[file rootname [file tail $file1]].o"
815 file delete "[file rootname [file tail $file2]].o"
816 set runtests $hold_runtests
817 } elseif { [string match \
818 "// \$G \$D/bug160.dir/x.go && \$G \$D/bug160.dir/y.go && \$L y.\$A && ./\$A.out" \
819 $test_line] \
820 || [string match \
821 "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \
822 $test_line] \
823 || $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \
824 || $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \
825 || $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } {
826 if { [string match \
827 "// \$G \$D/bug160.dir/x.go && \$G \$D/bug160.dir/y.go && \$L y.\$A && ./\$A.out" \
828 $test_line] } {
829 set name1 "x.go"
830 set name2 "y.go"
831 } elseif { [string match \
832 "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \
833 $test_line] } {
834 set name1 "p.go"
835 set name2 "main.go"
836 } elseif { $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" } {
837 set name1 "p1.go"
838 set name2 "main.go"
839 } elseif { $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
840 set name1 "lib.go"
841 set name2 ""
842 } elseif { $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } {
843 set name1 "method4a.go"
844 set name2 ""
846 set hold_runtests $runtests
847 set runtests "go-test.exp"
848 set dg-do-what-default "assemble"
849 regsub "\\.go$" $test ".dir/$name1" file1
850 if { $name1 == "method4a.go" } {
851 set file1 "[file dirname $test]/method4a.go"
853 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
854 set ofile1 "[file rootname [file tail $file1]].o"
855 regsub "\\.go$" $test ".dir/$name2" file2
856 if { $name2 == "" } {
857 set file2 $test
859 dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
860 set ofile2 "[file rootname [file tail $file2]].o"
861 set dg-do-what-default "link"
862 set output_file "./[file rootname [file tail $test]].exe"
863 set comp_output [go_target_compile "$ofile1 $ofile2" \
864 $output_file "executable" "$options"]
865 set comp_output [go-dg-prune $target_triplet $comp_output]
866 verbose -log $comp_output
867 set result [go_load "$output_file" "" ""]
868 set status [lindex $result 0]
869 $status $name
870 file delete $ofile1 $ofile2 $output_file
871 set runtests $hold_runtests
872 } elseif { $test_line == "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
873 set hold_runtests $runtests
874 set runtests "go-test.exp"
875 set dg-do-what-default "assemble"
876 regsub "\\.go$" $test ".dir/one.go" file1
877 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
878 set ofile1 "[file rootname [file tail $file1]].o"
879 regsub "\\.go$" $test ".dir/two.go" file2
880 dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
881 set ofile2 "[file rootname [file tail $file2]].o"
882 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
883 set ofile3 "[file rootname [file tail $test]].o"
884 set dg-do-what-default "link"
885 set output_file "./[file rootname [file tail $test]].exe"
886 set comp_output [go_target_compile "$ofile1 $ofile2 $ofile3" \
887 $output_file "executable" "$options"]
888 set comp_output [go-dg-prune $target_triplet $comp_output]
889 verbose -log $comp_output
890 set result [go_load "$output_file" "" ""]
891 set status [lindex $result 0]
892 $status $name
893 file delete $ofile1 $ofile2 $ofile3 $output_file
894 set runtests $hold_runtests
895 } elseif { [string match \
896 "// \$G \$D/embed0.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \
897 $test_line ] } {
898 set hold_runtests $runtests
899 set runtests "go-test.exp"
900 set dg-do-what-default "assemble"
901 regsub "/\[^/\]*$" $test "/embed0.go" file1
902 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
903 set ofile1 "[file rootname [file tail $file1]].o"
904 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
905 set ofile2 "[file rootname [file tail $test]].o"
906 set output_file "./[file rootname [file tail $test]].exe"
907 set comp_output [go_target_compile "$ofile1 $ofile2" \
908 $output_file "executable" "$options"]
909 set comp_output [go-dg-prune $target_triplet $comp_output]
910 if [string match "" $comp_output] {
911 set result [go_load "$output_file" "" ""]
912 set status [lindex $result 0]
913 $status $name
914 } else {
915 verbose -log $comp_output
916 fail $name
918 file delete $ofile1 $ofile2 $output_file
919 set runtests $hold_runtests
920 } elseif { [string match \
921 "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
922 $test_line ] || \
923 [string match \
924 "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
925 $test_line ] } {
926 if { [string match \
927 "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
928 $test_line ] } {
929 set name1 "lib.go"
930 set name2 "main.go"
931 } elseif { [string match \
932 "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
933 $test_line ] } {
934 set name1 "p.go"
935 set name2 "main.go"
937 set hold_runtests $runtests
938 set runtests "go-test.exp"
939 set dg-do-what-default "assemble"
940 regsub "\\.go$" $test ".dir/$name1" file1
941 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
942 set ofile1 "[file rootname [file tail $file1]].o"
943 regsub "\\.go$" $test ".dir/$name2" file2
944 dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
945 set ofile2 "[file rootname [file tail $file2]].o"
946 set dg-do-what-default "link"
947 set output_file "./[file rootname [file tail $file2]].exe"
948 set comp_output [go_target_compile "$ofile1 $ofile2" \
949 $output_file "executable" "$options"]
950 set comp_output [go-dg-prune $target_triplet $comp_output]
951 if [string match "" $comp_output] {
952 set result [go_load "$output_file" "" ""]
953 set status [lindex $result 0]
954 $status $name
955 } else {
956 verbose -log $comp_output
957 fail $name
959 file delete $ofile1 $ofile2 $output_file
960 set runtests $hold_runtests
961 } elseif { $test_line == "// \$G \$D/\$F.dir/bug0.go &&" \
962 && $test_line2 == "// \$G \$D/\$F.dir/bug1.go &&" \
963 && $test_line3 == "// \$G \$D/\$F.dir/bug2.go &&" \
964 && $test_line4 == "// errchk \$G -e \$D/\$F.dir/bug3.go &&" \
965 && $test_line5 == "// \$L bug2.\$A &&" \
966 && [string match "// ./\$A.out || echo BUG*" $test_line6] } {
967 set hold_runtests $runtests
968 set runtests "go-test.exp"
969 set dg-do-what-default "assemble"
970 regsub "\\.go$" $test ".dir/bug0.go" file0
971 dg-test -keep-output $file0 "-O -fgo-prefix=bug0" "-w $DEFAULT_GOCFLAGS"
972 set ofile0 "[file rootname [file tail $file0]].o"
973 regsub "\\.go$" $test ".dir/bug1.go" file1
974 dg-test -keep-output $file1 "-O -fgo-prefix=bug1" "-w $DEFAULT_GOCFLAGS"
975 set ofile1 "[file rootname [file tail $file1]].o"
976 regsub "\\.go$" $test ".dir/bug2.go" file2
977 dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
978 set ofile2 "[file rootname [file tail $file2]].o"
979 regsub "\\.go$" $test ".dir/bug3.go" file3
980 errchk $file3 ""
981 set output_file "./[file rootname [file tail $test]].exe"
982 set comp_output [go_target_compile "$ofile0 $ofile1 $ofile2" \
983 $output_file "executable" "$options"]
984 set comp-output [go-dg-prune $target_triplet $comp_output]
985 if [string match "" $comp_output] {
986 set result [go_load "$output_file" "" ""]
987 set status [lindex $result 0]
988 $status $name
989 } else {
990 verbose -log $comp_output
991 fail $name
993 file delete $ofile0 $ofile1 $ofile2 $output_file
994 set runtests $hold_runtests
995 } elseif { $test_line == "// \$G \$D/import2.go && \$G \$D/\$F\.go" \
996 || $test_line == "// \$G \$D/recursive1.go && \$G \$D/\$F.go" } {
997 if { $test_line == "// \$G \$D/import2.go && \$G \$D/\$F\.go" } {
998 set name1 "import2.go"
999 } elseif { $test_line == "// \$G \$D/recursive1.go && \$G \$D/\$F.go" } {
1000 set name1 "recursive1.go"
1002 set hold_runtests $runtests
1003 set runtests "go-test.exp"
1004 set dg-do-what-default "assemble"
1005 regsub "/\[^/\]*$" $test "/${name1}" file1
1006 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
1007 set ofile1 "[file rootname [file tail $file1]].o"
1008 dg-test $test "-O" "-w $DEFAULT_GOCFLAGS"
1009 file delete $ofile1
1010 set runtests $hold_runtests
1011 } elseif { $test_line == "// \$G \$D/ddd2.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } {
1012 set hold_runtests $runtests
1013 set runtests "go-test.exp"
1014 set dg-do-what-default "assemble"
1015 regsub "/\[^/\]*$" $test "/ddd2.go" file1
1016 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
1017 set ofile1 "[file rootname [file tail $file1]].o"
1018 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
1019 set ofile2 "[file rootname [file tail $test]].o"
1020 set output_file "./[file rootname [file tail $test]].exe"
1021 set comp_output [go_target_compile "$ofile1 $ofile2" \
1022 $output_file "executable" "$options"]
1023 set comp_output [go-dg-prune $target_triplet $comp_output]
1024 if [string match "" $comp_output] {
1025 set result [go_load "$output_file" "" ""]
1026 set status [lindex $result 0]
1027 $status $name
1028 } else {
1029 verbose -log $comp_output
1030 fail $name
1032 file delete $ofile1 $ofile2 $output_file
1033 set runtests $hold_runtests
1034 } elseif { $test_line == "// run cmplxdivide1.go" } {
1035 regsub "/\[^/\]*$" $test "/cmplxdivide1.go" test2
1036 set output_file "./[file rootname [file tail $test]].o"
1037 set comp_output [go_target_compile "$test $test2" \
1038 $output_file "executable" "$options"]
1039 set comp_output [go-dg-prune $target_triplet $comp_output]
1040 if [string match "" $comp_output] {
1041 set result [go_load "$output_file" "" ""]
1042 set status [lindex $result 0]
1043 $status $name
1044 } else {
1045 verbose -log $comp_output
1046 fail $name
1048 file delete $output_file
1049 } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&" \
1050 && $test_line2 == "// ./\$A.out -pass 0 >tmp.go && \$G tmp.go && \$L -o \$A.out1 tmp.\$A && ./\$A.out1 &&" \
1051 && $test_line3 == "// ./\$A.out -pass 1 >tmp.go && errchk \$G -e tmp.go &&" \
1052 && $test_line4 == "// ./\$A.out -pass 2 >tmp.go && errchk \$G -e tmp.go" } {
1053 set go_execute_args ""
1054 set hold_runtests $runtests
1055 set runtests "go-test.exp"
1056 set dg-do-what-default "link"
1057 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
1058 set output_file "./[file rootname [file tail $test]].exe"
1059 if [isnative] {
1060 if { [catch "exec $output_file -pass 0 >tmp.go"] != 0 } {
1061 fail "$name execution 0"
1062 } else {
1063 pass "$name execution 0"
1064 file delete tmp.x
1065 # Disable optimizations as this test takes a long time
1066 # to compile.
1067 set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }]
1068 go-torture-execute "./tmp.go"
1070 if { [catch "exec $output_file -pass 1 >tmp.go"] != 0 } {
1071 fail "$name execution 1"
1072 } else {
1073 pass "$name execution 1"
1074 errchk tmp.go ""
1076 if { [catch "exec $output_file -pass 2 >tmp.go"] != 0 } {
1077 fail "$name execution 2"
1078 } else {
1079 pass "$name execution 2"
1080 errchk tmp.go ""
1082 file delete tmp.go
1084 file delete $output_file
1085 set runtests $hold_runtests
1086 } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&" \
1087 && $test_line2 == "// errchk \$G -e tmp.go" } {
1088 set go_execute_args ""
1089 set hold_runtests $runtests
1090 set runtests "go-test.exp"
1091 set dg-do-what-default "link"
1092 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
1093 set output_file "./[file rootname [file tail $test]].exe"
1094 if [isnative] {
1095 if { [catch "exec $output_file >tmp.go"] != 0 } {
1096 fail "$name execution"
1097 } else {
1098 pass "$name execution"
1099 file delete tmp.x
1100 errchk tmp.go ""
1103 file delete $output_file
1104 set runtests $hold_runtests
1105 } elseif { $test_line == "// errchk \$G -e \$D/\$F.dir/\[ab\].go" } {
1106 regsub "\\.go$" $test ".dir/a.go" file1
1107 regsub "\\.go$" $test ".dir/b.go" file2
1108 errchk "$file1" "$file2"
1109 } elseif { $test_line == "// \$G -N -o slow.\$A \$D/bug369.dir/pkg.go &&" \
1110 && $test_line2 == "// \$G -o fast.\$A \$D/bug369.dir/pkg.go &&" \
1111 && $test_line3 == "// run" } {
1112 set hold_runtests $runtests
1113 set runtests "go-test.exp"
1114 set dg-do-what-default "assemble"
1115 regsub "\\.go$" $test ".dir/pkg.go" file1
1116 dg-test -keep-output $file1 "" "-fgo-prefix=slow -w $DEFAULT_GOCFLAGS"
1117 set ofile1 "[file rootname [file tail $file1]].o"
1118 file rename -force $ofile1 slow.o
1119 dg-test -keep-output $file1 "-O2" "-fgo-prefix=fast -w $DEFAULT_GOCFLAGS"
1120 file rename -force $ofile1 fast.o
1121 set ofile2 "[file rootname [file tail $test]].o"
1122 dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
1123 set output_file "./[file rootname [file tail $test]].exe"
1124 set comp_output [go_target_compile "$ofile2 slow.o fast.o" \
1125 $output_file "executable" "$options"]
1126 set comp_output [go-dg-prune $target_triplet $comp_output]
1127 if [string match "" $comp_output] {
1128 set result [go_load "$output_file" "" ""]
1129 set status [lindex $result 0]
1130 $status $name
1131 } else {
1132 verbose -log $comp_output
1133 fail $name
1135 file delete slow.o fast.o $ofile2 $output_file
1136 set runtests $hold_runtests
1137 } elseif { [string match \
1138 "// \$G \$D/\$F.dir/pkg.go && \$G \$D/\$F.go || echo *" \
1139 $test_line ] } {
1140 set hold_runtests $runtests
1141 set runtests "go-test.exp"
1142 set dg-do-what-default "assemble"
1143 regsub "\\.go$" $test ".dir/pkg.go" file1
1144 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
1145 dg-test $test "-O" "-w $DEFAULT_GOCFLAGS"
1146 file delete "[file rootname [file tail $file1]].o"
1147 set runtests $hold_runtests
1148 } elseif { [string match "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go || echo BUG*" \
1149 $test_line ] } {
1150 set hold_runtests $runtests
1151 set runtests "go-test.exp"
1152 set dg-do-what-default "assemble"
1153 regsub "\\.go$" $test ".dir/one.go" file1
1154 dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
1155 set ofile1 "[file rootname [file tail $file1]].o"
1156 regsub "\\.go$" $test ".dir/two.go" file2
1157 dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
1158 file delete $ofile1
1159 set runtests $hold_runtests
1160 } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && pack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \
1161 || $test_line == "// \$G \$D/empty.go && errchk \$G \$D/\$F.go" } {
1162 # These tests import the same package under two different
1163 # names, which gccgo does not support.
1164 } elseif { $test_line == "// \$G -S \$D/\$F.go | egrep initdone >/dev/null && echo BUG sinit || true" } {
1165 # This tests whether initializers are written out
1166 # statically. gccgo does not provide a way to test that,
1167 # as an initializer will be generated for any code which
1168 # has global variables which need to be registered as GC
1169 # roots.
1170 } elseif { $test_line == "// errorcheck -0 -m"
1171 || $test_line == "// errorcheck -0 -m -l" } {
1172 # This tests debug output of the gc compiler, which is
1173 # meaningless for gccgo.
1174 } elseif { $test_line == "// \[ \$A == 6 \] || errchk \$G -e \$D/\$F.go" \
1175 || $test_line == "// \[ \$A != 6 \] || errchk \$G -e \$D/\$F.go" } {
1176 # This tests specific handling of the gc compiler on types
1177 # that are too large. It is target specific in a way I
1178 # haven't bothered to check for here.
1179 } elseif { $test_line == "// \$G \$D/\$F.go && \$L -X main.tbd hello \$F.\$A && ./\$A.out" } {
1180 # This tests the gc ld -X option, which gccgo does not
1181 # support.
1182 } elseif { $test_line == "// \$G \$D/pkg.go && pack grc pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && errchk \$G -I. -u \$D/main.go"
1183 || $test_line == "// \$G \$D/pkg.go && pack grcS pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && \$G -I. -u \$D/main.go" } {
1184 # This tests the gc -u option, which gccgo does not
1185 # support.
1186 } elseif { $test_line == "// errorcheck -0 -N -d=nil" \
1187 || $test_line == "// errorcheck -0 -d=nil" } {
1188 # This tests gc nil pointer checks using -d=nil, which
1189 # gccgo does not support.
1190 } else {
1191 clone_output "$name: unrecognized test line: $test_line"
1192 unsupported $name
1195 set go_compile_args ""
1196 set go_execute_args ""
1197 set TORTURE_OPTIONS [list { -O2 -g }]
1198 gcc_parallel_test_enable 1
1201 set dg-do-what-default ${saved-dg-do-what-default}
1202 set TORTURE_OPTIONS $saved_torture_options
1205 go-gc-tests