diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 502ffdc511e..fe022d54e34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-09-29 Ian Lance Taylor + + * go.test/go-test.exp: Update for latest version of Go testsuite. + 2012-09-29 Thomas König PR fortran/52724 diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp index 943a7f1a1a7..b093f01c843 100644 --- a/gcc/testsuite/go.test/go-test.exp +++ b/gcc/testsuite/go.test/go-test.exp @@ -26,6 +26,8 @@ # D The directory of the test. # # Typical command lines: +# // compile +# // run # // $G $D/$F.go && $L $F.$A && ./$A.out # // $G $D/$F.go && $L $F.$A || echo BUG: known to fail incorrectly # // $G $D/$F.go && echo BUG: compilation succeeds incorrectly @@ -267,7 +269,7 @@ proc go-gc-tests { } { # frontend ignores the standard options, it doesn't significantly # improve testing. set saved_torture_options $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O2 -g }] + set TORTURE_OPTIONS [list { -O2 -g }] set saved-dg-do-what-default ${dg-do-what-default} @@ -316,13 +318,6 @@ proc go-gc-tests { } { } } - if { [string match "*bug347*" $test] \ - || [string match "*bug348*" $test] } { - # These bugs rely on runtime.Caller which currently fails. - untested $name - continue - } - if { [file tail $test] == "init1.go" } { # This tests whether GC runs during init, which for gccgo # it currently does not. @@ -347,6 +342,22 @@ proc go-gc-tests { } { continue } + if { [file tail $test] == "rotate.go" } { + # This test produces a temporary file that takes too long + # to compile--5 minutes on my laptop without optimization. + # When compiling without optimization it tests nothing + # useful, since the point of the test is to see whether + # the compiler generates rotate instructions. + untested $name + continue + } + + if { [file tail $test] == "bug347.go" \ + || [file tail $test] == "bug348.go" } { + # These tests don't work if the functions are inlined. + set TORTURE_OPTIONS [list { -O0 -g }] + } + set fd [open $test r] set lines_ok 1 @@ -424,9 +435,24 @@ proc go-gc-tests { } { } } - if { $test_line == "// \$G \$D/\$F\.go && \$L \$F\.\$A && \./\$A\.out >tmp.go &&" \ - && $test_line2 == "// \$G tmp\.go && \$L tmp\.\$A && \./\$A\.out || echo BUG: 64bit" } { - # 64bit.go is a special case. + if { $test_line == "// compile" + || $test_line == "// echo bug395 is broken # takes 90+ seconds to break" } { + # This is a vanilla compile test. + set dg-do-what-default "assemble" + go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" + } elseif { $test_line == "// run" + || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" } { + # This is a vanilla execution test. + go-torture-execute $test + file delete core [glob -nocomplain core.*] + } elseif { $test_line == "// build" } { + # This is a vanilla compile and link test. + set dg-do-what-default "link" + go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" + } elseif { $test_line == "// runoutput" \ + || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&" + && $test_line2 == "// ./\$A.out >tmp.go && \$G tmp.go && \$L -o \$A.out1 tmp.\$A && ./\$A.out1") } { + # Run the test to get a .go program to run. set go_execute_args "" set hold_runtests $runtests set runtests "go-test.exp" @@ -440,42 +466,17 @@ proc go-gc-tests { } { } else { pass "$name execution" file delete $base-out.x - # Disable optimizations as this test takes a long time - # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] + # Disable optimizations as some of these tests + # take a long time to compile. + set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }] go-torture-execute "./$base-out.go" - set TORTURE_OPTIONS $hold } file delete $base-out.go } file delete $output_file set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A &&./\$A.out" \ - || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && \$A.out" \ - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && (./\$A.out || echo BUG*" \ - $test_line] - || [string match \ - "// \$G \$F.go && \$L \$F.\$A && GOMAXPROCS=* ./\$A.out" \ - $test_line] - || [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >* || echo BUG*" \ - $test_line] } { - # This is a vanilla execution test. - go-torture-execute $test - file delete core [glob -nocomplain core.*] - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \ - || $test_line == "// \$G \$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out" \ - || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } { + } elseif { $test_line == "// cmpout" \ + || $test_line == "// (\$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out 2>&1 | cmp - \$D/\$F.out)" } { # This is an execution test for which we need to check the # program output. set hold_runtests $runtests @@ -495,109 +496,38 @@ proc go-gc-tests { } { regsub "\\.go$" $test ".out" expect filecmp $expect $base.p "$name compare" } - #file delete $base.p + file delete $base.p } else { untested "$name execution" untested "$name compare" } set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.go && \$L \$F.\$A || echo BUG*" \ - $test_line] \ - || [string match "// \$G \$F.go && \$L \$F.\$A #*" \ - $test_line] - || $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A" } { - # This is a vanilla compile and link test. - set dg-do-what-default "link" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go" $test_line] \ - || [string match "// \$G \$D/\$F.go || echo BUG*" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go || echo \"Bug*" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go || echo \"Issue*" \ - $test_line] \ - || [string match "// \$G \$F.go || echo BUG*" \ - $test_line] \ - || [string match "// ! \$G \$D/\$F.go && echo BUG*" \ - $test_line] \ - || $test_line == "// echo bug395 is broken # takes 90+ seconds to break" } { - # This is a vanilla compile test. - set dg-do-what-default "assemble" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go && echo BUG*" \ - $test_line] \ - || $test_line == "// ! \$G \$D/\$F.go >/dev/null" \ - || $test_line == "// ! \$G \$D/\$F.go" \ - || $test_line == "// ! \$G \$F.go" \ - || [string match "// ! \$G \$D/\$F.go || echo BUG*" \ - $test_line] } { - # This is a compile test which should fail. - set dg-do-what-default "assemble" - setup_xfail "*-*-*" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \ - $test_line] \ - || [string match "// \$G \$D/\$F.go && \$L \$F.\$A && (! ./\$A.out || echo BUG: *" \ - $test_line] \ - || ($test_line == "// \$G \$D/\$F.go && \$L \$F.\$A &&" - && $test_line2 == "// ((! sh -c ./\$A.out) >/dev/null 2>&1 || echo BUG: should fail)") } { + } elseif { [string match "// \$G \$D/\$F.go && \$L \$F.\$A && ! ./\$A.out || echo BUG: *" \ + $test_line] } { go-execute-xfail $test - } elseif { [string match "// errchk \$G \$F.go" $test_line] \ - || [string match "// errchk \$G -e \$F.go" $test_line] \ - || [string match "// errchk \$G \$D/\$F.go" $test_line] \ - || [string match "//errchk \$G \$D/\$F.go" $test_line] \ - || [string match "// errchk \$G -e \$D/\$F.go" \ - $test_line] \ - || [string match "// ! errchk \$G \$D/\$F.go" $test_line] \ - || [string match "// ! errchk \$G -e \$D/\$F.go" \ - $test_line] \ - || [string match "// errchk \$G \$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G \$D/\$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G -e \$D/\$F.go || true" \ - $test_line] \ - || [string match "// errchk \$G \$D/\$F.go || echo BUG*" \ - $test_line] } { + } elseif { $test_line == "// errorcheck" } { errchk $test "" - } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] \ - || [string match \ - "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \ - $test_line] } { - if { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] } { - set name1 "bug0.go" - set name2 "bug1.go" - } elseif { [string match \ - "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go" \ - $test_line] } { - set name1 "one.go" - set name2 "two.go" - } + } elseif { $test_line == "// compiledir" } { set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/$name1" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/$name2" file2 - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" + set dir "[file rootname $test].dir" + set del {} + foreach f [lsort [glob "$dir/*.go"]] { + dg-test -keep-output $f "-O" "-w $DEFAULT_GOCFLAGS" + lappend del "[file rootname [file tail $f]].o" + } + foreach f $del { + file delete $f + } set runtests $hold_runtests + } elseif { "$test_line" == "" + || [string match "// true*" $test_line] + || [string match "// skip*" $test_line] } { + # Not a real test, just ignore. } elseif { [string match \ "// \$G \$D/\$F.dir/bug0.go && errchk \$G \$D/\$F.dir/bug1.go" \ $test_line] \ - || [string match \ - "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \ - $test_line] \ - || [string match \ - "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \ - $test_line] \ || [string match \ "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \ $test_line] } { @@ -606,16 +536,6 @@ proc go-gc-tests { } { $test_line] } { set name1 "bug0.go" set name2 "bug1.go" - } elseif { [string match \ - "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/p2.go" \ - $test_line] } { - set name1 "p1.go" - set name2 "p2.go" - } elseif { [string match \ - "// \$G \$D/\$F.dir/b.go && \$G \$D/\$F.dir/a.go" \ - $test_line] } { - set name1 "b.go" - set name2 "a.go" } elseif { [string match \ "// \$G \$D/\$F.dir/io.go && errchk \$G -e \$D/\$F.dir/main.go" \ $test_line] } { @@ -642,35 +562,6 @@ proc go-gc-tests { } { errchk $test "" file delete "[file rootname [file tail $file1]].o" set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && (! \$G \$D/\$F.dir/bug1.go || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/bug0.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug1.go" file2 - setup_xfail "*-*-*" - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && (! \$G \$D/\$F.dir/bug2.go || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/bug0.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug1.go" file2 - dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/bug2.go" file3 - setup_xfail "*-*-*" - dg-test $file3 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - file delete "[file rootname [file tail $file2]].o" - set runtests $hold_runtests } elseif { [string match \ "// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go && errchk \$G \$D/\$F.dir/bug2.go" \ $test_line] } { @@ -691,7 +582,10 @@ proc go-gc-tests { } { $test_line] \ || [string match \ "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \ - $test_line] } { + $test_line] \ + || $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" \ + || $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" \ + || $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } { if { [string match \ "// \$G \$D/bug160.dir/x.go && \$G \$D/bug160.dir/y.go && \$L y.\$A && ./\$A.out" \ $test_line] } { @@ -702,14 +596,29 @@ proc go-gc-tests { } { $test_line] } { set name1 "p.go" set name2 "main.go" + } elseif { $test_line == "// \$G \$D/\$F.dir/p1.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out" } { + set name1 "p1.go" + set name2 "main.go" + } elseif { $test_line == "// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + set name1 "lib.go" + set name2 "" + } elseif { $test_line == "// \$G \$D/method4a.go && \$G \$D/\$F.go && \$L \$F.\$A && ./$\A.out" } { + set name1 "method4a.go" + set name2 "" } set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" regsub "\\.go$" $test ".dir/$name1" file1 + if { $name1 == "method4a.go" } { + set file1 "[file dirname $test]/method4a.go" + } dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" set ofile1 "[file rootname [file tail $file1]].o" regsub "\\.go$" $test ".dir/$name2" file2 + if { $name2 == "" } { + set file2 $test + } dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" set ofile2 "[file rootname [file tail $file2]].o" set dg-do-what-default "link" @@ -723,6 +632,29 @@ proc go-gc-tests { } { $status $name file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests + } elseif { $test_line == "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go && \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + set hold_runtests $runtests + set runtests "go-test.exp" + set dg-do-what-default "assemble" + regsub "\\.go$" $test ".dir/one.go" file1 + dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile1 "[file rootname [file tail $file1]].o" + regsub "\\.go$" $test ".dir/two.go" file2 + dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile2 "[file rootname [file tail $file2]].o" + dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" + set ofile3 "[file rootname [file tail $test]].o" + set dg-do-what-default "link" + set output_file "./[file rootname [file tail $test]].exe" + set comp_output [go_target_compile "$ofile1 $ofile2 $ofile3" \ + $output_file "executable" "$options"] + set comp_output [go-dg-prune $target_triplet $comp_output] + verbose -log $comp_output + set result [go_load "$output_file" "" ""] + set status [lindex $result 0] + $status $name + file delete $ofile1 $ofile2 $ofile3 $output_file + set runtests $hold_runtests } elseif { [string match \ "// \$G \$D/bug191.dir/a.go && \$G \$D/bug191.dir/b.go && \$G \$D/\$F.go && \$L \$F.\$A" \ $test_line] } { @@ -816,38 +748,6 @@ proc go-gc-tests { } { } file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/chanbug.go && \$G -I. \$D/\$F.dir/chanbug2.go" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/chanbug.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/chanbug2.go" file2 - dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { [string match \ - "// (! \$G \$D/\$F.go) | grep 'initialization loop' *" \ - $test_line] } { - set dg-do-what-default "assemble" - setup_xfail "*-*-*" - go-dg-runtest $test "-w $DEFAULT_GOCFLAGS" - } elseif { [string match \ - "// \$G \$D/\$F.dir/x.go && errchk \$G \$D/\$F.dir/y.go" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/x.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - regsub "\\.go$" $test ".dir/y.go" file2 - errchk $file2 "" - file delete "[file rootname [file tail $file1]].o" - set runtests $hold_runtests - } elseif { "$test_line" == "" || [string match "// true*" $test_line] } { - # Not a real test, just ignore. } elseif { $test_line == "// \$G \$D/\$F.dir/bug0.go &&" \ && $test_line2 == "// \$G \$D/\$F.dir/bug1.go &&" \ && $test_line3 == "// \$G \$D/\$F.dir/bug2.go &&" \ @@ -921,7 +821,7 @@ proc go-gc-tests { } { } file delete $ofile1 $ofile2 $output_file set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go \$D/cmplxdivide1.go && \$L \$D/\$F.\$A && ./\$A.out" } { + } elseif { $test_line == "// run cmplxdivide1.go" } { regsub "/\[^/\]*$" $test "/cmplxdivide1.go" test2 set output_file "./[file rootname [file tail $test]].o" set comp_output [go_target_compile "$test $test2" \ @@ -954,10 +854,8 @@ proc go-gc-tests { } { file delete tmp.x # Disable optimizations as this test takes a long time # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] + set TORTURE_OPTIONS [list { -O0 -g -fno-var-tracking-assignments }] go-torture-execute "./tmp.go" - set TORTURE_OPTIONS $hold } if { [catch "exec $output_file -pass 1 >tmp.go"] != 0 } { fail "$name execution 1" @@ -994,59 +892,6 @@ proc go-gc-tests { } { } file delete $output_file set runtests $hold_runtests - } elseif { [string match \ - "// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ! ./\$A.out || echo BUG*" \ - $test_line] } { - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "assemble" - regsub "\\.go$" $test ".dir/p.go" file1 - dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" - set ofile1 "[file rootname [file tail $file1]].o" - regsub "\\.go$" $test ".dir/main.go" file2 - dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS" - set ofile2 "[file rootname [file tail $file2]].o" - set output_file "./[file rootname [file tail $test]].exe" - set comp_output [go_target_compile "$ofile1 $ofile2" \ - $output_file "executable" "$options"] - set comp_output [go-dg-prune $target_triplet $comp_output] - if [string match "" $comp_output] { - setup_xfail "*-*-*" - set result [go_load "$output_file" "" ""] - set status [lindex $result 0] - $status $name - } else { - verbose -log $comp_output - fail $name - } - file delete $ofile1 $ofile2 $output_file - set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&" - && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out || echo BUG: select5" } { - set go_execute_args "" - set hold_runtests $runtests - set runtests "go-test.exp" - set dg-do-what-default "link" - dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" - set output_file "./[file rootname [file tail $test]].exe" - set base "[file rootname [file tail $test]]" - if [isnative] { - if { [catch "exec $output_file > $base-out.go"] != 0 } { - fail "$name execution" - } else { - pass "$name execution" - file delete $base-out.x - # Disable optimizations as this test takes a long time - # to compile. - set hold $TORTURE_OPTIONS - set TORTURE_OPTIONS [ list { -O0 -g }] - go-torture-execute "./$base-out.go" - set TORTURE_OPTIONS $hold - } - file delete $base-out.go - } - file delete $output_file - set runtests $hold_runtests } elseif { $test_line == "// errchk \$G -e \$D/\$F.dir/\[ab\].go" } { regsub "\\.go$" $test ".dir/a.go" file1 regsub "\\.go$" $test ".dir/b.go" file2 @@ -1057,7 +902,7 @@ proc go-gc-tests { } { go-torture-execute $test } elseif { $test_line == "// \$G -N -o slow.\$A \$D/bug369.dir/pkg.go &&" \ && $test_line2 == "// \$G -o fast.\$A \$D/bug369.dir/pkg.go &&" \ - && $test_line3 == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out" } { + && $test_line3 == "// run" } { set hold_runtests $runtests set runtests "go-test.exp" set dg-do-what-default "assemble" @@ -1094,30 +939,19 @@ proc go-gc-tests { } { dg-test $test "-O" "-w $DEFAULT_GOCFLAGS" file delete "[file rootname [file tail $file1]].o" set runtests $hold_runtests - } elseif { $test_line == "// \$G \$D/\$F.go && \$L \$F.\$A && ./\$A.out >tmp.go &&" - && $test_line2 == "// \$G tmp.go && \$L tmp.\$A && ./\$A.out" } { - set go_execute_args "" + } elseif { [string match "// \$G \$D/\$F.dir/one.go && \$G \$D/\$F.dir/two.go || echo BUG*" \ + $test_line ] } { set hold_runtests $runtests set runtests "go-test.exp" - set dg-do-what-default "link" - dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS" - set output_file "./[file rootname [file tail $test]].exe" - set base "[file rootname [file tail $test]]" - if [isnative] { - if { [catch "exec $output_file >$base-out.go"] != 0 } { - fail "$name execution" - } else { - pass "$name execution" - file delete $base-out.x - go-torture-execute "./$base-out.go" - } - file delete $base-out.go - } - file delete $output_file + set dg-do-what-default "assemble" + regsub "\\.go$" $test ".dir/one.go" file1 + dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS" + set ofile1 "[file rootname [file tail $file1]].o" + regsub "\\.go$" $test ".dir/two.go" file2 + dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS" + file delete $ofile1 set runtests $hold_runtests - } elseif { $test_line == "// # generated by cmplxdivide.c" } { - # Ignore. - } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && gopack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \ + } elseif { $test_line == "// \$G \$D/bug302.dir/p.go && pack grc pp.a p.\$A && \$G \$D/bug302.dir/main.go" \ || $test_line == "// \$G \$D/empty.go && errchk \$G \$D/\$F.go" } { # These tests import the same package under two different # names, which gccgo does not support. @@ -1127,14 +961,22 @@ proc go-gc-tests { } { # as an initializer will be generated for any code which # has global variables which need to be registered as GC # roots. - } elseif { $test_line == "// errchk -0 \$G -m -l \$D/\$F.go" } { + } elseif { $test_line == "// errorcheck -0 -m" + || $test_line == "// errorcheck -0 -m -l" } { # This tests debug output of the gc compiler, which is # meaningless for gccgo. - } elseif { $test_line == "// \[ \$O == 6 \] || errchk \$G -e \$D/\$F.go" \ - || $test_line == "// \[ \$O != 6 \] || errchk \$G -e \$D/\$F.go" } { + } elseif { $test_line == "// \[ \$A == 6 \] || errchk \$G -e \$D/\$F.go" \ + || $test_line == "// \[ \$A != 6 \] || errchk \$G -e \$D/\$F.go" } { # This tests specific handling of the gc compiler on types # that are too large. It is target specific in a way I # haven't bothered to check for here. + } elseif { $test_line == "// \$G \$D/\$F.go && \$L -X main.tbd hello \$F.\$A && ./\$A.out" } { + # This tests the gc ld -X option, which gccgo does not + # support. + } 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" + || $test_line == "// \$G \$D/pkg.go && pack grcS pkg.a pkg.\$A 2> /dev/null && rm pkg.\$A && \$G -I. -u \$D/main.go" } { + # This tests the gc -u option, which gccgo does not + # support. } else { clone_output "$name: unrecognized test line: $test_line" unsupported $name @@ -1142,6 +984,7 @@ proc go-gc-tests { } { set go_compile_args "" set go_execute_args "" + set TORTURE_OPTIONS [list { -O2 -g }] } set dg-do-what-default ${saved-dg-do-what-default} diff --git a/gcc/testsuite/go.test/test/235.go b/gcc/testsuite/go.test/test/235.go index 03143a60d83..6745dde41ab 100644 --- a/gcc/testsuite/go.test/test/235.go +++ b/gcc/testsuite/go.test/test/235.go @@ -1,9 +1,12 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Solve the 2,3,5 problem (print all numbers with 2, 3, or 5 as factor) using channels. +// Test the solution, silently. + package main type T chan uint64 diff --git a/gcc/testsuite/go.test/test/64bit.go b/gcc/testsuite/go.test/test/64bit.go index 9e91a97fd57..7ad28ad4bc0 100644 --- a/gcc/testsuite/go.test/test/64bit.go +++ b/gcc/testsuite/go.test/test/64bit.go @@ -1,6 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go && -// $G tmp.go && $L tmp.$A && ./$A.out || echo BUG: 64bit -// rm -f tmp.go +// runoutput // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/alias.go b/gcc/testsuite/go.test/test/alias.go index 639a9cabbb4..ec93a2d101f 100644 --- a/gcc/testsuite/go.test/test/alias.go +++ b/gcc/testsuite/go.test/test/alias.go @@ -1,13 +1,14 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main - // Test that error messages say what the source file says // (uint8 vs byte, int32 vs. rune). +// Does not compile. + +package main import ( "fmt" diff --git a/gcc/testsuite/go.test/test/alias1.go b/gcc/testsuite/go.test/test/alias1.go index e8ef8a23f96..4219af8cd58 100644 --- a/gcc/testsuite/go.test/test/alias1.go +++ b/gcc/testsuite/go.test/test/alias1.go @@ -1,14 +1,14 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main - // Test that dynamic interface checks treat byte=uint8 // and rune=int or rune=int32. +package main + func main() { var x interface{} diff --git a/gcc/testsuite/go.test/test/append.go b/gcc/testsuite/go.test/test/append.go index e178f46990d..3f6251ee507 100644 --- a/gcc/testsuite/go.test/test/append.go +++ b/gcc/testsuite/go.test/test/append.go @@ -1,10 +1,10 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Semi-exhaustive test for append() +// Semi-exhaustive test for the append predeclared function. package main @@ -27,6 +27,7 @@ func main() { } verifyStruct() verifyInterface() + verifyType() } @@ -230,3 +231,17 @@ func verifyInterface() { verify("interface l", append(s), s) verify("interface m", append(s, e...), r) } + +type T1 []int +type T2 []int + +func verifyType() { + // The second argument to append has type []E where E is the + // element type of the first argument. Test that the compiler + // accepts two slice types that meet that requirement but are + // not assignment compatible. The return type of append is + // the type of the first argument. + t1 := T1{1} + t2 := T2{2} + verify("T1", append(t1, t2...), T1{1, 2}) +} diff --git a/gcc/testsuite/go.test/test/args.go b/gcc/testsuite/go.test/test/args.go index ba9a377a6f8..9cfddc338b0 100644 --- a/gcc/testsuite/go.test/test/args.go +++ b/gcc/testsuite/go.test/test/args.go @@ -1,9 +1,14 @@ // $G $F.go && $L $F.$A && ./$A.out arg1 arg2 +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test os.Args. + package main import "os" diff --git a/gcc/testsuite/go.test/test/assign.go b/gcc/testsuite/go.test/test/assign.go index 2192f9ede08..da0192f838d 100644 --- a/gcc/testsuite/go.test/test/assign.go +++ b/gcc/testsuite/go.test/test/assign.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify simple assignment errors are caught by the compiler. +// Does not compile. + package main import "sync" diff --git a/gcc/testsuite/go.test/test/assign1.go b/gcc/testsuite/go.test/test/assign1.go index 71e5b406439..b9e0325ce8c 100644 --- a/gcc/testsuite/go.test/test/assign1.go +++ b/gcc/testsuite/go.test/test/assign1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify assignment rules are enforced by the compiler. +// Does not compile. + package main type ( diff --git a/gcc/testsuite/go.test/test/bench/garbage/Makefile b/gcc/testsuite/go.test/test/bench/garbage/Makefile index 8002a2017bc..98838453aa6 100644 --- a/gcc/testsuite/go.test/test/bench/garbage/Makefile +++ b/gcc/testsuite/go.test/test/bench/garbage/Makefile @@ -2,27 +2,22 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -include ../../../src/Make.inc - ALL=\ parser\ peano\ tree\ tree2\ -all: $(addsuffix .out, $(ALL)) +all: $(ALL) -%.$O: %.go stats.go - $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go +%: %.go + go build $*.go stats.go -%.out: %.$O - $(LD) -o $@ $*.$O - -%.bench: %.out - time ./$*.out +%.bench: % + time ./$* bench: $(addsuffix .bench, $(ALL)) clean: - rm -f *.[$(OS)] $(addsuffix .out, $(ALL)) + rm -f $(ALL) diff --git a/gcc/testsuite/go.test/test/bench/garbage/parser.go b/gcc/testsuite/go.test/test/bench/garbage/parser.go index 9e15f6c0f4d..b91e0248f53 100644 --- a/gcc/testsuite/go.test/test/bench/garbage/parser.go +++ b/gcc/testsuite/go.test/test/bench/garbage/parser.go @@ -73,7 +73,7 @@ func parseDir(dirpath string) map[string]*ast.Package { } func main() { - st := &runtime.MemStats + st := new(runtime.MemStats) packages = append(packages, packages...) packages = append(packages, packages...) n := flag.Int("n", 4, "iterations") @@ -83,14 +83,17 @@ func main() { var lastParsed []map[string]*ast.Package var t0 time.Time + var numGC uint32 + var pauseTotalNs uint64 pkgroot := runtime.GOROOT() + "/src/pkg/" for pass := 0; pass < 2; pass++ { // Once the heap is grown to full size, reset counters. // This hides the start-up pauses, which are much smaller // than the normal pauses and would otherwise make // the average look much better than it actually is. - st.NumGC = 0 - st.PauseTotalNs = 0 + runtime.ReadMemStats(st) + numGC = st.NumGC + pauseTotalNs = st.PauseTotalNs t0 = time.Now() for i := 0; i < *n; i++ { @@ -107,6 +110,9 @@ func main() { } t1 := time.Now() + runtime.ReadMemStats(st) + st.NumGC -= numGC + st.PauseTotalNs -= pauseTotalNs fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n", st.Alloc, st.TotalAlloc, st.Sys, @@ -142,9 +148,7 @@ var packages = []string{ "container/list", "container/ring", "crypto/aes", - "crypto/blowfish", "crypto/hmac", - "crypto/md4", "crypto/md5", "crypto/rand", "crypto/rc4", @@ -155,7 +159,6 @@ var packages = []string{ "crypto/subtle", "crypto/tls", "crypto/x509", - "crypto/xtea", "debug/dwarf", "debug/macho", "debug/elf", @@ -164,7 +167,6 @@ var packages = []string{ "encoding/ascii85", "encoding/base64", "encoding/binary", - "encoding/git85", "encoding/hex", "encoding/pem", "os/exec", @@ -193,8 +195,6 @@ var packages = []string{ "mime", "net", "os", - "os/signal", - "patch", "path", "math/rand", "reflect", @@ -214,11 +214,9 @@ var packages = []string{ "testing", "testing/iotest", "testing/quick", - "testing/script", "time", "unicode", "unicode/utf8", "unicode/utf16", - "websocket", "encoding/xml", } diff --git a/gcc/testsuite/go.test/test/bench/garbage/peano.go b/gcc/testsuite/go.test/test/bench/garbage/peano.go index f1ad6ed699c..6c7e523145a 100644 --- a/gcc/testsuite/go.test/test/bench/garbage/peano.go +++ b/gcc/testsuite/go.test/test/bench/garbage/peano.go @@ -1,4 +1,4 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/bench/garbage/stats.go b/gcc/testsuite/go.test/test/bench/garbage/stats.go index 985e7eaf5dc..6dc0aeb2331 100644 --- a/gcc/testsuite/go.test/test/bench/garbage/stats.go +++ b/gcc/testsuite/go.test/test/bench/garbage/stats.go @@ -12,17 +12,23 @@ import ( ) func gcstats(name string, n int, t time.Duration) { - st := &runtime.MemStats - fmt.Printf("garbage.%sMem Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs) - fmt.Printf("garbage.%s %d %d ns/op\n", name, n, t.Nanoseconds()/int64(n)) - fmt.Printf("garbage.%sLastPause 1 %d ns/op\n", name, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))]) - fmt.Printf("garbage.%sPause %d %d ns/op\n", name, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC)) + st := new(runtime.MemStats) + runtime.ReadMemStats(st) + nprocs := runtime.GOMAXPROCS(-1) + cpus := "" + if nprocs != 1 { + cpus = fmt.Sprintf("-%d", nprocs) + } + fmt.Printf("garbage.%sMem%s Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, cpus, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs) + fmt.Printf("garbage.%s%s %d %d ns/op\n", name, cpus, n, t.Nanoseconds()/int64(n)) + fmt.Printf("garbage.%sLastPause%s 1 %d ns/op\n", name, cpus, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))]) + fmt.Printf("garbage.%sPause%s %d %d ns/op\n", name, cpus, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC)) nn := int(st.NumGC) if nn >= len(st.PauseNs) { nn = len(st.PauseNs) } t1, t2, t3, t4, t5 := tukey5(st.PauseNs[0:nn]) - fmt.Printf("garbage.%sPause5: %d %d %d %d %d\n", name, t1, t2, t3, t4, t5) + fmt.Printf("garbage.%sPause5%s: %d %d %d %d %d\n", name, cpus, t1, t2, t3, t4, t5) // fmt.Printf("garbage.%sScan: %v\n", name, st.ScanDist) } diff --git a/gcc/testsuite/go.test/test/bench/garbage/tree2.go b/gcc/testsuite/go.test/test/bench/garbage/tree2.go index 6d78f72c5b8..a171c696bbc 100644 --- a/gcc/testsuite/go.test/test/bench/garbage/tree2.go +++ b/gcc/testsuite/go.test/test/bench/garbage/tree2.go @@ -11,6 +11,7 @@ import ( "os" "runtime" "runtime/pprof" + "time" "unsafe" ) @@ -30,6 +31,7 @@ var ( heap *Object calls [20]int numobjects int64 + memstats runtime.MemStats ) func buildHeap() { @@ -55,10 +57,10 @@ func buildTree(objsize, size float64, depth int) (*Object, float64) { func gc() { runtime.GC() - runtime.UpdateMemStats() - pause := runtime.MemStats.PauseTotalNs - inuse := runtime.MemStats.Alloc - free := runtime.MemStats.TotalAlloc - inuse + runtime.ReadMemStats(&memstats) + pause := memstats.PauseTotalNs + inuse := memstats.Alloc + free := memstats.TotalAlloc - inuse fmt.Printf("gc pause: %8.3f ms; collect: %8.0f MB; heapsize: %8.0f MB\n", float64(pause-lastPauseNs)/1e6, float64(free-lastFree)/1048576, @@ -71,9 +73,9 @@ func main() { flag.Parse() buildHeap() runtime.GOMAXPROCS(*cpus) - runtime.UpdateMemStats() - lastPauseNs = runtime.MemStats.PauseTotalNs - lastFree = runtime.MemStats.TotalAlloc - runtime.MemStats.Alloc + runtime.ReadMemStats(&memstats) + lastPauseNs = memstats.PauseTotalNs + lastFree = memstats.TotalAlloc - memstats.Alloc if *cpuprofile != "" { f, err := os.Create(*cpuprofile) if err != nil { @@ -82,7 +84,12 @@ func main() { pprof.StartCPUProfile(f) defer pprof.StopCPUProfile() } - for i := 0; i < 10; i++ { + const N = 10 + var t0 time.Time + for i := 0; i < N; i++ { + t0 = time.Now() gc() } + // Standard gotest benchmark output, collected by build dashboard. + gcstats("BenchmarkTree2", N, time.Now().Sub(t0)) } diff --git a/gcc/testsuite/go.test/test/bench/go1/Makefile b/gcc/testsuite/go.test/test/bench/go1/Makefile deleted file mode 100644 index 94847438f9c..00000000000 --- a/gcc/testsuite/go.test/test/bench/go1/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include $(GOROOT)/src/Make.inc - -TARG=go1 -GOFILES=\ - dummy.go\ - -include $(GOROOT)/src/Make.pkg diff --git a/gcc/testsuite/go.test/test/bench/go1/_testmain.go b/gcc/testsuite/go.test/test/bench/go1/_testmain.go deleted file mode 100644 index bedc373a575..00000000000 --- a/gcc/testsuite/go.test/test/bench/go1/_testmain.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import target "go1" -import "testing" -import "regexp" - -var tests = []testing.InternalTest{ -} - -var benchmarks = []testing.InternalBenchmark{ - {"go1.BenchmarkBinaryTree17", target.BenchmarkBinaryTree17}, - {"go1.BenchmarkFannkuch11", target.BenchmarkFannkuch11}, - {"go1.BenchmarkGobDecode", target.BenchmarkGobDecode}, - {"go1.BenchmarkGobEncode", target.BenchmarkGobEncode}, - {"go1.BenchmarkGzip", target.BenchmarkGzip}, - {"go1.BenchmarkGunzip", target.BenchmarkGunzip}, - {"go1.BenchmarkJSONEncode", target.BenchmarkJSONEncode}, - {"go1.BenchmarkJSONDecode", target.BenchmarkJSONDecode}, - {"go1.BenchmarkRevcomp25M", target.BenchmarkRevcomp25M}, - {"go1.BenchmarkTemplate", target.BenchmarkTemplate}, -} -var examples = []testing.InternalExample{} - -var matchPat string -var matchRe *regexp.Regexp - -func matchString(pat, str string) (result bool, err error) { - if matchRe == nil || matchPat != pat { - matchPat = pat - matchRe, err = regexp.Compile(matchPat) - if err != nil { - return - } - } - return matchRe.MatchString(str), nil -} - -func main() { - testing.Main(matchString, tests, benchmarks, examples) -} diff --git a/gcc/testsuite/go.test/test/bench/go1/dummy.go b/gcc/testsuite/go.test/test/bench/go1/dummy.go deleted file mode 100644 index 4956bc7b79f..00000000000 --- a/gcc/testsuite/go.test/test/bench/go1/dummy.go +++ /dev/null @@ -1,3 +0,0 @@ -package go1 - -// Nothing to see here: everything is in the _test files. diff --git a/gcc/testsuite/go.test/test/bench/go1/fasta_test.go b/gcc/testsuite/go.test/test/bench/go1/fasta_test.go index dcb2d1055d9..bff056fa90c 100644 --- a/gcc/testsuite/go.test/test/bench/go1/fasta_test.go +++ b/gcc/testsuite/go.test/test/bench/go1/fasta_test.go @@ -4,9 +4,24 @@ package go1 +import "runtime" + // Not a benchmark; input for revcomp. -var fasta25m = fasta(25e6) +var fastabytes = makefasta() + +func makefasta() []byte { + var n int = 25e6 + if runtime.GOARCH == "arm" { + // TODO(dfc) remove this limitation after precise gc. + // A value of 25e6 consumes 465mb of heap on 32bit + // platforms, which is too much for most ARM systems. + // A value of 25e5 produces a memory layout that + // confuses the gc on 32bit platforms. So 25e4 it is. + n = 25e4 + } + return fasta(n) +} func fasta(n int) []byte { out := make(fastaBuffer, 0, 11*n) diff --git a/gcc/testsuite/go.test/test/bench/go1/gob_test.go b/gcc/testsuite/go.test/test/bench/go1/gob_test.go index 00eeed57a56..b172b805ad2 100644 --- a/gcc/testsuite/go.test/test/bench/go1/gob_test.go +++ b/gcc/testsuite/go.test/test/bench/go1/gob_test.go @@ -21,9 +21,7 @@ var ( gobdata *JSONResponse ) -func gobinit() { - // gobinit is called after json's init, - // because it uses jsondata. +func init() { gobdata = gobResponse(&jsondata) var buf bytes.Buffer diff --git a/gcc/testsuite/go.test/test/bench/go1/gzip_test.go b/gcc/testsuite/go.test/test/bench/go1/gzip_test.go index c9eeb175f53..fe4c480eb84 100644 --- a/gcc/testsuite/go.test/test/bench/go1/gzip_test.go +++ b/gcc/testsuite/go.test/test/bench/go1/gzip_test.go @@ -21,20 +21,14 @@ var ( func init() { var buf bytes.Buffer - c, err := gz.NewWriter(&buf) - if err != nil { - panic(err) - } + c := gz.NewWriter(&buf) c.Write(jsongunz) c.Close() jsongz = buf.Bytes() } func gzip() { - c, err := gz.NewWriter(ioutil.Discard) - if err != nil { - panic(err) - } + c := gz.NewWriter(ioutil.Discard) if _, err := c.Write(jsongunz); err != nil { panic(err) } diff --git a/gcc/testsuite/go.test/test/bench/go1/json_test.go b/gcc/testsuite/go.test/test/bench/go1/json_test.go index 5a3012167b1..614e24a810c 100644 --- a/gcc/testsuite/go.test/test/bench/go1/json_test.go +++ b/gcc/testsuite/go.test/test/bench/go1/json_test.go @@ -17,11 +17,11 @@ import ( ) var ( - jsonbytes []byte - jsondata JSONResponse + jsonbytes = makeJsonBytes() + jsondata = makeJsonData() ) -func init() { +func makeJsonBytes() []byte { var r io.Reader r = strings.NewReader(jsonbz2_base64) r = base64.NewDecoder(base64.StdEncoding, r) @@ -30,12 +30,15 @@ func init() { if err != nil { panic(err) } - jsonbytes = b + return b +} - if err := json.Unmarshal(jsonbytes, &jsondata); err != nil { +func makeJsonData() JSONResponse { + var v JSONResponse + if err := json.Unmarshal(jsonbytes, &v); err != nil { panic(err) } - gobinit() + return v } type JSONResponse struct { diff --git a/gcc/testsuite/go.test/test/bench/go1/mandel_test.go b/gcc/testsuite/go.test/test/bench/go1/mandel_test.go new file mode 100644 index 00000000000..888c5e4ea82 --- /dev/null +++ b/gcc/testsuite/go.test/test/bench/go1/mandel_test.go @@ -0,0 +1,41 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This benchmark, taken from the shootuot, tests floating point performance. + +package go1 + +import "testing" + +func mandelbrot(n int) int { + const Iter = 50 + const Zero float64 = 0 + const Limit = 2.0 + ok := 0 + for y := 0; y < n; y++ { + for x := 0; x < n; x++ { + Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero + Cr := (2*float64(x)/float64(n) - 1.5) + Ci := (2*float64(y)/float64(n) - 1.0) + + for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ { + Zi = 2*Zr*Zi + Ci + Zr = Tr - Ti + Cr + Tr = Zr * Zr + Ti = Zi * Zi + } + + if Tr+Ti <= Limit*Limit { + ok++ + } + } + } + return ok +} + +func BenchmarkMandelbrot200(b *testing.B) { + for i := 0; i < b.N; i++ { + mandelbrot(200) + } +} diff --git a/gcc/testsuite/go.test/test/bench/go1/parser_test.go b/gcc/testsuite/go.test/test/bench/go1/parser_test.go new file mode 100644 index 00000000000..26580b88725 --- /dev/null +++ b/gcc/testsuite/go.test/test/bench/go1/parser_test.go @@ -0,0 +1,43 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package go1 + +// go parser benchmark based on go/parser/performance_test.go + +import ( + "compress/bzip2" + "encoding/base64" + "go/parser" + "go/token" + "io" + "io/ioutil" + "strings" + "testing" +) + +var ( + parserbytes = makeParserBytes() +) + +func makeParserBytes() []byte { + var r io.Reader + r = strings.NewReader(parserbz2_base64) + r = base64.NewDecoder(base64.StdEncoding, r) + r = bzip2.NewReader(r) + b, err := ioutil.ReadAll(r) + if err != nil { + panic(err) + } + return b +} + +func BenchmarkParse(b *testing.B) { + b.SetBytes(int64(len(parserbytes))) + for i := 0; i < b.N; i++ { + if _, err := parser.ParseFile(token.NewFileSet(), "", parserbytes, parser.ParseComments); err != nil { + b.Fatalf("benchmark failed due to parse error: %s", err) + } + } +} diff --git a/gcc/testsuite/go.test/test/bench/go1/parserdata_test.go b/gcc/testsuite/go.test/test/bench/go1/parserdata_test.go new file mode 100644 index 00000000000..113e5e3e38e --- /dev/null +++ b/gcc/testsuite/go.test/test/bench/go1/parserdata_test.go @@ -0,0 +1,245 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Input for parser benchmark. +// This was generated by starting with a the contents of +// src/pkg/go/parser/parser.go at rev 9b455eb64690, then +// compressing with bzip2 -9, then encoding to base64. +// We compile the data into the binary so that the benchmark is +// a stand-alone binary that can be copied easily from machine to +// machine. parser_test.go decodes this during init. + +package go1 + +var parserbz2_base64 = "QlpoOTFBWSZTWd3QmOEAIYdfgHwwf//6P7/v/+/////+YEhcAAAB7hwvVWWaZT1X0dt999296z5B" + + "3mcQqlBVVVB7hnASWJoFGq9jlHvZHRbdfIB0Hz6fW+jrz4dueD73be6c33tG7la1O9d154ntzzk7" + + "jnU+O50zayubCulvgBm7rou5jleOe730dzX2sUbWj1u215X2PBXY17GB3Y3NznVW7ubOuu5a5wHc" + + "d9h69Xtatru8+D21uj7bM3lBKdRzPul3bt3GUtvN7z1PfCU0QIAmppkxQYg0Ap5NQZTxR6myJp6m" + + "T1D1NMgYSmgQggmiajIZKep5R6mh6jyh6RoA0BoGmg9RoCTSREEEAnqnpqbKp+alNk0ajR+qeiNB" + + "k9TanpMhtQDQBJ6pSkSTyPVPU/VP1PShkepoaGTTDSBoaAAyANDQMIkRE0lPTaZBTyYlRp/ok1Pa" + + "Rkm09Gk1PaptQAaDR6gPUESRAmQQ0Cnqm9NNBNMlPyj0iPQyQaBp6gAaaB8HrtSFgsiaNsTLSbZS" + + "paVaq+DW1qDTQ1FEYixSRiwlmJFRJrBmbIYoNEYoylREClbZLFikJKNRBFApgUQ1GShKjaSyRCCG" + + "UixqTabS2lLZiEgaKDZLMoxFY1o2LULILGDEJsWwMhbMzWlpbZm0bCaSS0NlmDGZIiRWIoxorEiG" + + "IxTJIyIGU22xsKzSqlMUUmjYE0bTGWaalWxLIlMQqECLEliKYskmLSSjKTKRYGRZmUZpARUKYttm" + + "ajIMrKGY0UUglEiWbM0tJsbGyzIk2myi0ZVYlsNRhGlFhJVKmwxloaVklNFBtDIZTQkyhowI0Qxp" + + "JTJsyVRUijUs1e9rpIS0kNLGYkko0WswwxrCAwJFBiLERYpFI14/l8d//VUo/f2Ofl/4/PMmROiP" + + "+X86qHV/m2eKhwgQcW/w+YWCErVRZu5/WnEVaZnt7Tfo5OP8TQ/6bme17VqPoaBMhDbuEqkuzjiW" + + "z4vygpH+2bkcU5nBikvEzgwxXZ804V1e1KpfovBAJKnhrcaHdoN4aEJHqHLUlmyGcSUjUdCvTYRP" + + "65aIz4POFpBLH+m+1Lbs7kPa+GjGbi6lF6kRnzeuKKJqJcsR2+EnuemMS9kr4tXWry3r+bgQMkhI" + + "ZkgILVvncoXREIltDqJkTlIBmQtrNEYdUFfdE6C6Uevosypd0519H9t17FtHW8FHImhH595l8V5y" + + "Dy7pYjFXqJ5ud+fYaJuGUNoK/3zpKZs3XTCeRxe50nakx0WoD9OZ5fgiko2ifKT2JRWE470vIn9q" + + "YqZeDApYKszMZ8Mp+S+W5s96YNXPi2dlO/D+1qHRSrLkH4VE7L5oPiWGXTwos+dnwniXQoVKJu+K" + + "Y9bmXzt/02qIskOq0b5TG05twenXqbgV7hVAkTElgmqsqORvcte/dakNMsd39HphWvVaeJ3rcihv" + + "cJ044ShoPW1kUxBbyYXSVcHhwcPSlRcSVjjMnnOumoi8tmS0XNbV8t7YwYi/pxq8j4IDzF6Gjjac" + + "8IstxcUEu4RJ7FipOLfio4rt9s7lfyvvwluT97uTcrpUBmf+k4nmsClh3fSIXpUhCQj0vMkt3PMf" + + "iudzHKBAPMXLy7ghISaEuIIZU7ueq2srC6YYkS+GIpVA78WOscuCQLNvB3uP5O/z7mxPA5zkIjIv" + + "KdUOFSCIx8N/Dub3Ur4WwQSti9vd16B9/Bzk1g28aiXYmRHTrN0J4cW8xmekkkaIMQXypKnBPZeW" + + "OTnpXqdzrz3NXv88RyB3SuMMy9e+YJ0LfvtfRletL4X4fU0YyG2EurWAFBlGvZ9Lzc161b0vZR3B" + + "lL54b52XxrzvXeyu0qCh3+Nv1LgzQhtksL1Oay/Q6uVSRCofJ3ZjFUiG7BtUBQ3ZQrIHZJxdYAou" + + "EFtGQkRJCQq1JlE0w7e/NTTmJ5ifsE62XbIaTAca2fb4+p0d8L19KX8vFwTin/n8OvB6c+3w6PlS" + + "2goNsUIjAKysBZEGKrGSj9cuNPj5nrOYVHPsxLdGaeVHWXgKPR3anI5fKwnR8SM4fFetyzwPhxw0" + + "0lGM5Y02qqy7YY3+xFTHU9QtR7daZLEhpvsY3iDlipq2XAQehwfn9cm34kA9P19rUJ+RB7funX6O" + + "rB5/xJ4dxpknnVZFXSwLq0tDC4Oze4TN2dOHZ+HL8OJ6n/L8WuPeXeMpMQqItn4ZQfO+L6Ptnu6u" + + "udDLKkBnS6yOVFVGKAsixPT+D24mcn109jn27PhPK6x803RI7pvAz3Q/nYYY74mSvWccNSVVSvyz" + + "c5IPV1UejZKjmnB3wuXPfG8LTTGrMkIz6mh9EbgSSBOQqmfzXu/57PRZlKcl6buNSiCdgf939gq+" + + "zhn356ZdFGoGUfVHCdBp4HXcfZpWfVbdNxh1rxI/RvAK/e4fAR+AkS75mGZTvK5T2ob4g+HlN+LU" + + "ednbpvXKTzu+BgxnhWG7i9otZECZps3pIIspDTLQ0P+o0Ryw/UOpt+F7zIKwg3cxA7UQX8rxDUxI" + + "Ub/+uw6Qh0xwieVzEaeQKh8s5uI1o+buyWpo8kZVwjBN8JdsHV4lj5tdUIiOuIqskenyFpkcNGgK" + + "cV1ohgEbXdcF1bm2LHZwKinccZZqRh4EXGbbqNuTSUTM06DGbwI3IfZcrrVlRlyGvUPnKeM2tG+p" + + "U5Nk1fWcKXovwi7Bpm85156nFylux70tJGHWaxNqGt02UGzMM04bJc6GHl57m9PfjBeQ+vlgtDBA" + + "KJkoKJEjXjnqvAmY6RkaCUoeo1mVlVA+uUmbbBqU8dYZIxiwRH3Pxc3bOD9uB5Jlka6An6c9B9km" + + "OnDL+FHQTYNwgH8mavZz0iOu+Ut8/J5ZwyoIamzhyxBs8262E1X8Xfhle9iE4rVPPFLG0iTioWAU" + + "d3xVBGn0oRJqbxtUaxhpdln5NtolGMj59U8pg0/RSY4z7US2Ms+4/ppi54Z8T9x34FrNnEaNTupy" + + "0wwbD4jnv7F8vm1WllYykpcbxM8YVxcrK1o0GGUBvVUGqDpjwLUr17oxmaKusyyrqV4yu76rlNga" + + "TtCAVGwYMvm+SLMenn6P375gmvYRlpqskpNDxFJcfbkZ8bux2QkkYKLPJlJSlbCOPNDfSULNSdHM" + + "12MvGjz5tYTNEbhq9fk6J0QCf04np5cuTvdC7SzdPmMDWTDxiD5exXpVi41UM6eV+926tnWjqo1q" + + "KZvLp3rjuvrmxbB648TaJlIjEgjUx2qKW6HRaInEGHsXUxFRTPPAsGXwgtoi1905O44+FkV9ctb8" + + "7pZtlllncqNGbJqP2LVNqa9WBOlqMdkm1w8mO+Ln3BLUvtWWl/CjfABpSq7mjGtMdPHs3a9OeOVw" + + "FHvW2fQeG243Jl69jvgx4jbSeVZ39VcNZNO5EiPRfOTlBHsZXX27TyO0b+abrFZ3Bwdx+c+uRVo/" + + "TEFzLJ4uXS1FoXdJblwzfjW0rcGlZ5Jqs3Gb4iESyfmdVpU6i2DtBPBtsn+nlb95Y0pWMDBM3ZBZ" + + "pyIEncddO3bafpssEObXLaLNvraGuJMzgiNF3+t2uZC633wwUji1sLoiU6X4kuZkEjKHnqmi1zXF" + + "+dM6MTtO9N5yDve47yIt/CkoVoTbWfc9E1Gs8e19PLxPS0i18ldi6xjw2bsWfjR9Dp21w5ImY6xr" + + "3J+BF35JgmZMT8PbEXlDThrTfEMkkrCcD1u+XbyIkkjGCc6Vc2Vr5X53XPuwfOuM31yem0tXg9uZ" + + "1kj2P4Hx03wa13qdX0xDFNlPCYxkY+xVhq2lCzma5tkZ/FD3755LyZbdshsWTGsbInzJ39+zd/Ly" + + "PMkJ079dteGN01Roys7oKtfDIa/N26YWY4Poq35WHTCM1DF7S5me2r5ahhiLl0ch545YQ+r57a4+" + + "Ls9VjY5Pswwk2x9S45uMQ770ssfjbRB1U2hF/DV8nak751LqONvJs28E0JmDcmEwIr4sB1uClx2b" + + "PpWuRnAWq7oEmSBKbowbbW2lGqi1nh35psMxUZ4d+FxK4uHVZNA7vU5qm0rUs1IoT9jPLkrzJ83e" + + "t1ZM+BwItwHrFPb5jtL228eV0ZUpLZphfFKj2DCkzbKiv1ODiobghZh44PzyoxgKV5SnP3VUGTRN" + + "h9Nr5MyMQvBNTHpiwN1N4241qJaQRhUVtKiMhjJjCNoYkMErArCTYOiM3SF88PVh9B9XSdDzTkqF" + + "hbUSnyoH1EwYMUaOhcqJmWVqsWHxhPCckWK3GaoqMmowMyzTBWal1P5eL2sVtZ+drjsx40brxVOg" + + "xhzdgFm5kg3UcZubj4zvW6QQgvvcd3x612pOT21AWT5bhwppdXYsSL7GRd0DB39io1hcZp98dpdP" + + "I7tjczPaDZBPL3EuO1nUrIw7csHF06ZNzmmUd+3TFNPvpr63hVjYTlSF4RbMRaymDlUJwWzYoxO+" + + "Ig6OY5Pjo2li+/s0+z4u+7OhBI5khOnopHj9a8efW8cp+r7kZeu8s3bbvYS+DWbWy1roJ0p1AeY2" + + "X+fziwq7PTod5KluzFOwS5vjjtukunB1xtG3rkji+868nZBbnTAgkLNN9Ezlg98Zlxha5827EPn0" + + "5OW6tutYMa9O+U5TiKz0ggzo3G2J1u6vrY40j3UfBNuDg2ONsRwUmNyZMREtEUZK8Ifne0GcxmXx" + + "L3F7fRIQk3RU2t4jbit2VdddKuMkXMTSERChLhN68Hj0bbJ7JYxZ8evJ8+Y5Lg119jsTYSQ6dxXs" + + "VKvg4DSyNLKMC2MsbYLARKFWKlCw5wzKlkQYWgttGacw160+Qze+GHCZbC2hGlGVjaX3h5YYzj3f" + + "DFYvzyl4YkBZrrrZtfQbVtkyqYQ+rtBBDGBnuPOcHrLOPXfllLstfKRrywI0ctF5F0qltBsNN9Rh" + + "msY8es8xjHtcrxnobZe4k3Nuc51d2e2RHRpNSdoNbT25KkUrQtDy69Wxwnnyc1tdraRFtHagZVH9" + + "q2swXNQyLCahLQC4szGKaGZKqLSiD3FjPm/7PL5ZHq/XmHmEJ77utU9tZ2zp/ODPCfhI7MvpP+fy" + + "16rtvaad6gz2zk1d2YaqMavtFjzK6opMh34RTf/flWMJ0d7tOtpgM0vJ8dPn/rfB5LrZc+fPfnI5" + + "rc/tsb5rm3jyV0qOxk6ObY8ZOaTIvk1eLm6lLtZNvtx1laKDXauwgE+92StvSXJZab2zM2l3uYmi" + + "IVzSVvVOIE4TEEKad3HGSKygKpCaSo7ct+/dUzPu1tE3+lX/Z7WAD7kwJdnl+r5V6jq7Plwv+rjb" + + "GTGL+z9mNjB3cVT+p/DcR60xRs/IsnzfdPSZMlJLJOVkTvp0jO+LfL4X27EcdvPDw3v6OjWSz+TJ" + + "Z5l8HIoiquZXPPLqmEUOm39RGa3IwsOfguiZmZqIF2DsDpJJiTapSFYKFGDTr79fD/h/Z/kw1/A/" + + "zxQAZAP48GZxmZj/BHm7jPl4tco2zu/RSCM1VNCZI5cwWyltz3GeHlL+w1PK7o8fDTfJUfwq7AqK" + + "ElR/1UhrVBdYNUW0LBlGoIo+JbBiaGwNIKCvd/VrVuIOVY+HGZJzZzhRE6ckuA8ticpZOPpOuuXa" + + "KImu3UyMxO1amcSxC8mbshm5/lIYjo5kHcND4/kn8sbsRwh++dFinScFgHcTjpweH3aAkjJ7NZJh" + + "ddL2dOl6oL1jLNaYM1MgGs52V9cDhBLMwwtZ5YpSzsDNuTpQts24pU5iwhxqgIHKpU1yJCBXnBEJ" + + "mSqlV5u7exQh/p1mcnW7JmCri2y1MbKmcokR2TAXipUQkC6CwwQ12Gjnm44X1tVZUp3wlIdJOO5m" + + "wrczzu+aFaUilZUS7dnOxbWfWcQeSZ0hL7XHvhkbDzwo37Y5ckj7LmXmHin4QLlw9Ec5/JGyztRG" + + "X77Pgow2DsQ6pFw8CK6PUTSTZrWK6ms1J4xnhI0q8I+Ssvmmx/P/r7qE2bRAJB9mf25A5z30NtnL" + + "6Pmqft54xt9X3KrN/NSEF1a4R938Ou1vHaOqTRyvO2h+ZZqd1LGaryhzy460Fwfoi7DtiepNdA+V" + + "zXPjwfHd+wQOyGMkj0raTGF7VnkvOqpmpZThtUdNn0VJPsKqbdOUAo16juWVKpvxIwUefdTGVI2W" + + "xt5rY2t2viki9JK9xd3SJIkOhySAxWJLCGZb4LrTCT3qPu7MoTJE10zkYWgeyawo1blLhbkKGHiZ" + + "SLONHph0Zmnz1cYA3RqHbyrB/NqTf4rxWClAjux9sybomMloiRMm9QlnP6Jj5HvtjsYF7il7l0jX" + + "MtL9sUMBEpx91hbl+/jW3jqZXfdEZMIOccK6re+rHGqfbGxjYnnDOe8T4OziLqEn8cDo8U3uZNI9" + + "+rZY/1+m9aZrGv2EaunZM0m5cU7X1POp5guRbRg2tot/g+/jYyTAipiYd30IhHmjxz8Zc2rQjdcb" + + "5CZdXH3fH4T9H42O/j68ZVXgty63afB3lwUIheY9TdWksCKNItEw8L7kwgGaLvc85h6mRaQPm7YI" + + "mYnovikrbjd2eGmWNRN588bS0s7T3WjL59IZlW4eJhSFGPW6EDovZLjfDVL74o92s5lyAyQ4INyq" + + "gVzWv/j4aw+H6buyxIjRdfRDyZb+NHWrsD23UhRwlyzY42awYWc6lfzag5F55eStTf9rRhuzVROE" + + "jAmYZ2bWlICbSehLazA+NNsC7SnKNbXXUMrObZXU0bFu+phdvVja6/DNCQkzS4XqDWlrDytvLVIO" + + "fd2Xj0O24X1z453ylFk/j9ve4lz+B8utfOXokeilpTm1L/zvXc5+pNcY/uLmvZPpsezuc4Z+g7I8" + + "lVPy/Et9eH+Y3vZIZe+aB/CTMODCDJOMeDdsmKt29WEjDc9AfZ4u1pPukz03zhZ+vzRdmsXjjreU" + + "wgzctKJSRVDe5xLLIZmbgWLsFfHqm+F1I9+nyKo9edkYW3R9Ipo983Z02KIfdeHBkMHHn8DW4nz1" + + "+5mgdApk5IURBIgEE7boPGAFYAPquEaBic/Rwmnq20EA1FiEVQjBjJBIBfYUfkDwGbkAZUUtZlor" + + "CGHFFIkqUrRhxgMJB68bJedguTa7L1cmjNiwpEjFYmlAFEANGhRu+FBdJgUlb+itYpLhS9e+sqou" + + "8GwAGRQBD6gRE4/rD9x71IXGomMpBwzAxWCKQqUBQqNKgqXLiV3bppW8JdCriy8WRjlL/y1ldMRN" + + "K2pRQFbRHHIpqmjKgqoiL/dcyukplgqt/fhMTEmmVy2jHGg399Na2lx0mApifu28Z7LB3WyX7mAd" + + "D99Hq/Cj0hGInwCg7T8PY/TDUMet3DA3yc4aFiKkE/pSz+ovbPD+L8fxI+cfp22n9HmdfqF67pXR" + + "+uPpkTj7JuUM554R0uKFZo0uwL/244GOE/tg+zWdJ3fbGmaQg1dnHTLH4+KPnFDj9Vq1ZNL/eozL" + + "Oipce/ukJE/6vGGCvqFnbZvqQ34x9B/Cr02eF0o6TvQP8Djg+slju2sLO0IOiOv32aRo+4034LLE" + + "svPHM1XAdlzu7umNN0T+MWQPqHjxOSv6tjrUsed7MxDZ6lscn38Yw1ZDHN27SuxtezttN+ryiaRO" + + "XO4cZxK4nG9Sxll+s7P2/WoC06HgAniO1M0rO00euOEpcOtyWHtwG/d+iPxcl+LSkORcLIsRkQRY" + + "xZkpLTK1Uf7q5MMuiLCRIiIxg39+YMUrdMoqnzK8S9SZNNjS6vRlVG0vLrmmBkmElFkgUhqSZUoy" + + "UmokxRtubunYNSN3r7eVeSuxCvS8sVJUbTZpialZgpN5eSOUARUHSKXmk/EfaD1QAkB/R97g+n6D" + + "26vxDEMzIsfuDQBwA+SQf6mQD7t/2mqYNm7/n+41MP0TCXIP/o8z8QRjGRgqxFWaMY9g2K3/ibbn" + + "CVQUGLt/a2uMYK9wdkaT/RV/f+lsNgbDUGDIrtjJIGxuLmjHdRBiSlIeBRA55x/gJCZKPkGhb5gI" + + "JJWoXgE/xQxRGsG8zgwNRkv6s1qmrMuJy7kvcz9XJcvrH/OQ/BrAHAYpIjVX6fsgUoh9SE5Nnd3g" + + "zZ5U311/Jt21rX2reXWLDTZ/Plt2iTpC7o2wIXi1ZXpMuC6o8jl5NNK1ufiCI4QYZ8zRkXIHc+o2" + + "dz09LIeRrw6SiggEnXNekIZCX/GNh80mkAv64zdnUUYI0HBAe+mYJ+Nr1mrcgsto/JjUU7aG0HJw" + + "+mYzx3Gbozde2ufknoISciz5pzjP/aWwB0x5a9CZA/D50hrXtw0a0Z74AjpLgzVltLPpLeL6iG0q" + + "eT0iGQ45tex4C64YGHHmL7H5CevzIRfV6WbHr9aOqNxCD9C+CUGRTi4P7HgYpJAYcQYpUDlYDyTZ" + + "uEAOmsMCvAloH931YhIqh4pM4neZHlDC7ge0QXGq3/NLHebo/hoKeLx0j4W6vYfxgmqONk1Z7due" + + "evpJXmdZdgqUfrP4SJAw0cwobQOPhxgmZKfQ6vLuWksVK01CgzfuOkOo9dB+BxE22TtpuR0dZtWx" + + "5D1mSnijyQwYG81v3lFp1zqdJyCT3oUR+eWUtlMov3JgIyU0IgUjij0OEElhAMjJ+KcAgKEwiian" + + "dEBke53FPGUpTUCivh9BPQ6TeB4ItgkHv95D5ja/YbE5Kcso/Ah83Gd1SfgrmWZa+wPapwe4uj0T" + + "jpLP0z5aD7gqh2N4eknQHYyEYxifBLfE73Xh6/iQvh0EgZswbko0hjTQy+okSCPz/dRWAhP5wpqw" + + "140Z3KDUno9Mj1DVf4gJcEhAuAxueaRvE3g3ECbMUAsVZTVzNPYDHEzgiCIDpOcyoJLlCUYWcet4" + + "7ePfQZgnwEPNsoYMlyTqz+j5vpktwW0r+fzEMVLJS375MNcESaVLotl3VcK3PHTjsVVFJ3ImDNmM" + + "xZAMde2fScG8uc8ZcMpgfnzNJbcHJ2tm5zhDJDGicfN9dMfMjVUO1RR+3bf0eOIquh8+LnG2HusW" + + "sWYE+LoxjDBuDur0G2LibFPEDPZ4d2LsHxCzY+kya2SyDctcxxMbhDQmjhzXanEHsHH8Xxb+M/5d" + + "lqVPIKkHerSdSSUu9nMGRBMD0tkxGAww5uHB3dbnIY8H4jKEJt549/JdtanPlOc7z8dWrmousQIS" + + "QPL3dohW47oSBtCNlmbWOTkS4SZCy3G4kR8IhnaNmh5eqaUO9Tu3ljXXoe56jpfcnek/iH+H1vTx" + + "ToHonOg8Gwcx7QnNg24NQkJjgF94VHeqSTLUDqap8BMXW7Rgihk0fA15wQ+fmff999UT+MVilpVv" + + "9/P9iHQYfglcQJx1eTrPcf1s/YP0/8f1/u/caT99S5oXWNyhVBcMwDsM/jFSrOPBDwI70ki97A8P" + + "h7POfVftueN7/4bc3zV3EfGmj4EVKYLiCEiDYLHGYX9qm0SEAiRIEDuA8Z+YiYA/PUEkFF+MAKiR" + + "P2QpOQQdhjIkDIH1yFmsx7DTsealkpikVJonTCoxIp16sK8zzCRJJCfB+vkaptsMEMjbzVE6/9CC" + + "XslEEkDiZnPqb7xvvLWb6EBuGSpbCWJbOzPPIekhGTrDqCgCRGXg7wE/WCI+xZbbCVCIkySVhDU6" + + "iSHwoqKSnM9om4Z+VKwjShuINg52K8xiMgTwcy+gB5aaaOlIdh6ltZRzk3GM2E1j3QVv0JgtFBEi" + + "B9KFkiEEIztjqiVuhtcVgDgDMCQEiQclOBoAb8j0kNzmZqMgqIQiZyBxTqm6JIyIan6NinYhxYSG" + + "JyxBA7ymhR8re9Z0wbHbWDFwvUz+H2n2RjBgBMwyhQIayPV9Z14rzyRErRFjaGPLy67W6iyXl3Bi" + + "baZCCO67rXs83l5nOutKxBdZDJhhgR1o0apYxhmB4jBgRjEkIT4M9v1zp/I+fbCK8HnO575lkn/x" + + "DEhI1lUimGCeYmY5MEkeC/y8HN0fCoDIwZ9/3pzHcanVKpKQPfBNYgf8IpQ06r+VWJIT5W9+InZH" + + "GBcbENwEEToXgsIRM0+tLJYkbNix6sWTPLym4icYJ6NsCHrhCHEKRg49maIIwxhSFlsVLRgmJqBb" + + "AumFgMpAs0VWMksRvTYghmJ9oesSkwRgrCKDMOdW2onug6Y0rN142vIQBbkKICtRkQq6UsiWaIXf" + + "c4N2bAwue2bqKYCGpIiOjrJ9ILIqidEw1MsBF6lIgwsIUJQClSjJAxAJoD8OKwGYB+kzQbYCMTnC" + + "nptKOOJa5ZHsK0mYAYNjHHrhFUh+gdf22ft4lhwoht/4iB7pvf74yUstSpWW2BpaTEzMUNDT3+Xx" + + "tPZn5va3v7uWsyKsGANWqXAuyIX15bBzAkZcp8ThuDWjZkp7muszHKImsbggb0fmTRp3aoY0BZww" + + "qBtlHwvDMYcNnFUOcLBBiqRETh5a8C65MWUeQ3hMEGJA4axRgXCw3LeXMtTZrYS7gOPxqwk/9yho" + + "kEN2xaGzpqw0Sx7DP2Rx5OAjGC2nhkCp8eZ7Pcl6KjB7Y1OtCDUXvxr/fIo5Y61MRMo4QBdOORqc" + + "H7TSFEUZGRhWkgiiS2Vg2yEsAtkkoqEBBMU6tPGHlxJyOznTetzfbDkQQst0/e/824wA3uKb+eks" + + "8KhidRlsSMJBJEDAGfzk7/5Zwkpr3THH5M4PBEx5n17Ub0qggdJM6LfZGplTeD7d7M4RbsaW+zIh" + + "bbHrVtBWQYhgTBtzG8s+zmYYfbLM0FtOXg3zdMTnLhLwVII2G07inYX08zDn46f98SfttMDc7tdq" + + "tR1vJxHXPFvm56Di3fbb7CB5oO2a2Qkju78J+mXaTrL884tikdO2h9ScaToWOhUMzwO0W+zHSZ3r" + + "gy5mzHTPHYxsYRs8BGEQ+z4iyuKoWDUuxuuUwlwHdjD1w7IqRDSnYXEtsIFvacd43TY41gWmzczS" + + "imfZnvZw6hxrbbgziJaIZmveTeQXOoZsrON81oli52q8qR91ydprp136HHBswDP06BnoTlbpY3Bp" + + "hxKurWoC0sheZ0mG1NnXPK+WlJUMluUhjBkEb5UN5eLeEtxZkYYDTjx3XXn15raUWGBjKdQ2iYzq" + + "u80wb8DmFyWsdxFmhLGIyYgd3WU0Pd8HW9zvOpFDiJdh5QzUuMvN1MXW8Xc3O0TnOCSjDNYZY0OO" + + "1l7JZqnMMugzQwuoDOzTRBiDjHcGRGNUQQ2DOnKqECwRXKd7FCkOgWFiBxOkpCHZANAzRcxiCQYb" + + "TJBF6CLIoRQDtP4fLn9Peg4WBtZDpZ5UAwYLAEQURCfyfn6S47noxNAXMzYSQFhCCyECABAmB0Kz" + + "sw98wXf6rwgt4pBiQBukIhpoDiPT1PZtXMNxjvUQ4/qymZQ5rMw2BooMJn8SQkzvzpPgv1xtKu2M" + + "bMMfIRhYQNysAjqwTTY7i2ZqmOtw3gIc0oq6OqHWU39P0my8MNYbESokIP1kAOhFL2GQCw5GcPsj" + + "5BJdoBvGEeRzM8J2Jyx6nk5l6oJCrEGKvhCHMTXB1hYG1fP3a1n2ZA7vGrcbs+3KApFTBlZS2mMh" + + "JDECQxtcC34jSXUwOnsNeEHhiI8GWOiMInnEM6+bYdZ4z4ezEWCLEioyDEjAFmk+g8b2NRvRdMbj" + + "ZSNjM2KKmb6Ha6hS2zWlBqPh9L2eW2vVXy+veMsGVCKUsUCSoPWmmGMsjWUJLl8YlplnIPSBobnz" + + "ppHclkdYC2eWr5gqG0KcDtgoe2Bm1EVjFJ0rBCCqWhOGR00mSNBFDeJuA8I+jSGykN9il6Shmj1k" + + "D88BYgyLCe6lM1XjJDIY5DwVNmny26pmRqq5hxN0770E37hPulwMJkrjLS3TImIOLamTjAFEyWKm" + + "xQFKMhxOvYsr5MAgQ3/OJ4QOYm5WQP0hXg5AA5xQYME7fFCoBIJEOPM32CAfqQ2oO5cPfF8JERhB" + + "SU0J+SCWAXFy9RupRaY/bh9QdwQP3sZJHx6EPIQ+J8mOUvp8vfAfZP4sJgRGLbKMUgxAKRkKrCEi" + + "viWV+jrJIglYLIRqj0ko6QxcWWHtEoXyCSQbiZMgAicn6GG+0YcTCSFz0sVIOk4Sfnequ1CyymVQ" + + "LQ3mt2q9FRkJa3zVEkFgJjEzOjuygElBVCB2m2ZUnPzGrmfRqfDs8KSCiCMVjGD5EPW8dBEnA/dZ" + + "26RHQB3mI9AGQ0dG8Yez3OW9Uo2lBBthKkbYWuYUzxyEODR/OB+Mw09HWNPsDiBdsvpDYtitRVJQ" + + "bURSAxT1TiElh9RIO5SqWwOMh79GtpJXuRhkfidxAn0IIP0sULRYwRhbbbZVw8w3Dx69lZ8oQtn+" + + "wP+h0JOY/eeT4y/Y+mynVjc5IYJQb0t3QkHIPqgQ4JxJmb5W/6+t16TV6Q+by3Xlmv0stEbJZYrP" + + "3Vpoa9J+LBhGBGAPEoVOegvTxtQgwZRI2goEUkkG2VKwlJ0nh0HWKmRzfwpOI/YkTF/JwVzgiceK" + + "QIjIE8TnxOv173TUwNt4te2B1fU15wGEE6oPpez8o+JryMT3HvDXaF3ii9ywJEDh29LbRHw35sTZ" + + "HTbm0Dz3w6O+XOshot1XKs5Lyq9XgmgGRMLOl2h0wOL4dK8nS97r4YhKE+/uuOPkGz7ENQzrDqaK" + + "eCCxggisgKqJQkgGoosJGYdV6vjqW6etE4h8zj2jpuIA8yMkgoSDUix+cZAYrLAfWAwz41REqpH0" + + "nyD7fFGk2pLUWmZq0jVTaV87gpTimFoMk6CG0MKU9N2JZqGZMCzUFNQKXCFie2Bk6NFkN2iahqd0" + + "TUL0PoBd0Z290I/cUoEZ4MYRRbKLTp6ZNhloaSFsqo0paokUEGQjIQIiRYC/pNEC6IqiF8Dkeyqn" + + "JJo/j+AEzeusxpCBHZbt3Z3nEOiGpTDhSLd02YNlpvN3JN2biuIUTWVJkqlpZm2SadzIymtOoIwm" + + "9Cm4MSGFJl3fXvWwqG8TZUw4NAZGMJrJOfufKAya+i0Gw7zE2PDQVPZippYfkBJIblusI7LkQF4w" + + "TieqM1Q391XtVi1ECRGwuacU3RoM+hiBIFBRIZW/vXKsjEOMVmhRmGZaE7y9THsnwzG4vjKAkhGc" + + "wJ1qQdFgniU0EqNFctIja5vRKLqjOiKgxZIk7lAoBg22zgmZRQssDPaAyL90EObLBA6eghCMQhdt" + + "CL5/ses39Q/Kjqia4HvV7wOFvEaShymnHiMeJQ0SYBGE8aFnxalICkMPOw0qOUl3Nwgckkj8w0L4" + + "9fVrVNZNOPnwdJycD9FNJ9886azUp5tqGY+EAYeKTfvgnWyMDoYgZGLDNSmJnCqaAMIBkGdDc8rR" + + "RIpCpUktoRdFzBodMKjG1K865pNFr0q+DTbT9cKuI6noLmhbcIUQFHS5v377BVJTsRM38/k7bjVQ" + + "/QsGFAWOwy4omnhwaQ4dir9UBWLBQtxIJqOc0kd+1gLNFJRamnepDQhCb0D22mGERkybwyhxbkvG" + + "DfXrYw0hu4GOIYTDa3IR130b1DVq4FlBjTdyZZILa5cMBJorNMsfJKzYbIZibbkDp9eD+qcSCJ+Z" + + "Aw6J6JiTwaKiMsCRrPJo/VKomqUUaNX77+KQwCQBk8d+WuyGzDeB+XezzxcuJGLIhkMpMD6P173X" + + "LtobHIhvI8zl/jzAYzfP15Vtfno0bRSr3OiMZIyCc76lEhkyY6kJdFFExO7MSLFNET9zDMoTSfEm" + + "FECcF1Y5N4ToR0aUA3GSzFkiICKKM2wagnNB58ypLSPqzEaq0TxVGQloCZoMHKnM4RsYCB3sjADF" + + "0ulOqQx3OhD3kXkllMGDo+iI0e2gNQihIWnefq7k8HyQBTwO6HqOTDBbhLDMeBmE3d2ry1uaxUlV" + + "9WZLWNc18Mua2SNpqTx2umteedVqW9zIWW4rAboajE0SBhAcQLS6xZdoLE5myiDDRCnAer5IeqVC" + + "p4fZ8tnsnIL0sMgb0WgFSV2D9yOEDOg9ScQ8SeBT9Fu13qH0Ia/TilDH0r7/kCRPayBFqjiF41Pn" + + "B+IRYJBzdlB68ANn839DLohhGQB64qMgHpYhQyLpQVEYEQUCwmtEiprwfikV8whevoRXFAgbsEuM" + + "IAGJosjS1IzJmtC2QVIJ85D3MhplhRsD2JLlKgZlCBGRTx7OIFoaJDWV1p6ZY2MA3mTkVuTCLvkY" + + "B9GQuA5JGEEkAIzNyD7XtQedjp3G16IAZoIFHukAm/wpuNsrbW9+RESIe+yorMlloVIl62QMxK0l" + + "JIsGBZaSASHuIqUkoOtNsqdiQ01oDA3qvbA9AFEWBFXviyRgWqSxkWs2irRtSWyo4XBSwbCYjsF0" + + "JyEDqA876sc4VAoO4NNd5wAlkHoPthseqcSMzdXvnnuMNy9LCQ76CTonH2SJtAO7mFUwWlkEafWW" + + "UJgaipGBIwwcBTZozNJTWvxlhY6P1jTHN1r7qs+a63NG80pJo1FGpCgpWmW9G07U7LmClLJRMtIH" + + "+XRZByw0WARSKtIlpEEa++lAsGIXNYJSOdY0GZbMFERKblrWECLFCWULJbSgFSpXyNoOytD3YL90" + + "xYSQhlD1QLJLQI0He9BzCEnVUSqicw+8My4R9hISYkJGYIxj8ruAhMajQwXdcJGBSBFRYiEzLDQs" + + "CajBMxmCr9tr+pNttLXxe3r5N7djRszWjJLEZs1mapMmmTJTQTNpSqUZsNU0JRlqNljWTbV+p7df" + + "Lo0rUkVjdV+CKMDKORHjOxLhIwk9G21jFEYFD4XjWjw8wvyPogFPIeTDwiBloHASYHMk8xALgXwl" + + "ATRqLTEQYWQsVkWQUKaMBwo7AQKQfAF3fSVyBBLobqUc9N30Yhd9lPGGxI9LQNomLwZp5ZZsMZkl" + + "oF2Byvel2w26lwkZCYQKHFs8KDgeFO2+29nFIKMOG7yWYijLbKDKNtLaksQtZVRtZBGNkVAxCiCA" + + "Y0LYLJWyyolpYoiIlGrAkS1LLY5k3YQxlKvO3TdNkNSU2Rdd21cyEIcUog9BsnPOQYJDHgyjFjMY" + + "rbgvBfJuwtEhGMMokttuSiYYRmQzSrobTNZGFRBRJ0D9I/mJERaCCLCgGiqRrIBlFPnSl5lPE51v" + + "mPyjjESFnwAxWlkO96k1MjkQjxldSypErtlBcLC2xJa5YIMOc9hTxTkPSHujC48AnAicrbndNoPO" + + "N74pxoN1p5k0VDQyShtPkmhEPSBIBwWmSBAhFI4ntAwUbinCB4hQIFQWEEWCWrvE3qfzQrTTT7si" + + "6zQ8MvTyensgBuMEix6adydCOBCBUjFYG+R5YCfYgcfe3KBA528A6ViECYJgPJNB3nSTyDyPKUoB" + + "/mQIKxFDYbNYIYrQNbnFO2rWmvkt5vFGebcxXGlIkCiBwVLS2QolREpXmBd2Q8XDpAVtaSkE0BTO" + + "nujaCkO9awitnCKKcMnFFHh6fqiPxztdZntuRCeDzyIgwh826nhMzIM2TOwEXW01STLWw5saZe6L" + + "ZJoHfoIya3HY79edGjjYfToLT9W+yIpw8X2hhlKhzNjppSbn3t5mBXnyGl+qT7uQbI5+TV6rtb5z" + + "y+41+l5LWFxPpRlQGUYQndmJEQkgvWI4R/1s40rG2dyJDQtbruUVR5sPluFVcb5o5DQrT35OfHg6" + + "nXsdDhJ4Nkg6D223DHsUoizm1yj4XOdaoIMlVhMBJZJmCIHqgC0gfgz7LGB9HflZG54HCcBh4375" + + "6X1dGN+X5axnNu8vqiV7DyNFDXakMyESZcSBwet+6o/TaDQ2yz52GvPcN8lqBxN23CHsR/XQBTJC" + + "lBxVhYJyjcQgQvEU1rk+6HSk9vKX+aSBPeAzRGEsBBisD2+XwrWjbRJaEliHqYvlo00yzvSnv9dM" + + "IE4khSVKE0W3I2lkgwSAHIhNIEKQQELu+sjBqOm7Ur2wecZHEVHbQYRG+frxWHNZz8VZk4Em5sHZ" + + "45CsKUcCifEbXdlIxssZqYYyRUVA+UgcJuAeJwptCkVnJypDkksFFCXJaUuMU2A9AwjZg0nU3GQF" + + "qrx3zaKJS3bl733s0xg0apuNuDStMwxlcQVMQQKVQSCZvRLTcU76R4xLMmc45p69aBkD9poNHIAd" + + "IFnQkWRDo32AsplDEwLMsMJsGweqY8JPrmunefNpeK8/dLFIqiYhNYz0QzOmhJGEB4LqASPQy9S8" + + "obyytQSt66RgQTZZrWZKxiBqQEicBaQPIO6uPfxPFVgzwxzWUbAkltjaNVbTLUj8W+oEtzaWw8tn" + + "JhMw+KeonmDEPs9ppd82wYnDsFIVXJTYejCLMRdxe17QzSmWWQ5F4rbErEQhMxuQb6n4lrW+BF4V" + + "MbVfZ4moMOjGHVTmNx+DkrbHWs9JZwe2dbvDNDJnT1xJDMtVDIDNVn28eMDhnCKVCs4SsDGI3JRC" + + "4FRQycOmGmzVtDCswMNYHQutmo1uWyqAiLp4YmEIKcdLMpQRYzDRcy/Gryi4zHhmO2DrMlwtiFxs" + + "y2URYJEW2gl9WQpkJcLLPWevecJ17XXby7blWRRB4c6cgYhEYsM8wsNyABYwJtUgZTpNybGcdonJ" + + "jJYb3nicBcbBxDZzEMgiSIY4IkvGEhqJZLjBsFwzJlyJGR+DaLlt2SkuN17TCLhcW8YTBMwUziQJ" + + "n52sYOp21W0RM8UC+fKzk0bnoqBHWMxnAW7wCKc/x7rcjpmWhpRANpXlDKoBjEXS35bNSwzddkdA" + + "OajcSPD5WSQxnM63z99hzqciJVGxghWs2lipUVyOSjj0zMZ8aVDnmx9pb2tWoKtfFa3u2xrTKS1N" + + "7OFeumgtBKKaR+2UJzieUMYBjAIR0WTWmbctjckr7N3VPOru7XMVNk3dt2WIqK02ZudmLFCQkCqp" + + "qCyBjGVEdTfF1r7+h+B4O7cou29BYbMh0BFODClliYY5AfJs4+D71Yp7UjPhZjgi333MsPyptUte" + + "pFqLJSVa3K525vVziUCCba1HiWF6EI0alvjIt9W7XktfUWvmlum4Kk1aPtoT6dBkB9UaFZ5QZbHG" + + "W9Hx/keXtc/nnahU1Y7RoJIXYWFhEDWKe07iby+65oodgnCkf5NWkMTu19eoiz4tB2FkEbAkZFkC" + + "QJE2Av9uxj+i4HbYr0Tvi1I5100j8WCciL7h7fGgQTpfTgkJBFPsDsIMZBj5Wy+oD9j+QeOzkqpU" + + "q/oD+P02H4E8UHwsrFH7aSsGVsBMw62mEXoSkQ84lgDk6QPTQSKJ6IDuMet75Q5MuoXGTnYascmB" + + "kZYOrLA4yQwFTEheZ+Y+BIKiIshoD3MOAx7LfBLUJvRj7KCQhCEoyU2M7LULDIge6lGgjgY1GgVP" + + "1KiERIjIAqighIyEC+Xs59Werg1dzsxTVbdmPUHCsMCzELDJzLSojrMVCiDFw8Wmp7p8Vfz5LJrI" + + "SQcTIJk0em8ShhFjDJtzeGIl0lZ35N7yVChV+qBCJAjIDCMsy22FjGaitTTZRNUXvy4bk3m7YZ2P" + + "WRoBNMYUgOEQMeLhWFF1FeiKoHKwXDHI4GF4EzoogSYlFYVPFwyzgyUiM/HtTQzSwY3/935P/pVS" + + "I5ztPxjuSv4UbQOH7cbKdMD1cq9uVWjVUZovZM7cZLxSrw2eWrDGsDgVWAPhYSdXl3xfH0oaTwfb" + + "21zqsFhC8NIHdIQSGZveMwM7oSy4ZzP7nD3WnjXGmq73mP93ldP8PvgOpMwbfV1RvR+V/DOnF9rK" + + "v9hdyRThQkN3QmOE" diff --git a/gcc/testsuite/go.test/test/bench/go1/revcomp_test.go b/gcc/testsuite/go.test/test/bench/go1/revcomp_test.go index 9256164d76f..6b6c1e5772b 100644 --- a/gcc/testsuite/go.test/test/bench/go1/revcomp_test.go +++ b/gcc/testsuite/go.test/test/bench/go1/revcomp_test.go @@ -77,9 +77,9 @@ func revcomp(data []byte) { } } -func BenchmarkRevcomp25M(b *testing.B) { - b.SetBytes(int64(len(fasta25m))) +func BenchmarkRevcomp(b *testing.B) { + b.SetBytes(int64(len(fastabytes))) for i := 0; i < b.N; i++ { - revcomp(fasta25m) + revcomp(fastabytes) } } diff --git a/gcc/testsuite/go.test/test/bench/shootout/Makefile b/gcc/testsuite/go.test/test/bench/shootout/Makefile deleted file mode 100644 index e1c9b7b80ec..00000000000 --- a/gcc/testsuite/go.test/test/bench/shootout/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2011 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -include ../../../src/Make.inc - -all: - @echo "make clean or timing" - -timing: - ./timing.sh - -clean: - rm -f [568].out *.[568] diff --git a/gcc/testsuite/go.test/test/bench/shootout/binary-tree.c b/gcc/testsuite/go.test/test/bench/shootout/binary-tree.c index 1b4070406f3..9c35ac52a96 100644 --- a/gcc/testsuite/go.test/test/bench/shootout/binary-tree.c +++ b/gcc/testsuite/go.test/test/bench/shootout/binary-tree.c @@ -36,7 +36,6 @@ POSSIBILITY OF SUCH DAMAGE. icc -O3 -ip -unroll -static binary-trees.c -lm */ -#include #include #include #include diff --git a/gcc/testsuite/go.test/test/bench/shootout/k-nucleotide.c b/gcc/testsuite/go.test/test/bench/shootout/k-nucleotide.c index 3bace391c4d..9c30620209e 100644 --- a/gcc/testsuite/go.test/test/bench/shootout/k-nucleotide.c +++ b/gcc/testsuite/go.test/test/bench/shootout/k-nucleotide.c @@ -221,7 +221,7 @@ main () free(s); - g_ptr_array_foreach(roots, free, NULL); + g_ptr_array_foreach(roots, (GFunc)free, NULL); g_ptr_array_free(roots, TRUE); return 0; diff --git a/gcc/testsuite/go.test/test/bench/shootout/mandelbrot.go b/gcc/testsuite/go.test/test/bench/shootout/mandelbrot.go index 1f9fbfd3d44..df60343c240 100644 --- a/gcc/testsuite/go.test/test/bench/shootout/mandelbrot.go +++ b/gcc/testsuite/go.test/test/bench/shootout/mandelbrot.go @@ -50,21 +50,21 @@ func main() { out := bufio.NewWriter(os.Stdout) defer out.Flush() - w := *n - h := *n + w := float64(*n) + h := float64(*n) bit_num := 0 byte_acc := byte(0) const Iter = 50 const Zero float64 = 0 const Limit = 2.0 - fmt.Fprintf(out, "P4\n%d %d\n", w, h) + fmt.Fprintf(out, "P4\n%d %d\n", *n, *n) - for y := 0; y < h; y++ { - for x := 0; x < w; x++ { + for y := 0.0; y < h; y++ { + for x := 0.0; x < w; x++ { Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero - Cr := (2*float64(x)/float64(w) - 1.5) - Ci := (2*float64(y)/float64(h) - 1.0) + Cr := (2*x/w - 1.5) + Ci := (2*y/h - 1.0) for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ { Zi = 2*Zr*Zi + Ci @@ -85,7 +85,7 @@ func main() { byte_acc = 0 bit_num = 0 } else if x == w-1 { - byte_acc <<= uint(8 - w%8) + byte_acc <<= uint(8 - uint(*n)%8) out.WriteByte(byte_acc) byte_acc = 0 bit_num = 0 diff --git a/gcc/testsuite/go.test/test/bench/shootout/threadring.c b/gcc/testsuite/go.test/test/bench/shootout/threadring.c index 2c4fb77515a..a518134ba65 100644 --- a/gcc/testsuite/go.test/test/bench/shootout/threadring.c +++ b/gcc/testsuite/go.test/test/bench/shootout/threadring.c @@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. * contributed by Premysl Hruby */ +#include #include #include #include @@ -57,7 +58,7 @@ static struct stack stacks[THREADS]; static void* thread(void *num) { - int l = (int)num; + int l = (int)(uintptr_t)num; int r = (l+1) % THREADS; int token; @@ -94,7 +95,7 @@ int main(int argc, char **argv) pthread_mutex_lock(mutex + i); pthread_attr_setstack(&stack_attr, &stacks[i], sizeof(struct stack)); - pthread_create(&cthread, &stack_attr, thread, (void*)i); + pthread_create(&cthread, &stack_attr, thread, (void*)(uintptr_t)i); } pthread_mutex_unlock(mutex + 0); diff --git a/gcc/testsuite/go.test/test/bench/shootout/timing.log b/gcc/testsuite/go.test/test/bench/shootout/timing.log index 2541a766b7f..ee1f889b4a5 100644 --- a/gcc/testsuite/go.test/test/bench/shootout/timing.log +++ b/gcc/testsuite/go.test/test/bench/shootout/timing.log @@ -900,3 +900,264 @@ threadring 50000000 chameneos 6000000 gc chameneosredux 7.41u 0.00s 7.42r # -3% + +# A complete run at the Go 1 release. +# Significant changes: +# - gccgo is now enabled for all tests (goroutines are cheap enough) +# - threadring and chameneos are 14% faster, probably due to runtime changes +# - regex-dna 36% faster +# - fannkuch-parallel (only) slowed down 40% +# - gccgo on binary-tree-freelist is still optimized to nothing +# Other changes are modest. + +fasta -n 25000000 + gcc -O2 fasta.c 1.45u 0.02s 1.48r + gccgo -O2 fasta.go 1.46u 0.00s 1.47r + gc fasta 1.99u 0.01s 2.00r + gc_B fasta 1.99u 0.01s 2.01r + +reverse-complement < output-of-fasta-25000000 + gcc -O2 reverse-complement.c 0.95u 0.48s 4.99r + gccgo -O2 reverse-complement.go 0.93u 0.16s 1.09r + gc reverse-complement 1.20u 0.19s 1.39r + gc_B reverse-complement 1.04u 0.16s 1.20r + +nbody -n 50000000 + gcc -O2 -lm nbody.c 13.02u 0.00s 13.05r + gccgo -O2 nbody.go 14.46u 0.00s 14.49r + gc nbody 21.79u 0.00s 21.84r + gc_B nbody 21.74u 0.00s 21.79r + +binary-tree 15 # too slow to use 20 + gcc -O2 binary-tree.c -lm 0.60u 0.01s 0.61r + gccgo -O2 binary-tree.go 1.30u 0.01s 1.32r + gccgo -O2 binary-tree-freelist.go 0.00u 0.00s 0.00r + gc binary-tree 1.84u 0.01s 1.86r + gc binary-tree-freelist 0.33u 0.00s 0.33r + +fannkuch 12 + gcc -O2 fannkuch.c 45.24u 0.00s 45.34r + gccgo -O2 fannkuch.go 59.76u 0.01s 59.90r + gccgo -O2 fannkuch-parallel.go 218.20u 0.01s 61.60r + gc fannkuch 103.92u 0.00s 104.16r + gc fannkuch-parallel 221.61u 0.00s 60.49r + gc_B fannkuch 53.17u 0.00s 53.30r + +regex-dna 100000 + gcc -O2 regex-dna.c -lpcre 0.47u 0.00s 0.48r + gccgo -O2 regex-dna.go 6.52u 0.00s 6.54r + gccgo -O2 regex-dna-parallel.go 14.40u 0.73s 4.35r + gc regex-dna 2.63u 0.02s 2.66r # -36% + gc regex-dna-parallel 2.87u 0.01s 1.11r + gc_B regex-dna 2.65u 0.00s 2.66r + +spectral-norm 5500 + gcc -O2 spectral-norm.c -lm 15.78u 0.00s 15.82r + gccgo -O2 spectral-norm.go 15.79u 0.00s 15.83r + gc spectral-norm 19.76u 0.00s 19.80r + gc_B spectral-norm 19.73u 0.01s 19.78r + +k-nucleotide 1000000 + gcc -O2 k-nucleotide.c 5.59u 0.03s 5.63r + gccgo -O2 k-nucleotide.go 4.09u 0.03s 4.13r + gccgo -O2 k-nucleotide-parallel.go 4.50u 0.06s 1.63r + gc k-nucleotide 9.23u 0.02s 9.27r + gc k-nucleotide-parallel 9.87u 0.03s 3.55r + gc_B k-nucleotide 9.20u 0.00s 9.22r + +mandelbrot 16000 + gcc -O2 mandelbrot.c 36.09u 0.00s 36.18r + gccgo -O2 mandelbrot.go 41.69u 0.01s 41.80r + gc mandelbrot 60.91u 0.02s 61.07r + gc_B mandelbrot 60.90u 0.00s 61.04r + +meteor 2098 + gcc -O2 meteor-contest.c 0.09u 0.00s 0.09r + gccgo -O2 meteor-contest.go 0.09u 0.00s 0.09r + gc meteor-contest 0.14u 0.00s 0.15r + gc_B meteor-contest 0.14u 0.00s 0.14r + +pidigits 10000 + gcc -O2 pidigits.c -lgmp 2.27u 0.00s 2.27r + gccgo -O2 pidigits.go 8.65u 0.00s 8.67r + gc pidigits 3.70u 0.04s 3.75r + gc_B pidigits 3.72u 0.02s 3.75r + +threadring 50000000 + gcc -O2 threadring.c 40.91u 369.85s 323.31r + gccgo -O2 threadring.go 26.97u 30.82s 57.93r + gc threadring 12.81u 0.01s 12.85r # -13% + +chameneos 6000000 + gcc -O2 chameneosredux.c -lpthread 9.44u 72.90s 12.65r + gccgo -O2 chameneosredux.go 7.73u 7.53s 15.30r + gc chameneosredux 6.51u 0.00s 6.53r # - 14% + +# After http://codereview.appspot.com/6248049, moving panicindex +# calls out of line (putting the likely code into a single path and shortening +# loops). Significant changes since the last run (note: some are slower for +# unrelated and as yet undiagnosed reasons): + +nbody -n 50000000 + gc nbody 19.10u 0.01s 19.19r # -12% + gc_B nbody 19.19u 0.00s 19.23r # -12% + +binary-tree 15 # too slow to use 20 + gc binary-tree 1.49u 0.01s 1.51r # -19% + +fannkuch 12 + gc fannkuch 60.79u 0.00s 60.92r # -41% + gc fannkuch-parallel 183.51u 0.01s 51.75r # -14% + gc_B fannkuch 51.68u 0.00s 51.79r # -3% + +k-nucleotide 1000000 + gc k-nucleotide 9.74u 0.04s 9.80r # +6% + gc k-nucleotide-parallel 9.89u 0.05s 3.59r # +1% + gc_B k-nucleotide 9.39u 0.02s 9.43r # +2% + +mandelbrot (much slower, due to unrelated http://codereview.appspot.com/6209077) + gc mandelbrot 100.98u 0.00s 101.20r # +65% + gc_B mandelbrot 100.90u 0.01s 101.17r # +65% + +meteor 2098 + gc meteor-contest 0.13u 0.00s 0.13r # -13% + gc_B meteor-contest 0.13u 0.00s 0.13r # -7% + +# May 30, 2012. +# After http://codereview.appspot.com/6261051, restoring old code generated +# for floating-point constants. Mandelbrot is back to its previous numbers. + +mandelbrot 16000 + gcc -O2 mandelbrot.c 36.07u 0.00s 36.16r + gccgo -O2 mandelbrot.go 41.72u 0.01s 41.90r + gc mandelbrot 60.62u 0.00s 60.76r + gc_B mandelbrot 60.68u 0.00s 60.82r + +# May 30, 2012. +# After http://codereview.appspot.com/6248068, better FP code +# by avoiding MOVSD between registers. +# Plus some other timing changes that have crept in from other speedups, +# from garbage collection to Printf. + +fasta -n 25000000 + gc fasta 1.76u 0.00s 1.76r # -12% + gc_B fasta 1.71u 0.00s 1.72r # -12% + +nbody -n 50000000 + gc nbody 17.56u 0.00s 17.60r # -8% + gc_B nbody 17.30u 0.00s 17.34r # -10% + +fannkuch 12 + gc fannkuch-parallel 155.92u 0.01s 44.05r # -15% + +k-nucleotide 1000000 + gc k-nucleotide 9.22u 0.01s 9.26r # -5% + gc k-nucleotide-parallel 9.23u 0.03s 3.26r # -9% + gc_B k-nucleotide 9.22u 0.03s 9.28r # -2% + +mandelbrot 16000 + gc mandelbrot 44.80u 0.00s 44.90r # -27% + gc_B mandelbrot 44.81u 0.00s 44.92r # -26% + +pidigits 10000 + gc pidigits 3.51u 0.00s 3.52r # -6% + gc_B pidigits 3.51u 0.00s 3.52r # -6% + +# Aug 28, 2012 +# After some assembler work in package big. +pidigits 10000 + gc pidigits 2.85u 0.02s 2.88r # -22% + gc_B pidigits 2.88u 0.01s 2.90r # -21% + +# Sep 26, 2012 +# 64-bit ints, plus significantly better floating-point code. +# Interesting details: +# Generally something in the 0-10% slower range, some (binary tree) more +# Floating-point noticeably faster: +# nbody -25% +# mandelbrot -37% relative to Go 1. +# Other: +# regex-dna +47% +fasta -n 25000000 + gcc -O2 fasta.c 1.43u 0.03s 1.46r + gccgo -O2 fasta.go 1.47u 0.00s 1.47r + gc fasta 1.78u 0.01s 1.80r + gc_B fasta 1.76u 0.00s 1.76r + +reverse-complement < output-of-fasta-25000000 + gcc -O2 reverse-complement.c 1.14u 0.39s 11.19r + gccgo -O2 reverse-complement.go 0.91u 0.17s 1.09r + gc reverse-complement 1.12u 0.18s 1.31r + gc_B reverse-complement 1.12u 0.15s 1.28r + +nbody -n 50000000 + gcc -O2 nbody.c -lm 13.02u 0.00s 13.05r + gccgo -O2 nbody.go 13.90u 0.00s 13.93r + gc nbody 17.05u 0.00s 17.09r + gc_B nbody 16.30u 0.00s 16.34r + +binary-tree 15 # too slow to use 20 + gcc -O2 binary-tree.c -lm 0.61u 0.00s 0.61r + gccgo -O2 binary-tree.go 1.24u 0.04s 1.29r + gccgo -O2 binary-tree-freelist.go 0.21u 0.01s 0.22r + gc binary-tree 1.93u 0.02s 1.96r + gc binary-tree-freelist 0.32u 0.00s 0.33r + +fannkuch 12 + gcc -O2 fannkuch.c 45.19u 0.00s 45.29r + gccgo -O2 fannkuch.go 60.32u 0.00s 60.45r + gccgo -O2 fannkuch-parallel.go 185.59u 0.00s 59.49r + gc fannkuch 72.14u 0.00s 72.30r + gc fannkuch-parallel 172.54u 0.00s 43.59r + gc_B fannkuch 53.55u 0.00s 53.67r + +regex-dna 100000 + gcc -O2 regex-dna.c -lpcre 0.47u 0.00s 0.47r + gccgo -O2 regex-dna.go 6.49u 0.05s 6.56r + gccgo -O2 regex-dna-parallel.go 14.60u 0.67s 4.42r + gc regex-dna 3.91u 0.00s 3.92r + gc regex-dna-parallel 4.01u 0.03s 1.56r + gc_B regex-dna 3.91u 0.00s 3.92r + +spectral-norm 5500 + gcc -O2 spectral-norm.c -lm 15.85u 0.00s 15.89r + gccgo -O2 spectral-norm.go 15.86u 0.00s 15.89r + gc spectral-norm 19.72u 0.00s 19.76r + gc_B spectral-norm 19.68u 0.01s 19.74r + +k-nucleotide 1000000 + gcc -O2 k-nucleotide.c -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0 4.90u 0.01s 4.93r + gccgo -O2 k-nucleotide.go 4.78u 0.01s 4.80r + gccgo -O2 k-nucleotide-parallel.go 6.49u 0.02s 2.18r + gc k-nucleotide 9.05u 0.02s 9.09r + gc k-nucleotide-parallel 9.27u 0.01s 3.29r + gc_B k-nucleotide 8.95u 0.03s 9.00r + +mandelbrot 16000 + gcc -O2 mandelbrot.c 36.11u 0.00s 36.19r + gccgo -O2 mandelbrot.go 43.67u 0.00s 43.77r + gc mandelbrot 38.57u 0.00s 38.66r + gc_B mandelbrot 38.59u 0.00s 38.68r + +meteor 2098 + gcc -O2 meteor-contest.c 0.09u 0.00s 0.09r + gccgo -O2 meteor-contest.go 0.09u 0.00s 0.09r + gc meteor-contest 0.13u 0.00s 0.14r + gc_B meteor-contest 0.12u 0.00s 0.13r + +pidigits 10000 + gcc -O2 pidigits.c -lgmp 2.26u 0.00s 2.27r + gccgo -O2 pidigits.go 9.05u 0.00s 9.07r + gc pidigits 2.88u 0.02s 2.90r + gc_B pidigits 2.89u 0.00s 2.90r + +threadring 50000000 + gcc -O2 threadring.c -lpthread 37.30u 327.81s 289.28r + gccgo -O2 threadring.go 42.83u 26.15s 69.14r + gc threadring 13.00u 0.00s 13.03r + +chameneos 6000000 + gcc -O2 chameneosredux.c -lpthread 8.80u 71.67s 12.19r + gccgo -O2 chameneosredux.go 11.28u 6.68s 18.00r + gc chameneosredux 6.94u 0.00s 6.96r + diff --git a/gcc/testsuite/go.test/test/bench/shootout/timing.sh b/gcc/testsuite/go.test/test/bench/shootout/timing.sh index 3e190e15c83..d269b875680 100755 --- a/gcc/testsuite/go.test/test/bench/shootout/timing.sh +++ b/gcc/testsuite/go.test/test/bench/shootout/timing.sh @@ -5,7 +5,11 @@ set -e -eval $(gomake --no-print-directory -f ../../../src/Make.inc go-env) +eval $(go tool dist env) +O=$GOCHAR +GC="go tool ${O}g" +LD="go tool ${O}l" + PATH=.:$PATH havegccgo=false @@ -93,7 +97,7 @@ revcomp() { nbody() { runonly echo 'nbody -n 50000000' - run 'gcc -O2 -lm nbody.c' a.out 50000000 + run 'gcc -O2 nbody.c -lm' a.out 50000000 run 'gccgo -O2 nbody.go' a.out -n 50000000 run 'gc nbody' $O.out -n 50000000 run 'gc_B nbody' $O.out -n 50000000 @@ -103,7 +107,7 @@ binarytree() { runonly echo 'binary-tree 15 # too slow to use 20' run 'gcc -O2 binary-tree.c -lm' a.out 15 run 'gccgo -O2 binary-tree.go' a.out -n 15 - run 'gccgo -O2 binary-tree-freelist.go' $O.out -n 15 + run 'gccgo -O2 binary-tree-freelist.go' a.out -n 15 run 'gc binary-tree' $O.out -n 15 run 'gc binary-tree-freelist' $O.out -n 15 } @@ -143,7 +147,9 @@ knucleotide() { runonly gcc -O2 fasta.c runonly a.out 1000000 > x # should be using 25000000 runonly echo 'k-nucleotide 1000000' - run 'gcc -O2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include k-nucleotide.c -lglib-2.0' a.out = 2⁸. + use(s[ui8]) + use(a1[ui8]) + use(a1k[ui8]) // ERROR "index bounds check elided" + use(a100k[ui8]) // ERROR "index bounds check elided" + use(p1[ui8]) + use(p1k[ui8]) // ERROR "index bounds check elided" + use(p100k[ui8]) // ERROR "index bounds check elided" + + use(s[i16]) + use(a1[i16]) + use(a1k[i16]) + use(a100k[i16]) + use(p1[i16]) + use(p1k[i16]) + use(p100k[i16]) + + // Unsigned 16-bit numbers don't need checks for len >= 2¹⁶. + use(s[ui16]) + use(a1[ui16]) + use(a1k[ui16]) + use(a100k[ui16]) // ERROR "index bounds check elided" + use(p1[ui16]) + use(p1k[ui16]) + use(p100k[ui16]) // ERROR "index bounds check elided" + + use(s[i32]) + use(a1[i32]) + use(a1k[i32]) + use(a100k[i32]) + use(p1[i32]) + use(p1k[i32]) + use(p100k[i32]) + + use(s[ui32]) + use(a1[ui32]) + use(a1k[ui32]) + use(a100k[ui32]) + use(p1[ui32]) + use(p1k[ui32]) + use(p100k[ui32]) + + use(s[i64]) + use(a1[i64]) + use(a1k[i64]) + use(a100k[i64]) + use(p1[i64]) + use(p1k[i64]) + use(p100k[i64]) + + use(s[ui64]) + use(a1[ui64]) + use(a1k[ui64]) + use(a100k[ui64]) + use(p1[ui64]) + use(p1k[ui64]) + use(p100k[ui64]) + + // Mod truncates the maximum value to one less than the argument, + // but signed mod can be negative, so only unsigned mod counts. + use(s[i%999]) + use(a1[i%999]) + use(a1k[i%999]) + use(a100k[i%999]) + use(p1[i%999]) + use(p1k[i%999]) + use(p100k[i%999]) + + use(s[ui%999]) + use(a1[ui%999]) + use(a1k[ui%999]) // ERROR "index bounds check elided" + use(a100k[ui%999]) // ERROR "index bounds check elided" + use(p1[ui%999]) + use(p1k[ui%999]) // ERROR "index bounds check elided" + use(p100k[ui%999]) // ERROR "index bounds check elided" + + use(s[i%1000]) + use(a1[i%1000]) + use(a1k[i%1000]) + use(a100k[i%1000]) + use(p1[i%1000]) + use(p1k[i%1000]) + use(p100k[i%1000]) + + use(s[ui%1000]) + use(a1[ui%1000]) + use(a1k[ui%1000]) // ERROR "index bounds check elided" + use(a100k[ui%1000]) // ERROR "index bounds check elided" + use(p1[ui%1000]) + use(p1k[ui%1000]) // ERROR "index bounds check elided" + use(p100k[ui%1000]) // ERROR "index bounds check elided" + + use(s[i%1001]) + use(a1[i%1001]) + use(a1k[i%1001]) + use(a100k[i%1001]) + use(p1[i%1001]) + use(p1k[i%1001]) + use(p100k[i%1001]) + + use(s[ui%1001]) + use(a1[ui%1001]) + use(a1k[ui%1001]) + use(a100k[ui%1001]) // ERROR "index bounds check elided" + use(p1[ui%1001]) + use(p1k[ui%1001]) + use(p100k[ui%1001]) // ERROR "index bounds check elided" + + // Bitwise and truncates the maximum value to the mask value. + // The result (for a positive mask) cannot be negative, so elision + // applies to both signed and unsigned indexes. + use(s[i&999]) + use(a1[i&999]) + use(a1k[i&999]) // ERROR "index bounds check elided" + use(a100k[i&999]) // ERROR "index bounds check elided" + use(p1[i&999]) + use(p1k[i&999]) // ERROR "index bounds check elided" + use(p100k[i&999]) // ERROR "index bounds check elided" + + use(s[ui&999]) + use(a1[ui&999]) + use(a1k[ui&999]) // ERROR "index bounds check elided" + use(a100k[ui&999]) // ERROR "index bounds check elided" + use(p1[ui&999]) + use(p1k[ui&999]) // ERROR "index bounds check elided" + use(p100k[ui&999]) // ERROR "index bounds check elided" + + use(s[i&1000]) + use(a1[i&1000]) + use(a1k[i&1000]) + use(a100k[i&1000]) // ERROR "index bounds check elided" + use(p1[i&1000]) + use(p1k[i&1000]) + use(p100k[i&1000]) // ERROR "index bounds check elided" + + use(s[ui&1000]) + use(a1[ui&1000]) + use(a1k[ui&1000]) + use(a100k[ui&1000]) // ERROR "index bounds check elided" + use(p1[ui&1000]) + use(p1k[ui&1000]) + use(p100k[ui&1000]) // ERROR "index bounds check elided" + + // Right shift cuts the effective number of bits in the index, + // but only for unsigned (signed stays negative). + use(s[i32>>22]) + use(a1[i32>>22]) + use(a1k[i32>>22]) + use(a100k[i32>>22]) + use(p1[i32>>22]) + use(p1k[i32>>22]) + use(p100k[i32>>22]) + + use(s[ui32>>22]) + use(a1[ui32>>22]) + use(a1k[ui32>>22]) + use(a100k[ui32>>22]) // ERROR "index bounds check elided" + use(p1[ui32>>22]) + use(p1k[ui32>>22]) + use(p100k[ui32>>22]) // ERROR "index bounds check elided" + + use(s[i32>>23]) + use(a1[i32>>23]) + use(a1k[i32>>23]) + use(a100k[i32>>23]) + use(p1[i32>>23]) + use(p1k[i32>>23]) + use(p100k[i32>>23]) + + use(s[ui32>>23]) + use(a1[ui32>>23]) + use(a1k[ui32>>23]) // ERROR "index bounds check elided" + use(a100k[ui32>>23]) // ERROR "index bounds check elided" + use(p1[ui32>>23]) + use(p1k[ui32>>23]) // ERROR "index bounds check elided" + use(p100k[ui32>>23]) // ERROR "index bounds check elided" + + // Division cuts the range like right shift does. + use(s[i/1e6]) + use(a1[i/1e6]) + use(a1k[i/1e6]) + use(a100k[i/1e6]) + use(p1[i/1e6]) + use(p1k[i/1e6]) + use(p100k[i/1e6]) + + use(s[ui/1e6]) + use(a1[ui/1e6]) + use(a1k[ui/1e6]) + use(p1[ui/1e6]) + use(p1k[ui/1e6]) + + use(s[i/1e7]) + use(a1[i/1e7]) + use(a1k[i/1e7]) + use(a100k[i/1e7]) + use(p1[i/1e7]) + use(p1k[i/1e7]) + use(p100k[i/1e7]) + + use(s[ui/1e7]) + use(a1[ui/1e7]) + use(p1[ui/1e7]) +} + +var sum int + +func use(x int) { + sum += x +} diff --git a/gcc/testsuite/go.test/test/bugs/bug395.go b/gcc/testsuite/go.test/test/bugs/bug395.go index adf74497cde..4632dcd0f79 100644 --- a/gcc/testsuite/go.test/test/bugs/bug395.go +++ b/gcc/testsuite/go.test/test/bugs/bug395.go @@ -1,6 +1,9 @@ // echo bug395 is broken # takes 90+ seconds to break // # $G $D/$F.go || echo bug395 +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/bugs/bug434.dir/one.go b/gcc/testsuite/go.test/test/bugs/bug434.dir/one.go new file mode 100644 index 00000000000..491ada1d9c4 --- /dev/null +++ b/gcc/testsuite/go.test/test/bugs/bug434.dir/one.go @@ -0,0 +1,28 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package one + +// Issue 3552 + +type T struct { int } + +func (t T) F() int { return t.int } + +type U struct { int int } + +func (u U) F() int { return u.int } + +type lint int + +type V struct { lint } + +func (v V) F() int { return int(v.lint) } + +type W struct { lint lint } + +func (w W) F() int { return int(w.lint) } + + + diff --git a/gcc/testsuite/go.test/test/bugs/bug434.dir/two.go b/gcc/testsuite/go.test/test/bugs/bug434.dir/two.go new file mode 100644 index 00000000000..1366d244d3e --- /dev/null +++ b/gcc/testsuite/go.test/test/bugs/bug434.dir/two.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Use the functions in one.go so that the inlined +// forms get type-checked. + +package two + +import "./one" + +func use() { + var t one.T + var u one.U + var v one.V + var w one.W + + _ = t.F() + _ = u.F() + _ = v.F() + _ = w.F() +} diff --git a/gcc/testsuite/go.test/test/bugs/bug434.go b/gcc/testsuite/go.test/test/bugs/bug434.go new file mode 100644 index 00000000000..5eec7a577e7 --- /dev/null +++ b/gcc/testsuite/go.test/test/bugs/bug434.go @@ -0,0 +1,10 @@ +// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go || echo BUG:bug434 + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/chan/doubleselect.go b/gcc/testsuite/go.test/test/chan/doubleselect.go index f8d50c90c0f..ac559302d9b 100644 --- a/gcc/testsuite/go.test/test/chan/doubleselect.go +++ b/gcc/testsuite/go.test/test/chan/doubleselect.go @@ -1,11 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This test is designed to flush out the case where two cases of a select can +// Test the situation in which two cases of a select can // both end up running. See http://codereview.appspot.com/180068. + package main import ( diff --git a/gcc/testsuite/go.test/test/chan/fifo.go b/gcc/testsuite/go.test/test/chan/fifo.go index 0dddfcaa0bd..70d20b31f09 100644 --- a/gcc/testsuite/go.test/test/chan/fifo.go +++ b/gcc/testsuite/go.test/test/chan/fifo.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Verify that unbuffered channels act as pure fifos. +// Test that unbuffered channels act as pure fifos. package main diff --git a/gcc/testsuite/go.test/test/chan/goroutines.go b/gcc/testsuite/go.test/test/chan/goroutines.go index 371a1738766..6ffae7df65f 100644 --- a/gcc/testsuite/go.test/test/chan/goroutines.go +++ b/gcc/testsuite/go.test/test/chan/goroutines.go @@ -1,11 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// make a lot of goroutines, threaded together. -// tear them down cleanly. +// Torture test for goroutines. +// Make a lot of goroutines, threaded together, and tear them down cleanly. package main diff --git a/gcc/testsuite/go.test/test/chan/nonblock.go b/gcc/testsuite/go.test/test/chan/nonblock.go index 9addf12e99a..7e3c0c74dae 100644 --- a/gcc/testsuite/go.test/test/chan/nonblock.go +++ b/gcc/testsuite/go.test/test/chan/nonblock.go @@ -1,11 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Verify channel operations that test for blocking -// Use several sizes and types of operands +// Test channel operations that test for blocking. +// Use several sizes and types of operands. package main diff --git a/gcc/testsuite/go.test/test/chan/perm.go b/gcc/testsuite/go.test/test/chan/perm.go index a43df198214..7e152c5eb5a 100644 --- a/gcc/testsuite/go.test/test/chan/perm.go +++ b/gcc/testsuite/go.test/test/chan/perm.go @@ -1,9 +1,13 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test various correct and incorrect permutations of send-only, +// receive-only, and bidirectional channels. +// Does not compile. + package main var ( diff --git a/gcc/testsuite/go.test/test/chan/powser1.go b/gcc/testsuite/go.test/test/chan/powser1.go index dc4ff53255d..6bf2a911157 100644 --- a/gcc/testsuite/go.test/test/chan/powser1.go +++ b/gcc/testsuite/go.test/test/chan/powser1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test concurrency primitives: power series. + // Power series package // A power series is a channel, along which flow rational // coefficients. A denominator of zero signifies the end. diff --git a/gcc/testsuite/go.test/test/chan/powser2.go b/gcc/testsuite/go.test/test/chan/powser2.go index bc329270dbc..33abd5c53fe 100644 --- a/gcc/testsuite/go.test/test/chan/powser2.go +++ b/gcc/testsuite/go.test/test/chan/powser2.go @@ -1,18 +1,21 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test concurrency primitives: power series. + +// Like powser1.go but uses channels of interfaces. +// Has not been cleaned up as much as powser1.go, to keep +// it distinct and therefore a different test. + // Power series package // A power series is a channel, along which flow rational // coefficients. A denominator of zero signifies the end. // Original code in Newsqueak by Doug McIlroy. // See Squinting at Power Series by Doug McIlroy, // http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf -// Like powser1.go but uses channels of interfaces. -// Has not been cleaned up as much as powser1.go, to keep -// it distinct and therefore a different test. package main diff --git a/gcc/testsuite/go.test/test/chan/select.go b/gcc/testsuite/go.test/test/chan/select.go index be4eb3f42d6..38fa7e1e3f8 100644 --- a/gcc/testsuite/go.test/test/chan/select.go +++ b/gcc/testsuite/go.test/test/chan/select.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple select. + package main var counter uint diff --git a/gcc/testsuite/go.test/test/chan/select2.go b/gcc/testsuite/go.test/test/chan/select2.go index 2cbb86ec626..40bc357b5d7 100644 --- a/gcc/testsuite/go.test/test/chan/select2.go +++ b/gcc/testsuite/go.test/test/chan/select2.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that selects do not consume undue memory. + package main import "runtime" diff --git a/gcc/testsuite/go.test/test/chan/select3.go b/gcc/testsuite/go.test/test/chan/select3.go index d919de3e0d9..847d8ed37ed 100644 --- a/gcc/testsuite/go.test/test/chan/select3.go +++ b/gcc/testsuite/go.test/test/chan/select3.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Tests verifying the semantics of the select statement +// Test the semantics of the select statement // for basic empty/non-empty cases. package main @@ -197,13 +197,13 @@ func main() { }) testBlock(never, func() { select { - case x := <-closedch: + case x := (<-closedch): _ = x } }) testBlock(never, func() { select { - case x, ok := <-closedch: + case x, ok := (<-closedch): _, _ = x, ok } }) diff --git a/gcc/testsuite/go.test/test/chan/select4.go b/gcc/testsuite/go.test/test/chan/select4.go index 46618ac8812..50036403856 100644 --- a/gcc/testsuite/go.test/test/chan/select4.go +++ b/gcc/testsuite/go.test/test/chan/select4.go @@ -1,4 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + +// Test that a select statement proceeds when a value is ready. package main diff --git a/gcc/testsuite/go.test/test/chan/select5.go b/gcc/testsuite/go.test/test/chan/select5.go index cc2cc71000e..f72cfe4b461 100644 --- a/gcc/testsuite/go.test/test/chan/select5.go +++ b/gcc/testsuite/go.test/test/chan/select5.go @@ -1,13 +1,14 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go && -// $G tmp.go && $L tmp.$A && ./$A.out || echo BUG: select5 -// rm -f tmp.go +// runoutput // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Generate test of channel operations and simple selects. -// Only doing one real send or receive at a time, but phrased +// The output of this program is compiled and run to do the +// actual test. + +// Each test does only one real send or receive at a time, but phrased // in various ways that the compiler may or may not rewrite // into simpler expressions. diff --git a/gcc/testsuite/go.test/test/chan/select6.go b/gcc/testsuite/go.test/test/chan/select6.go index 2ba6810ac34..af470a0d0d1 100644 --- a/gcc/testsuite/go.test/test/chan/select6.go +++ b/gcc/testsuite/go.test/test/chan/select6.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Issue 2075 +// Test for select: Issue 2075 // A bug in select corrupts channel queues of failed cases // if there are multiple waiters on those channels and the // select is the last in the queue. If further waits are made diff --git a/gcc/testsuite/go.test/test/chan/select7.go b/gcc/testsuite/go.test/test/chan/select7.go index 5fed6cbd426..20456a9d62e 100644 --- a/gcc/testsuite/go.test/test/chan/select7.go +++ b/gcc/testsuite/go.test/test/chan/select7.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/chan/sendstmt.go b/gcc/testsuite/go.test/test/chan/sendstmt.go index ee6f765cf88..a92c4f63a7a 100644 --- a/gcc/testsuite/go.test/test/chan/sendstmt.go +++ b/gcc/testsuite/go.test/test/chan/sendstmt.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/chan/sieve1.go b/gcc/testsuite/go.test/test/chan/sieve1.go index 55076c9253c..acc310f6c79 100644 --- a/gcc/testsuite/go.test/test/chan/sieve1.go +++ b/gcc/testsuite/go.test/test/chan/sieve1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test concurrency primitives: classical inefficient concurrent prime sieve. + // Generate primes up to 100 using channels, checking the results. // This sieve consists of a linear chain of divisibility filters, // equivalent to trial-dividing each n by all primes p ≤ n. diff --git a/gcc/testsuite/go.test/test/chan/sieve2.go b/gcc/testsuite/go.test/test/chan/sieve2.go index 9a7ab15406c..09e5c527b6c 100644 --- a/gcc/testsuite/go.test/test/chan/sieve2.go +++ b/gcc/testsuite/go.test/test/chan/sieve2.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test concurrency primitives: prime sieve of Eratosthenes. + // Generate primes up to 100 using channels, checking the results. // This sieve is Eratosthenesque and only considers odd candidates. // See discussion at . diff --git a/gcc/testsuite/go.test/test/chan/zerosize.go b/gcc/testsuite/go.test/test/chan/zerosize.go index 617c9dab341..50aca857cbe 100644 --- a/gcc/testsuite/go.test/test/chan/zerosize.go +++ b/gcc/testsuite/go.test/test/chan/zerosize.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Making channels of a zero-sized type should not panic. +// Test making channels of a zero-sized type. package main diff --git a/gcc/testsuite/go.test/test/chancap.go b/gcc/testsuite/go.test/test/chancap.go index 3f3789fbcc0..b3e40233f5b 100644 --- a/gcc/testsuite/go.test/test/chancap.go +++ b/gcc/testsuite/go.test/test/chancap.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test the cap predeclared function applied to channels. + package main func main() { diff --git a/gcc/testsuite/go.test/test/char_lit.go b/gcc/testsuite/go.test/test/char_lit.go index 99be77a570e..836c3c1a2d0 100644 --- a/gcc/testsuite/go.test/test/char_lit.go +++ b/gcc/testsuite/go.test/test/char_lit.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A &&./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test character literal syntax. + package main import "os" diff --git a/gcc/testsuite/go.test/test/char_lit1.go b/gcc/testsuite/go.test/test/char_lit1.go index dc5385291d0..489744b6e98 100644 --- a/gcc/testsuite/go.test/test/char_lit1.go +++ b/gcc/testsuite/go.test/test/char_lit1.go @@ -1,9 +1,12 @@ -// errchk $G -e $F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal character literals are detected. +// Does not compile. + package main const ( diff --git a/gcc/testsuite/go.test/test/closedchan.go b/gcc/testsuite/go.test/test/closedchan.go index c2bbec59d95..043a92d3880 100644 --- a/gcc/testsuite/go.test/test/closedchan.go +++ b/gcc/testsuite/go.test/test/closedchan.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/closure.go b/gcc/testsuite/go.test/test/closure.go index 97da1dd2304..c4a312464bc 100644 --- a/gcc/testsuite/go.test/test/closure.go +++ b/gcc/testsuite/go.test/test/closure.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test the behavior of closures. + package main import "runtime" @@ -79,6 +81,7 @@ func h() { func newfunc() func(int) int { return func(x int) int { return x } } func main() { + runtime.GOMAXPROCS(1) var fail bool go f() @@ -92,8 +95,9 @@ func main() { go h() check([]int{100, 200, 101, 201, 500, 101, 201, 500}) - runtime.UpdateMemStats() - n0 := runtime.MemStats.Mallocs + memstats := new(runtime.MemStats) + runtime.ReadMemStats(memstats) + n0 := memstats.Mallocs x, y := newfunc(), newfunc() if x(1) != 1 || y(2) != 2 { @@ -101,8 +105,8 @@ func main() { fail = true } - runtime.UpdateMemStats() - if n0 != runtime.MemStats.Mallocs { + runtime.ReadMemStats(memstats) + if n0 != memstats.Mallocs { println("newfunc allocated unexpectedly") fail = true } @@ -110,7 +114,7 @@ func main() { ff(1) if fail { - panic("fail") + panic("fail") } } diff --git a/gcc/testsuite/go.test/test/cmp.go b/gcc/testsuite/go.test/test/cmp.go index d51a11aa246..a56ca6eaddd 100644 --- a/gcc/testsuite/go.test/test/cmp.go +++ b/gcc/testsuite/go.test/test/cmp.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test equality and inequality operations. + package main import "unsafe" @@ -281,6 +283,25 @@ func main() { isfalse(ix != z) isfalse(iz != x) } + + // structs with _ fields + { + var x = struct { + x int + _ []int + y float64 + _ float64 + z int + }{ + x: 1, y: 2, z: 3, + } + var ix interface{} = x + + istrue(x == x) + istrue(x == ix) + istrue(ix == x) + istrue(ix == ix) + } // arrays { diff --git a/gcc/testsuite/go.test/test/cmp6.go b/gcc/testsuite/go.test/test/cmp6.go index 0113a69ddb8..7d99aae18b3 100644 --- a/gcc/testsuite/go.test/test/cmp6.go +++ b/gcc/testsuite/go.test/test/cmp6.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that incorrect comparisons are detected. +// Does not compile. + package main func use(bool) {} @@ -15,6 +18,10 @@ type T3 struct{ z []int } var t3 T3 +type T4 struct { _ []int; a float64 } + +var t4 T4 + func main() { // Arguments to comparison must be // assignable one to the other (or vice versa) @@ -46,6 +53,7 @@ func main() { // Comparison of structs should have a good message use(t3 == t3) // ERROR "struct|expected" + use(t4 == t4) // ok; the []int is a blank field // Slices, functions, and maps too. var x []int diff --git a/gcc/testsuite/go.test/test/cmplx.go b/gcc/testsuite/go.test/test/cmplx.go index d5a77d684a7..248672e7dd5 100644 --- a/gcc/testsuite/go.test/test/cmplx.go +++ b/gcc/testsuite/go.test/test/cmplx.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that incorrect invocations of the complex predeclared function are detected. +// Does not compile. + package main var ( diff --git a/gcc/testsuite/go.test/test/cmplxdivide.c b/gcc/testsuite/go.test/test/cmplxdivide.c index b340f04d887..12dc4f1c0c9 100644 --- a/gcc/testsuite/go.test/test/cmplxdivide.c +++ b/gcc/testsuite/go.test/test/cmplxdivide.c @@ -51,6 +51,7 @@ main(void) int i, j, k, l; double complex n, d, q; + printf("// skip\n"); printf("// # generated by cmplxdivide.c\n"); printf("\n"); printf("package main\n"); diff --git a/gcc/testsuite/go.test/test/cmplxdivide.go b/gcc/testsuite/go.test/test/cmplxdivide.go index 461ee9796ed..92a98356d0a 100644 --- a/gcc/testsuite/go.test/test/cmplxdivide.go +++ b/gcc/testsuite/go.test/test/cmplxdivide.go @@ -1,4 +1,4 @@ -// $G $D/$F.go $D/cmplxdivide1.go && $L $D/$F.$A && ./$A.out +// run cmplxdivide1.go // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/cmplxdivide1.go b/gcc/testsuite/go.test/test/cmplxdivide1.go index 6a1dee9fe78..e9031dd1514 100644 --- a/gcc/testsuite/go.test/test/cmplxdivide1.go +++ b/gcc/testsuite/go.test/test/cmplxdivide1.go @@ -1,3 +1,4 @@ +// skip // # generated by cmplxdivide.c package main diff --git a/gcc/testsuite/go.test/test/complit.go b/gcc/testsuite/go.test/test/complit.go index 8dfc71dcb47..649be6d4d39 100644 --- a/gcc/testsuite/go.test/test/complit.go +++ b/gcc/testsuite/go.test/test/complit.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test composite literals. + package main type T struct { diff --git a/gcc/testsuite/go.test/test/complit1.go b/gcc/testsuite/go.test/test/complit1.go index cd543930eef..521401d7393 100644 --- a/gcc/testsuite/go.test/test/complit1.go +++ b/gcc/testsuite/go.test/test/complit1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal composite literals are detected. +// Does not compile. + package main var m map[int][3]int diff --git a/gcc/testsuite/go.test/test/compos.go b/gcc/testsuite/go.test/test/compos.go index 70f90f37945..de688b39bb6 100644 --- a/gcc/testsuite/go.test/test/compos.go +++ b/gcc/testsuite/go.test/test/compos.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: compos +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that returning &T{} from a function causes an allocation. + package main type T struct { diff --git a/gcc/testsuite/go.test/test/const.go b/gcc/testsuite/go.test/test/const.go index a55e13a40de..80fbfaf3ea0 100644 --- a/gcc/testsuite/go.test/test/const.go +++ b/gcc/testsuite/go.test/test/const.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple boolean and numeric constants. + package main const ( diff --git a/gcc/testsuite/go.test/test/const1.go b/gcc/testsuite/go.test/test/const1.go index 67f36e4fdc9..1580b76c683 100644 --- a/gcc/testsuite/go.test/test/const1.go +++ b/gcc/testsuite/go.test/test/const1.go @@ -1,9 +1,12 @@ -// errchk $G -e $F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify overflow is detected when using numeric constants. +// Does not compile. + package main type I interface{} @@ -13,11 +16,11 @@ const ( Int8 int8 = 101 Minus1 int8 = -1 Uint8 uint8 = 102 - Const = 103 + Const = 103 Float32 float32 = 104.5 Float64 float64 = 105.5 - ConstFloat = 106.5 + ConstFloat = 106.5 Big float64 = 1e300 String = "abc" @@ -35,32 +38,35 @@ var ( a8 = Int8 * Const / 100 // ERROR "overflow" a9 = Int8 * (Const / 100) // OK - b1 = Uint8 * Uint8 // ERROR "overflow" - b2 = Uint8 * -1 // ERROR "overflow" - b3 = Uint8 - Uint8 // OK - b4 = Uint8 - Uint8 - Uint8 // ERROR "overflow" - b5 = uint8(^0) // ERROR "overflow" - b6 = ^uint8(0) // OK - b7 = uint8(Minus1) // ERROR "overflow" - b8 = uint8(int8(-1)) // ERROR "overflow" - b8a = uint8(-1) // ERROR "overflow" - b9 byte = (1 << 10) >> 8 // OK - b10 byte = (1 << 10) // ERROR "overflow" - b11 byte = (byte(1) << 10) >> 8 // ERROR "overflow" - b12 byte = 1000 // ERROR "overflow" - b13 byte = byte(1000) // ERROR "overflow" - b14 byte = byte(100) * byte(100) // ERROR "overflow" - b15 byte = byte(100) * 100 // ERROR "overflow" - b16 byte = byte(0) * 1000 // ERROR "overflow" - b16a byte = 0 * 1000 // OK - b17 byte = byte(0) * byte(1000) // ERROR "overflow" - b18 byte = Uint8 / 0 // ERROR "division by zero" + b1 = Uint8 * Uint8 // ERROR "overflow" + b2 = Uint8 * -1 // ERROR "overflow" + b3 = Uint8 - Uint8 // OK + b4 = Uint8 - Uint8 - Uint8 // ERROR "overflow" + b5 = uint8(^0) // ERROR "overflow" + b5a = int64(^0) // OK + b6 = ^uint8(0) // OK + b6a = ^int64(0) // OK + b7 = uint8(Minus1) // ERROR "overflow" + b8 = uint8(int8(-1)) // ERROR "overflow" + b8a = uint8(-1) // ERROR "overflow" + b9 byte = (1 << 10) >> 8 // OK + b10 byte = (1 << 10) // ERROR "overflow" + b11 byte = (byte(1) << 10) >> 8 // ERROR "overflow" + b12 byte = 1000 // ERROR "overflow" + b13 byte = byte(1000) // ERROR "overflow" + b14 byte = byte(100) * byte(100) // ERROR "overflow" + b15 byte = byte(100) * 100 // ERROR "overflow" + b16 byte = byte(0) * 1000 // ERROR "overflow" + b16a byte = 0 * 1000 // OK + b17 byte = byte(0) * byte(1000) // ERROR "overflow" + b18 byte = Uint8 / 0 // ERROR "division by zero" - c1 float64 = Big - c2 float64 = Big * Big // ERROR "overflow" - c3 float64 = float64(Big) * Big // ERROR "overflow" - c4 = Big * Big // ERROR "overflow" - c5 = Big / 0 // ERROR "division by zero" + c1 float64 = Big + c2 float64 = Big * Big // ERROR "overflow" + c3 float64 = float64(Big) * Big // ERROR "overflow" + c4 = Big * Big // ERROR "overflow" + c5 = Big / 0 // ERROR "division by zero" + c6 = 1000 % 1e3 // ERROR "floating-point % operation|expected integer type" ) func f(int) diff --git a/gcc/testsuite/go.test/test/const2.go b/gcc/testsuite/go.test/test/const2.go index bea1b991254..048d0cb9f39 100644 --- a/gcc/testsuite/go.test/test/const2.go +++ b/gcc/testsuite/go.test/test/const2.go @@ -1,12 +1,21 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that large integer constant expressions cause overflow. +// Does not compile. + package main const ( A int = 1 B byte; // ERROR "type without expr|expected .=." ) + +const LargeA = 1000000000000000000 +const LargeB = LargeA * LargeA * LargeA +const LargeC = LargeB * LargeB * LargeB // GC_ERROR "constant multiplication overflow" + +const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // GC_ERROR "constant shift overflow" diff --git a/gcc/testsuite/go.test/test/const3.go b/gcc/testsuite/go.test/test/const3.go index 9bba6ced0b8..3f4e3d1ae6f 100644 --- a/gcc/testsuite/go.test/test/const3.go +++ b/gcc/testsuite/go.test/test/const3.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test typed integer constants. + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/const4.go b/gcc/testsuite/go.test/test/const4.go new file mode 100644 index 00000000000..677fcefa750 --- /dev/null +++ b/gcc/testsuite/go.test/test/const4.go @@ -0,0 +1,77 @@ +// run + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test len constants and non-constants, http://golang.org/issue/3244. + +package main + +var b struct { + a[10]int +} + +var m map[string][20]int + +var s [][30]int + +const ( + n1 = len(b.a) + n2 = len(m[""]) + n3 = len(s[10]) +) + +// Non-constants (see also const5.go). +var ( + n4 = len(f()) + n5 = len(<-c) + n6 = cap(g()) + n7 = cap(<-c1) +) + +var calledF = false + +func f() *[40]int { + calledF = true + return nil +} + +var c = func() chan *[50]int { + c := make(chan *[50]int, 2) + c <- nil + c <- new([50]int) + return c +}() + +var calledG = false + +func g() *[60]int { + calledG = true + return nil +} + +var c1 = func() chan *[70]int { + c := make(chan *[70]int, 2) + c <- nil + c <- new([70]int) + return c +}() + +func main() { + if n1 != 10 || n2 != 20 || n3 != 30 || n4 != 40 || n5 != 50 || n6 != 60 || n7 != 70 { + println("BUG:", n1, n2, n3, n4, n5, n6, n7) + } + if !calledF { + println("BUG: did not call f") + } + if <-c == nil { + println("BUG: did not receive from c") + } + if !calledG { + println("BUG: did not call g") + } + if <-c1 == nil { + println("BUG: did not receive from c1") + } +} diff --git a/gcc/testsuite/go.test/test/const5.go b/gcc/testsuite/go.test/test/const5.go new file mode 100644 index 00000000000..d0eed137d1a --- /dev/null +++ b/gcc/testsuite/go.test/test/const5.go @@ -0,0 +1,33 @@ +// errorcheck + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that len non-constants are not constants, http://golang.org/issue/3244. + +package p + +var b struct { + a[10]int +} + +var m map[string][20]int + +var s [][30]int + +func f() *[40]int +var c chan *[50]int + +const ( + n1 = len(b.a) + n2 = len(m[""]) + n3 = len(s[10]) + + n4 = len(f()) // ERROR "must be constant|is not constant" + n5 = len(<-c) // ERROR "must be constant|is not constant" + + n6 = cap(f()) // ERROR "must be constant|is not constant" + n7 = cap(<-c) // ERROR "must be constant|is not constant" +) + diff --git a/gcc/testsuite/go.test/test/convT2X.go b/gcc/testsuite/go.test/test/convT2X.go new file mode 100644 index 00000000000..7e27f06b0cb --- /dev/null +++ b/gcc/testsuite/go.test/test/convT2X.go @@ -0,0 +1,195 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test conversion from non-interface types to the empty interface. + +package main + +type J interface { + Method() +} + +type ( + U16 uint16 + U32 uint32 + U64 uint64 + U128 [2]uint64 + F32 float32 + F64 float64 + C128 complex128 + S string + B []byte + M map[int]int + C chan int + Z struct{} +) + +func (U16) Method() {} +func (U32) Method() {} +func (U64) Method() {} +func (U128) Method() {} +func (F32) Method() {} +func (F64) Method() {} +func (C128) Method() {} +func (S) Method() {} +func (B) Method() {} +func (M) Method() {} +func (C) Method() {} +func (Z) Method() {} + +var ( + u16 = U16(1) + u32 = U32(2) + u64 = U64(3) + u128 = U128{4, 5} + f32 = F32(6) + f64 = F64(7) + c128 = C128(8 + 9i) + s = S("10") + b = B("11") + m = M{12: 13} + c = make(C, 14) + z = Z{} + p = &z + pp = &p +) + +var ( + iu16 interface{} = u16 + iu32 interface{} = u32 + iu64 interface{} = u64 + iu128 interface{} = u128 + if32 interface{} = f32 + if64 interface{} = f64 + ic128 interface{} = c128 + is interface{} = s + ib interface{} = b + im interface{} = m + ic interface{} = c + iz interface{} = z + ip interface{} = p + ipp interface{} = pp + + ju16 J = u16 + ju32 J = u32 + ju64 J = u64 + ju128 J = u128 + jf32 J = f32 + jf64 J = f64 + jc128 J = c128 + js J = s + jb J = b + jm J = m + jc J = c + jz J = z + jp J = p // The method set for *T contains the methods for T. + // pp does not implement error. +) + +func second(a ...interface{}) interface{} { + return a[1] +} + +func main() { + // Test equality. + if u16 != iu16 { + panic("u16 != iu16") + } + if u16 != ju16 { + panic("u16 != ju16") + } + if u32 != iu32 { + panic("u32 != iu32") + } + if u32 != ju32 { + panic("u32 != ju32") + } + if u64 != iu64 { + panic("u64 != iu64") + } + if u64 != ju64 { + panic("u64 != ju64") + } + if u128 != iu128 { + panic("u128 != iu128") + } + if u128 != ju128 { + panic("u128 != ju128") + } + if f32 != if32 { + panic("f32 != if32") + } + if f32 != jf32 { + panic("f32 != jf32") + } + if f64 != if64 { + panic("f64 != if64") + } + if f64 != jf64 { + panic("f64 != jf64") + } + if c128 != ic128 { + panic("c128 != ic128") + } + if c128 != jc128 { + panic("c128 != jc128") + } + if s != is { + panic("s != is") + } + if s != js { + panic("s != js") + } + if c != ic { + panic("c != ic") + } + if c != jc { + panic("c != jc") + } + // There are no tests for b and m, as slices and maps are not comparable by ==. + if z != iz { + panic("z != iz") + } + if z != jz { + panic("z != jz") + } + if p != ip { + panic("p != ip") + } + if p != jp { + panic("p != jp") + } + if pp != ipp { + panic("pp != ipp") + } + // pp does not implement J. + + // Test that non-interface types can be used as ...interface{} arguments. + if got := second(z, p, pp, u16, u32, u64, u128, f32, f64, c128, s, b, m, c); got != ip { + println("second: got", got, "want", ip) + panic("fail") + } + + // Test that non-interface types can be sent on a chan interface{}. + const n = 100 + uc := make(chan interface{}) + go func() { + for i := 0; i < n; i++ { + select { + case uc <- nil: + case uc <- u32: + case uc <- u64: + case uc <- u128: + } + } + }() + for i := 0; i < n; i++ { + if got := <-uc; got != nil && got != u32 && got != u64 && got != u128 { + println("recv: i", i, "got", got) + panic("fail") + } + } +} diff --git a/gcc/testsuite/go.test/test/convert.go b/gcc/testsuite/go.test/test/convert.go index 0a75663d064..7280edf333c 100644 --- a/gcc/testsuite/go.test/test/convert.go +++ b/gcc/testsuite/go.test/test/convert.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test types of constant expressions, using reflect. + package main import "reflect" diff --git a/gcc/testsuite/go.test/test/convert1.go b/gcc/testsuite/go.test/test/convert1.go index bbd0c5f2b06..0f417a33804 100644 --- a/gcc/testsuite/go.test/test/convert1.go +++ b/gcc/testsuite/go.test/test/convert1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal conversions involving strings are detected. +// Does not compile. + package main type Tbyte []byte diff --git a/gcc/testsuite/go.test/test/convert3.go b/gcc/testsuite/go.test/test/convert3.go index be68c95b362..143aff04f6a 100644 --- a/gcc/testsuite/go.test/test/convert3.go +++ b/gcc/testsuite/go.test/test/convert3.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify allowed and disallowed conversions. +// Does not compile. + package main // everything here is legal except the ERROR line diff --git a/gcc/testsuite/go.test/test/convlit.go b/gcc/testsuite/go.test/test/convlit.go index 1e82d1f2f56..8a6145d2a0b 100644 --- a/gcc/testsuite/go.test/test/convlit.go +++ b/gcc/testsuite/go.test/test/convlit.go @@ -1,14 +1,15 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal assignments with both explicit and implicit conversions of literals are detected. +// Does not compile. + package main -// explicit conversion of constants is work in progress. -// the ERRORs in this block are debatable, but they're what -// the language spec says for now. +// explicit conversion of constants var x1 = string(1) var x2 string = string(1) var x3 = int(1.5) // ERROR "convert|truncate" diff --git a/gcc/testsuite/go.test/test/convlit1.go b/gcc/testsuite/go.test/test/convlit1.go index 1e6673cb641..c06bd744383 100644 --- a/gcc/testsuite/go.test/test/convlit1.go +++ b/gcc/testsuite/go.test/test/convlit1.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal uses of composite literals are detected. +// Does not compile. + package main var a = []int { "a" }; // ERROR "conver|incompatible|cannot" diff --git a/gcc/testsuite/go.test/test/copy.go b/gcc/testsuite/go.test/test/copy.go index 0b5bddbed5c..65ffb6ff8f5 100644 --- a/gcc/testsuite/go.test/test/copy.go +++ b/gcc/testsuite/go.test/test/copy.go @@ -1,10 +1,10 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Semi-exhaustive test for copy() +// Semi-exhaustive test for the copy predeclared function. package main diff --git a/gcc/testsuite/go.test/test/crlf.go b/gcc/testsuite/go.test/test/crlf.go index 292b63bf4b3..2d56889b039 100644 --- a/gcc/testsuite/go.test/test/crlf.go +++ b/gcc/testsuite/go.test/test/crlf.go @@ -1,6 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go && -// $G tmp.go && $L tmp.$A && ./$A.out -// rm -f tmp.go +// runoutput // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/ddd.go b/gcc/testsuite/go.test/test/ddd.go index b95d6e883f9..01768b89f3b 100644 --- a/gcc/testsuite/go.test/test/ddd.go +++ b/gcc/testsuite/go.test/test/ddd.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test variadic functions and calls (dot-dot-dot). + package main func sum(args ...int) int { @@ -58,6 +60,10 @@ type U struct { *T } +type I interface { + Sum(...int) int +} + func main() { if x := sum(1, 2, 3); x != 6 { println("sum 6", x) @@ -205,7 +211,14 @@ func main() { println("i(=u).Sum", x) panic("fail") } - /* TODO(rsc): Enable once nested method expressions work. + var s struct { + I + } + s.I = &u + if x := s.Sum(2, 3, 5, 8); x != 18 { + println("s{&u}.Sum", x) + panic("fail") + } if x := (*U).Sum(&U{}, 1, 3, 5, 2); x != 11 { println("(*U).Sum", x) panic("fail") @@ -214,5 +227,4 @@ func main() { println("U.Sum", x) panic("fail") } - */ } diff --git a/gcc/testsuite/go.test/test/ddd1.go b/gcc/testsuite/go.test/test/ddd1.go index 6d84248e5e8..07981af126a 100644 --- a/gcc/testsuite/go.test/test/ddd1.go +++ b/gcc/testsuite/go.test/test/ddd1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal uses of ... are detected. +// Does not compile. + package main import "unsafe" @@ -19,6 +22,16 @@ var ( _ = sum([]int{1}) // ERROR "\[\]int literal.*as type int|incompatible" ) +func sum3(int, int, int) int { return 0 } +func tuple() (int, int, int) { return 1, 2, 3 } + +var ( + _ = sum(tuple()) + _ = sum(tuple()...) // ERROR "multiple-value|[.][.][.]" + _ = sum3(tuple()) + _ = sum3(tuple()...) // ERROR "multiple-value|[.][.][.]" "not enough" +) + type T []T func funny(args ...T) int { return 0 } diff --git a/gcc/testsuite/go.test/test/ddd2.go b/gcc/testsuite/go.test/test/ddd2.go index a06af0c0657..a141a39c766 100644 --- a/gcc/testsuite/go.test/test/ddd2.go +++ b/gcc/testsuite/go.test/test/ddd2.go @@ -1,9 +1,11 @@ -// true +// skip // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// This file is compiled and then imported by ddd3.go. + package ddd func Sum(args ...int) int { diff --git a/gcc/testsuite/go.test/test/ddd3.go b/gcc/testsuite/go.test/test/ddd3.go index 5d5ebdf0fae..d8de0a77e90 100644 --- a/gcc/testsuite/go.test/test/ddd3.go +++ b/gcc/testsuite/go.test/test/ddd3.go @@ -1,9 +1,14 @@ // $G $D/ddd2.go && $G $D/$F.go && $L $F.$A && ./$A.out +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that variadic functions work across package boundaries. + package main import "./ddd2" diff --git a/gcc/testsuite/go.test/test/decl.go b/gcc/testsuite/go.test/test/decl.go index 95b6346c3ed..6f84245f152 100644 --- a/gcc/testsuite/go.test/test/decl.go +++ b/gcc/testsuite/go.test/test/decl.go @@ -1,10 +1,10 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Correct short declarations and redeclarations. +// Test correct short declarations and redeclarations. package main diff --git a/gcc/testsuite/go.test/test/declbad.go b/gcc/testsuite/go.test/test/declbad.go index 09f1dfb576f..ff53ab0d7c5 100644 --- a/gcc/testsuite/go.test/test/declbad.go +++ b/gcc/testsuite/go.test/test/declbad.go @@ -1,10 +1,11 @@ -// errchk $G -e $F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Incorrect short declarations and redeclarations. +// Test that incorrect short declarations and redeclarations are detected. +// Does not compile. package main @@ -37,6 +38,13 @@ func main() { i, f := f2() // ERROR "redeclared|no new" _, _, _ = i, f, s } + { + // multiline no new variables + i := f1 + i := func() { // ERROR "redeclared|no new|incompatible" + } + _ = i + } { // single redeclaration i, f, s := f3() diff --git a/gcc/testsuite/go.test/test/defer.go b/gcc/testsuite/go.test/test/defer.go index bef8fbe26a6..2f67d356091 100644 --- a/gcc/testsuite/go.test/test/defer.go +++ b/gcc/testsuite/go.test/test/defer.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test defer. + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/deferprint.go b/gcc/testsuite/go.test/test/deferprint.go index 0e0c6182168..72c98b19fc9 100644 --- a/gcc/testsuite/go.test/test/deferprint.go +++ b/gcc/testsuite/go.test/test/deferprint.go @@ -1,14 +1,17 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that we can defer the predeclared functions print and println. + package main func main() { defer println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255)) defer println(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20) -// defer panic("dead") + // Disabled so the test doesn't crash but left here for reference. + // defer panic("dead") defer print("printing: ") } diff --git a/gcc/testsuite/go.test/test/divide.go b/gcc/testsuite/go.test/test/divide.go index 5c0f45059a2..c91a33e9db2 100644 --- a/gcc/testsuite/go.test/test/divide.go +++ b/gcc/testsuite/go.test/test/divide.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// divide corner cases +// Test divide corner cases. package main diff --git a/gcc/testsuite/go.test/test/dwarf/linedirectives.go b/gcc/testsuite/go.test/test/dwarf/linedirectives.go index 68434f0ab57..cc4ffb000fd 100644 --- a/gcc/testsuite/go.test/test/dwarf/linedirectives.go +++ b/gcc/testsuite/go.test/test/dwarf/linedirectives.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/dwarf/main.go b/gcc/testsuite/go.test/test/dwarf/main.go index 7f2ec4c00a6..175a09c7799 100644 --- a/gcc/testsuite/go.test/test/dwarf/main.go +++ b/gcc/testsuite/go.test/test/dwarf/main.go @@ -1,5 +1,8 @@ // $G $D/$F.go $D/z*.go && $L $F.$A && ./$A.out +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/empty.go b/gcc/testsuite/go.test/test/empty.go index fa10d6931d9..92a79a4e0d8 100644 --- a/gcc/testsuite/go.test/test/empty.go +++ b/gcc/testsuite/go.test/test/empty.go @@ -1,9 +1,12 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that top-level parenthesized declarations can be empty. +// Compiles but does not run. + package P import ( ) diff --git a/gcc/testsuite/go.test/test/env.go b/gcc/testsuite/go.test/test/env.go index 3c8e4232838..972374679ac 100644 --- a/gcc/testsuite/go.test/test/env.go +++ b/gcc/testsuite/go.test/test/env.go @@ -1,4 +1,4 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/eof.go b/gcc/testsuite/go.test/test/eof.go index 81f9fd028ff..06c779046b6 100644 --- a/gcc/testsuite/go.test/test/eof.go +++ b/gcc/testsuite/go.test/test/eof.go @@ -1,9 +1,12 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test a source file does not need a final newline. +// Compiles but does not run. + // No newline at the end of this file. package main \ No newline at end of file diff --git a/gcc/testsuite/go.test/test/eof1.go b/gcc/testsuite/go.test/test/eof1.go index c39a3cfdb15..2105b89080b 100644 --- a/gcc/testsuite/go.test/test/eof1.go +++ b/gcc/testsuite/go.test/test/eof1.go @@ -1,9 +1,12 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +// Test that a comment ending a source file does not need a final newline. +// Compiles but does not run. + +package eof1 // No newline at the end of this comment. \ No newline at end of file diff --git a/gcc/testsuite/go.test/test/escape.go b/gcc/testsuite/go.test/test/escape.go index d4d844704ef..e8ede52760a 100644 --- a/gcc/testsuite/go.test/test/escape.go +++ b/gcc/testsuite/go.test/test/escape.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -6,8 +6,8 @@ package main -// check for correct heap-moving of escaped variables. -// it is hard to check for the allocations, but it is easy +// Test for correct heap-moving of escaped variables. +// It is hard to check for the allocations, but it is easy // to check that if you call the function twice at the // same stack level, the pointers returned should be // different. @@ -18,15 +18,15 @@ var allptr = make([]*int, 0, 100) func noalias(p, q *int, s string) { n := len(allptr) - *p = -(n+1) - *q = -(n+2) - allptr = allptr[0:n+2] + *p = -(n + 1) + *q = -(n + 2) + allptr = allptr[0 : n+2] allptr[n] = p allptr[n+1] = q n += 2 for i := 0; i < n; i++ { if allptr[i] != nil && *allptr[i] != -(i+1) { - println("aliased pointers", -(i+1), *allptr[i], "after", s) + println("aliased pointers", -(i + 1), *allptr[i], "after", s) allptr[i] = nil bad = true } @@ -141,15 +141,27 @@ func for_escapes2(x int, y int) (*int, *int) { return p[0], p[1] } +func for_escapes3(x int, y int) (*int, *int) { + var f [2]func() *int + n := 0 + for i := x; n < 2; i = y { + p := new(int) + *p = i + f[n] = func() *int { return p } + n++ + } + return f[0](), f[1]() +} + func out_escapes(i int) (x int, p *int) { x = i - p = &x // ERROR "address of out parameter" + p = &x // ERROR "address of out parameter" return } func out_escapes_2(i int) (x int, p *int) { x = i - return x, &x // ERROR "address of out parameter" + return x, &x // ERROR "address of out parameter" } func defer1(i int) (x int) { @@ -187,6 +199,9 @@ func main() { p, q = for_escapes2(103, 104) chkalias(p, q, 103, "for_escapes2") + p, q = for_escapes3(105, 106) + chk(p, q, 105, "for_escapes3") + _, p = out_escapes(15) _, q = out_escapes(16) chk(p, q, 15, "out_escapes") diff --git a/gcc/testsuite/go.test/test/escape2.go b/gcc/testsuite/go.test/test/escape2.go index 73b2a7e5897..8db12d99131 100644 --- a/gcc/testsuite/go.test/test/escape2.go +++ b/gcc/testsuite/go.test/test/escape2.go @@ -1,9 +1,12 @@ -// errchk -0 $G -m -l $D/$F.go +// errorcheck -0 -m -l // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test, using compiler diagnostic flags, that the escape analysis is working. +// Compiles but does not run. Inlining is disabled. + package foo import ( @@ -537,6 +540,19 @@ func foo74() { } } +// issue 3975 +func foo74b() { + var array [3]func() + s := []int{3, 2, 1} // ERROR "\[\]int literal does not escape" + for i, v := range s { + vv := v // ERROR "moved to heap: vv" + // actually just escapes its scope + array[i] = func() { // ERROR "func literal escapes to heap" + println(vv) // ERROR "&vv escapes to heap" + } + } +} + func myprint(y *int, x ...interface{}) *int { // ERROR "x does not escape" "leaking param: y" return y } @@ -1048,7 +1064,7 @@ func foo122() { goto L1 L1: - i = new(int) // ERROR "does not escape" + i = new(int) // ERROR "new.int. does not escape" _ = i } @@ -1057,8 +1073,159 @@ func foo123() { var i *int L1: - i = new(int) // ERROR "escapes" + i = new(int) // ERROR "new.int. escapes to heap" goto L1 _ = i } + +func foo124(x **int) { // ERROR "x does not escape" + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes" + func() { // ERROR "func literal does not escape" + *x = p // ERROR "leaking closure reference p" + }() +} + +func foo125(ch chan *int) { // ERROR "does not escape" + var i int // ERROR "moved to heap" + p := &i // ERROR "&i escapes to heap" + func() { // ERROR "func literal does not escape" + ch <- p // ERROR "leaking closure reference p" + }() +} + +func foo126() { + var px *int // loopdepth 0 + for { + // loopdepth 1 + var i int // ERROR "moved to heap" + func() { // ERROR "func literal does not escape" + px = &i // ERROR "&i escapes" + }() + } +} + +var px *int + +func foo127() { + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes to heap" + q := p + px = q +} + +func foo128() { + var i int + p := &i // ERROR "&i does not escape" + q := p + _ = q +} + +func foo129() { + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes to heap" + func() { // ERROR "func literal does not escape" + q := p // ERROR "leaking closure reference p" + func() { // ERROR "func literal does not escape" + r := q // ERROR "leaking closure reference q" + px = r + }() + }() +} + +func foo130() { + for { + var i int // ERROR "moved to heap" + func() { // ERROR "func literal does not escape" + px = &i // ERROR "&i escapes" "leaking closure reference i" + }() + } +} + +func foo131() { + var i int // ERROR "moved to heap" + func() { // ERROR "func literal does not escape" + px = &i // ERROR "&i escapes" "leaking closure reference i" + }() +} + +func foo132() { + var i int // ERROR "moved to heap" + go func() { // ERROR "func literal escapes to heap" + px = &i // ERROR "&i escapes" "leaking closure reference i" + }() +} + +func foo133() { + var i int // ERROR "moved to heap" + defer func() { // ERROR "func literal does not escape" + px = &i // ERROR "&i escapes" "leaking closure reference i" + }() +} + +func foo134() { + var i int + p := &i // ERROR "&i does not escape" + func() { // ERROR "func literal does not escape" + q := p + func() { // ERROR "func literal does not escape" + r := q + _ = r + }() + }() +} + +func foo135() { + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes to heap" "moved to heap: p" + go func() { // ERROR "func literal escapes to heap" + q := p // ERROR "&p escapes to heap" + func() { // ERROR "func literal does not escape" + r := q + _ = r + }() + }() +} + +func foo136() { + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes to heap" "moved to heap: p" + go func() { // ERROR "func literal escapes to heap" + q := p // ERROR "&p escapes to heap" "leaking closure reference p" + func() { // ERROR "func literal does not escape" + r := q // ERROR "leaking closure reference q" + px = r + }() + }() +} + +func foo137() { + var i int // ERROR "moved to heap: i" + p := &i // ERROR "&i escapes to heap" + func() { // ERROR "func literal does not escape" + q := p // ERROR "leaking closure reference p" "moved to heap: q" + go func() { // ERROR "func literal escapes to heap" + r := q // ERROR "&q escapes to heap" + _ = r + }() + }() +} + +func foo138() *byte { + type T struct { + x [1]byte + } + t := new(T) // ERROR "new.T. escapes to heap" + return &t.x[0] // ERROR "&t.x.0. escapes to heap" +} + +func foo139() *byte { + type T struct { + x struct { + y byte + } + } + t := new(T) // ERROR "new.T. escapes to heap" + return &t.x.y // ERROR "&t.x.y escapes to heap" +} diff --git a/gcc/testsuite/go.test/test/escape3.go b/gcc/testsuite/go.test/test/escape3.go index fc2d6ebbe4b..4c198915146 100644 --- a/gcc/testsuite/go.test/test/escape3.go +++ b/gcc/testsuite/go.test/test/escape3.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Test run-time behavior of escape analysis-related optimizations. +// Test the run-time behavior of escape analysis-related optimizations. package main diff --git a/gcc/testsuite/go.test/test/escape4.go b/gcc/testsuite/go.test/test/escape4.go new file mode 100644 index 00000000000..83bc8eb123d --- /dev/null +++ b/gcc/testsuite/go.test/test/escape4.go @@ -0,0 +1,57 @@ +// errorcheck -0 -m + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test, using compiler diagnostic flags, that the escape analysis is working. +// Compiles but does not run. Inlining is enabled. + +package foo + +var p *int + +func alloc(x int) *int { // ERROR "can inline alloc" "moved to heap: x" + return &x // ERROR "&x escapes to heap" +} + +var f func() + +func f1() { + p = alloc(2) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x" + + // Escape analysis used to miss inlined code in closures. + + func() { // ERROR "func literal does not escape" + p = alloc(3) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x" + }() + + f = func() { // ERROR "func literal escapes to heap" + p = alloc(3) // ERROR "inlining call to alloc" "&x escapes to heap" "moved to heap: x" + } + f() +} + +func f2() {} // ERROR "can inline f2" + +// No inline for panic, recover. +func f3() { panic(1) } +func f4() { recover() } + +func f5() *byte { + type T struct { + x [1]byte + } + t := new(T) // ERROR "new.T. escapes to heap" + return &t.x[0] // ERROR "&t.x.0. escapes to heap" +} + +func f6() *byte { + type T struct { + x struct { + y byte + } + } + t := new(T) // ERROR "new.T. escapes to heap" + return &t.x.y // ERROR "&t.x.y escapes to heap" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug000.go b/gcc/testsuite/go.test/test/fixedbugs/bug000.go index ccb24e8e9bb..9104a57aaf6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug000.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug000.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug002.go b/gcc/testsuite/go.test/test/fixedbugs/bug002.go index 230841974f3..3493426d377 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug002.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug002.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug003.go b/gcc/testsuite/go.test/test/fixedbugs/bug003.go index e45975be41a..7165d9d2099 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug003.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug003.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug004.go b/gcc/testsuite/go.test/test/fixedbugs/bug004.go index 20f467a5f4e..fb207e9bc8e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug004.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug004.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug005.go b/gcc/testsuite/go.test/test/fixedbugs/bug005.go index 3bd2fe815ed..3798f8321a1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug005.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug005.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug006.go b/gcc/testsuite/go.test/test/fixedbugs/bug006.go index 43b5dfb1294..6761682b399 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug006.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug006.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug007.go b/gcc/testsuite/go.test/test/fixedbugs/bug007.go index d65f6da4503..3d9fcb9e01e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug007.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug007.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug008.go b/gcc/testsuite/go.test/test/fixedbugs/bug008.go index 2baead11e36..48f74a52d95 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug008.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug008.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug009.go b/gcc/testsuite/go.test/test/fixedbugs/bug009.go index ef8263bb240..0467b297a2c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug009.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug009.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug010.go b/gcc/testsuite/go.test/test/fixedbugs/bug010.go index 7d96988d43b..f54b1d54a86 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug010.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug010.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug011.go b/gcc/testsuite/go.test/test/fixedbugs/bug011.go index ce627472c47..519c3585f06 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug011.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug011.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug012.go b/gcc/testsuite/go.test/test/fixedbugs/bug012.go index ffd5b557065..38efb6d9792 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug012.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug012.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug013.go b/gcc/testsuite/go.test/test/fixedbugs/bug013.go index 4b106775c28..045786bf7a8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug013.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug013.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug014.go b/gcc/testsuite/go.test/test/fixedbugs/bug014.go index 38a6e51abcb..a20f0310e7c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug014.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug014.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug015.go b/gcc/testsuite/go.test/test/fixedbugs/bug015.go index 9178f626fc7..d3a9f22ed08 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug015.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug015.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug016.go b/gcc/testsuite/go.test/test/fixedbugs/bug016.go index 4fbfd48fd97..18fac78f34a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug016.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug016.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug017.go b/gcc/testsuite/go.test/test/fixedbugs/bug017.go index fdc986d9def..2f5960d1044 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug017.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug017.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug020.go b/gcc/testsuite/go.test/test/fixedbugs/bug020.go index 896bf5707c0..cde3f8679be 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug020.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug020.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug021.go b/gcc/testsuite/go.test/test/fixedbugs/bug021.go index 201fa5f0390..bf936e875cd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug021.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug021.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug022.go b/gcc/testsuite/go.test/test/fixedbugs/bug022.go index f94a5856936..65a8bfe9a19 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug022.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug022.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug023.go b/gcc/testsuite/go.test/test/fixedbugs/bug023.go index b3d3d4a3c15..9b211cd54f8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug023.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug023.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug024.go b/gcc/testsuite/go.test/test/fixedbugs/bug024.go index c7b17b7c092..2e235b7b46b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug024.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug024.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug026.go b/gcc/testsuite/go.test/test/fixedbugs/bug026.go index eacea37459f..bfd03cc9555 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug026.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug026.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug027.go b/gcc/testsuite/go.test/test/fixedbugs/bug027.go index cf2daaecf06..874b47e7adc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug027.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug027.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug028.go b/gcc/testsuite/go.test/test/fixedbugs/bug028.go index 0488ad2cba8..2edf5a9106f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug028.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug028.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug030.go b/gcc/testsuite/go.test/test/fixedbugs/bug030.go index 7efde9b4453..ffd29e057a9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug030.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug030.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug031.go b/gcc/testsuite/go.test/test/fixedbugs/bug031.go index acb4741e9f7..529e5ce84ce 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug031.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug031.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug035.go b/gcc/testsuite/go.test/test/fixedbugs/bug035.go index bd2a633f298..ae41a179537 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug035.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug035.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug036.go b/gcc/testsuite/go.test/test/fixedbugs/bug036.go deleted file mode 100644 index cc20516ce89..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug036.go +++ /dev/null @@ -1,13 +0,0 @@ -// ! $G $D/$F.go >/dev/null -// # ignoring error messages... - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -func main() { - s := float(0); - s := float(0); // BUG redeclaration -} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug037.go b/gcc/testsuite/go.test/test/fixedbugs/bug037.go index ff7d28710a1..f17fb3fd74c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug037.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug037.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug038.go b/gcc/testsuite/go.test/test/fixedbugs/bug038.go deleted file mode 100644 index 7585376a36f..00000000000 --- a/gcc/testsuite/go.test/test/fixedbugs/bug038.go +++ /dev/null @@ -1,13 +0,0 @@ -// ! $G $D/$F.go >/dev/null -// # ignoring error messages... - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -func main() { - var z [3]byte; - z := new([3]byte); // BUG redeclaration -} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug039.go b/gcc/testsuite/go.test/test/fixedbugs/bug039.go index 7ac02ceeb29..d34f5e62e47 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug039.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug039.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug040.go b/gcc/testsuite/go.test/test/fixedbugs/bug040.go index 912316cb6ff..007f47f9f56 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug040.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug040.go @@ -1,5 +1,4 @@ -// ! $G $D/$F.go >/dev/null -// # ignoring error messages... +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,5 +6,6 @@ package main -func main (x, x int) { // BUG redeclaration error +func f (x, // GCCGO_ERROR "previous" + x int) { // ERROR "redeclared|redefinition" "duplicate" } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug045.go b/gcc/testsuite/go.test/test/fixedbugs/bug045.go index 94888c40e2e..c66a2411a89 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug045.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug045.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug046.go b/gcc/testsuite/go.test/test/fixedbugs/bug046.go index 8a9b797074d..219e91d537b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug046.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug046.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug047.go b/gcc/testsuite/go.test/test/fixedbugs/bug047.go index 5a776abce8d..7619ae73c66 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug047.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug047.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug048.go b/gcc/testsuite/go.test/test/fixedbugs/bug048.go index b9fee7899c8..48ad751e2c6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug048.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug048.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug049.go b/gcc/testsuite/go.test/test/fixedbugs/bug049.go index 8fd67ccd51b..51990f2dfbc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug049.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug049.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug050.go b/gcc/testsuite/go.test/test/fixedbugs/bug050.go index 585c4462372..aba68b1dcbb 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug050.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug050.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug051.go b/gcc/testsuite/go.test/test/fixedbugs/bug051.go index dd1662306dc..c4ba2eff675 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug051.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug051.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug052.go b/gcc/testsuite/go.test/test/fixedbugs/bug052.go index d2c1b50617a..440a00ebebd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug052.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug052.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug053.go b/gcc/testsuite/go.test/test/fixedbugs/bug053.go index c981403edcf..00625fd7c30 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug053.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug053.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug054.go b/gcc/testsuite/go.test/test/fixedbugs/bug054.go index c8a2272c236..01590585c53 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug054.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug054.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug055.go b/gcc/testsuite/go.test/test/fixedbugs/bug055.go index 8617396109d..c3073cc1eac 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug055.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug055.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug056.go b/gcc/testsuite/go.test/test/fixedbugs/bug056.go index 050a4a5c5d3..13eac292047 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug056.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug056.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug057.go b/gcc/testsuite/go.test/test/fixedbugs/bug057.go index d5d0f1d620e..19b8651a547 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug057.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug057.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug058.go b/gcc/testsuite/go.test/test/fixedbugs/bug058.go index e2b4a241a63..2b97dbf7c0e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug058.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug058.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug059.go b/gcc/testsuite/go.test/test/fixedbugs/bug059.go index 6a77367d676..6f64b9e0b16 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug059.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug059.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug060.go b/gcc/testsuite/go.test/test/fixedbugs/bug060.go index 82778b8386f..8260729056b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug060.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug060.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug061.go b/gcc/testsuite/go.test/test/fixedbugs/bug061.go index aedcf70fefe..ae99b186d81 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug061.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug061.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug062.go b/gcc/testsuite/go.test/test/fixedbugs/bug062.go index 8ee5c84cb9d..1cc50036559 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug062.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug062.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug063.go b/gcc/testsuite/go.test/test/fixedbugs/bug063.go index 543e0b72607..a3ae3f09620 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug063.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug063.go @@ -1,8 +1,8 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug063 const c = 0 ^ 0 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug064.go b/gcc/testsuite/go.test/test/fixedbugs/bug064.go index 92d2154236f..d8b3bea9a60 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug064.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug064.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: compilation should succeed +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug065.go b/gcc/testsuite/go.test/test/fixedbugs/bug065.go index a5d1bedddb9..a1e3b08bbae 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug065.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug065.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug066.go b/gcc/testsuite/go.test/test/fixedbugs/bug066.go index 2fa5048f1bf..db3d7f86028 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug066.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug066.go @@ -1,10 +1,10 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug066 type Scope struct { entries map[string] *Object; diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug067.go b/gcc/testsuite/go.test/test/fixedbugs/bug067.go index 328d191bb42..aaeefb0ba16 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug067.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug067.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug068.go b/gcc/testsuite/go.test/test/fixedbugs/bug068.go index a7cf4239c43..2cb10ab3a19 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug068.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug068.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug069.go b/gcc/testsuite/go.test/test/fixedbugs/bug069.go index 9038387ac86..7b07b773d4b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug069.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug069.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug070.go b/gcc/testsuite/go.test/test/fixedbugs/bug070.go index 24ac7798889..3f3ffcf6151 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug070.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug070.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug071.go b/gcc/testsuite/go.test/test/fixedbugs/bug071.go index a5003ffb976..ec38f7a9799 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug071.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug071.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: compiler crashes +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug071 type rat struct { den int; diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug072.go b/gcc/testsuite/go.test/test/fixedbugs/bug072.go index efe5626db59..05ad93dac2d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug072.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug072.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug073.go b/gcc/testsuite/go.test/test/fixedbugs/bug073.go index 99e7cd19ee4..49b47ae4649 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug073.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug073.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug074.go b/gcc/testsuite/go.test/test/fixedbugs/bug074.go index 7b6d14e7e63..fb789cb4c1b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug074.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug074.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug075.go b/gcc/testsuite/go.test/test/fixedbugs/bug075.go index 7aed13089df..d0b7d14e71b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug075.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug075.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug076.go b/gcc/testsuite/go.test/test/fixedbugs/bug076.go index 2ca518d76d8..60aaa976083 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug076.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug076.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A +// build // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug077.go b/gcc/testsuite/go.test/test/fixedbugs/bug077.go index 2cbf96d98fe..80581a8a3b6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug077.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug077.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug078.go b/gcc/testsuite/go.test/test/fixedbugs/bug078.go index ddd3faeba41..1041b858c84 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug078.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug078.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug080.go b/gcc/testsuite/go.test/test/fixedbugs/bug080.go index bae16cdb2e9..32b2c53b9e7 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug080.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug080.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: fails incorrectly +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug081.go b/gcc/testsuite/go.test/test/fixedbugs/bug081.go index 026ce8002f2..c25d2883704 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug081.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug081.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug082.go b/gcc/testsuite/go.test/test/fixedbugs/bug082.go index 8353ec200e4..e184ef19301 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug082.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug082.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug083.go b/gcc/testsuite/go.test/test/fixedbugs/bug083.go index 984969d47f7..8bdecaadb51 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug083.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug083.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/bug0.go && errchk $G $D/$F.dir/bug1.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug084.go b/gcc/testsuite/go.test/test/fixedbugs/bug084.go index c1054e550cc..700a674339d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug084.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug084.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug085.go b/gcc/testsuite/go.test/test/fixedbugs/bug085.go index 02be7175340..93ae7e0a496 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug085.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug085.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug086.go b/gcc/testsuite/go.test/test/fixedbugs/bug086.go index f96472fbb35..fc69e0e3fc7 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug086.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug086.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug087.go b/gcc/testsuite/go.test/test/fixedbugs/bug087.go index 4af8d976f87..67e7210cdb3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug087.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug087.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: fails incorrectly +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug088.go b/gcc/testsuite/go.test/test/fixedbugs/bug088.go index 9715a703cb1..3b99da84d4b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug088.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug088.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go || echo BUG: fails incorrectly +// compiledir // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug089.go b/gcc/testsuite/go.test/test/fixedbugs/bug089.go index fd3dff3ec90..e88f17babb8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug089.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug089.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug090.go b/gcc/testsuite/go.test/test/fixedbugs/bug090.go index 8318ab9c0c0..320bd57f5c1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug090.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug090.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug091.go b/gcc/testsuite/go.test/test/fixedbugs/bug091.go index c2ede7153ce..dbb1287a151 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug091.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug091.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug092.go b/gcc/testsuite/go.test/test/fixedbugs/bug092.go index 8f05c478f5c..8027d941ea4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug092.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug092.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug093.go b/gcc/testsuite/go.test/test/fixedbugs/bug093.go index 52d92c7e3d4..acd94466f59 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug093.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug093.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: fails incorrectly +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug094.go b/gcc/testsuite/go.test/test/fixedbugs/bug094.go index 2953eb28d37..3ef11da3d3a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug094.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug094.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: fails incorrectly +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug096.go b/gcc/testsuite/go.test/test/fixedbugs/bug096.go index 9be687a7bb4..411ba74e0ca 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug096.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug096.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug097.go b/gcc/testsuite/go.test/test/fixedbugs/bug097.go index ec3c21543d3..a067e0f57aa 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug097.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug097.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug098.go b/gcc/testsuite/go.test/test/fixedbugs/bug098.go index 1dad4d502aa..eb4ee4de03f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug098.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug098.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug099.go b/gcc/testsuite/go.test/test/fixedbugs/bug099.go index f76f0e873cf..03a5c454b0b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug099.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug099.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should not crash +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug101.go b/gcc/testsuite/go.test/test/fixedbugs/bug101.go index 92487deaac6..82e496a8a6a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug101.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug101.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug102.go b/gcc/testsuite/go.test/test/fixedbugs/bug102.go index 1d97eb4a8d3..f1c2324b783 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug102.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug102.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not crash +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug103.go b/gcc/testsuite/go.test/test/fixedbugs/bug103.go index b789be1c457..1cb710e3688 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug103.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug103.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug104.go b/gcc/testsuite/go.test/test/fixedbugs/bug104.go index dd4bb5834fe..f0c19a8aa75 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug104.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug104.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug106.go b/gcc/testsuite/go.test/test/fixedbugs/bug106.go index 1874b204491..3b99da84d4b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug106.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug106.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go || echo BUG: failed to compile +// compiledir // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug107.go b/gcc/testsuite/go.test/test/fixedbugs/bug107.go index 0554bbc8b85..dcd8e9d1138 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug107.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug107.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug108.go b/gcc/testsuite/go.test/test/fixedbugs/bug108.go index 10e406de6ea..9f2a27ebd97 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug108.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug108.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug109.go b/gcc/testsuite/go.test/test/fixedbugs/bug109.go index 7666577230f..556dc34dde7 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug109.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug109.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug109 func f(a float64) float64 { e := 1.0 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug110.go b/gcc/testsuite/go.test/test/fixedbugs/bug110.go index 4e43d1c01b8..5528ba3f16d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug110.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug110.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A || echo BUG: const bug +// build // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug111.go b/gcc/testsuite/go.test/test/fixedbugs/bug111.go index e72b343ae3d..d977bd54fb1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug111.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug111.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug112.go b/gcc/testsuite/go.test/test/fixedbugs/bug112.go index 3c932843c7d..e2ed5c0d41e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug112.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug112.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug113.go b/gcc/testsuite/go.test/test/fixedbugs/bug113.go index 4ca07dc65a7..a1e61cb36fd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug113.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug113.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug114.go b/gcc/testsuite/go.test/test/fixedbugs/bug114.go index 974b7cf26e5..99e66a2ddc1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug114.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug114.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && (./$A.out || echo BUG: bug114 failed) +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug115.go b/gcc/testsuite/go.test/test/fixedbugs/bug115.go index 16b22d7079a..7cc3dc40a60 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug115.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug115.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug115 should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug116.go b/gcc/testsuite/go.test/test/fixedbugs/bug116.go index 42ca8034323..5d8e5203150 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug116.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug116.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug116 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug117.go b/gcc/testsuite/go.test/test/fixedbugs/bug117.go index ad89ebf52a9..038826cbce8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug117.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug117.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug118.go b/gcc/testsuite/go.test/test/fixedbugs/bug118.go index 1271f5b0cb2..198b8ff2801 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug118.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug118.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug118 func Send(c chan int) int { select { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug119.go b/gcc/testsuite/go.test/test/fixedbugs/bug119.go index 750507891cc..6f2514c24ec 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug119.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug119.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not fail +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug120.go b/gcc/testsuite/go.test/test/fixedbugs/bug120.go index bf401bf3048..58355e53de9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug120.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug120.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug120 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug121.go b/gcc/testsuite/go.test/test/fixedbugs/bug121.go index 15c8451da93..5adf9827fa1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug121.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug121.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug122.go b/gcc/testsuite/go.test/test/fixedbugs/bug122.go index 72bf38a8331..fb4eb9f3ade 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug122.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug122.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug123.go b/gcc/testsuite/go.test/test/fixedbugs/bug123.go index bdac67417f1..f38551a9142 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug123.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug123.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug126.go b/gcc/testsuite/go.test/test/fixedbugs/bug126.go index a8d56e1221e..f5d97634129 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug126.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug126.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug127.go b/gcc/testsuite/go.test/test/fixedbugs/bug127.go index 25b48114d6f..f8ea99470c3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug127.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug127.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug128.go b/gcc/testsuite/go.test/test/fixedbugs/bug128.go index 3fd647c004d..e8cbea079fe 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug128.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug128.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should compile +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug129.go b/gcc/testsuite/go.test/test/fixedbugs/bug129.go index d1e2d8b5631..157ce78ff72 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug129.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug129.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG129 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug130.go b/gcc/testsuite/go.test/test/fixedbugs/bug130.go index 855c7072bc5..16b029af34f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug130.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug130.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug131.go b/gcc/testsuite/go.test/test/fixedbugs/bug131.go index e5d4ca07d77..0ebbd26069e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug131.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug131.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug132.go b/gcc/testsuite/go.test/test/fixedbugs/bug132.go index bab8996f197..e334566c79b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug132.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug132.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug133.go b/gcc/testsuite/go.test/test/fixedbugs/bug133.go index 2beeb074f57..a6baac26ca3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug133.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug133.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/bug0.go && $G $D/$F.dir/bug1.go && errchk $G $D/$F.dir/bug2.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug135.go b/gcc/testsuite/go.test/test/fixedbugs/bug135.go index 470135ed43b..34d234e2247 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug135.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug135.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug136.go b/gcc/testsuite/go.test/test/fixedbugs/bug136.go index 7491b65d88f..bea9bac0832 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug136.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug136.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug137.go b/gcc/testsuite/go.test/test/fixedbugs/bug137.go index 9d43f431be8..48368177a23 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug137.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug137.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug139.go b/gcc/testsuite/go.test/test/fixedbugs/bug139.go index 2bdbef1c0f0..095e5c93cc3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug139.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug139.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug140.go b/gcc/testsuite/go.test/test/fixedbugs/bug140.go index 441c57a4855..8caf1d7d9f0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug140.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug140.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug141.go b/gcc/testsuite/go.test/test/fixedbugs/bug141.go index 1b125e5d1ee..81ba6f1b561 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug141.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug141.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug142.go b/gcc/testsuite/go.test/test/fixedbugs/bug142.go index e54458baf45..e28d889a93d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug142.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug142.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug142 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug143.go b/gcc/testsuite/go.test/test/fixedbugs/bug143.go index 2f575fcfed1..a43e406676a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug143.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug143.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug144.go b/gcc/testsuite/go.test/test/fixedbugs/bug144.go index bab9a44029d..9f8ec7667cc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug144.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug144.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug145.go b/gcc/testsuite/go.test/test/fixedbugs/bug145.go index c59bcebd6ef..602fe7426df 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug145.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug145.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug146.go b/gcc/testsuite/go.test/test/fixedbugs/bug146.go index 16324c741a4..e29f910ba50 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug146.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug146.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug147.go b/gcc/testsuite/go.test/test/fixedbugs/bug147.go index a16630b8716..e8b3d243949 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug147.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug147.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug147 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug148.go b/gcc/testsuite/go.test/test/fixedbugs/bug148.go index 251020c96f7..b67870b12a6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug148.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug148.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug149.go b/gcc/testsuite/go.test/test/fixedbugs/bug149.go index a40403b7d74..78b687e9718 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug149.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug149.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug150.go b/gcc/testsuite/go.test/test/fixedbugs/bug150.go index fc25444b652..b565ef73dd8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug150.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug150.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: bug150 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug150 type T int func (t T) M() diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug151.go b/gcc/testsuite/go.test/test/fixedbugs/bug151.go index 46546dfe1ea..d9f5e021c97 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug151.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug151.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: bug151 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug151 type S string diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug1515.go b/gcc/testsuite/go.test/test/fixedbugs/bug1515.go index 7402525164f..a4baccda779 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug1515.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug1515.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug152.go b/gcc/testsuite/go.test/test/fixedbugs/bug152.go index 30c3cac91fa..45b9b3d5303 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug152.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug152.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug154.go b/gcc/testsuite/go.test/test/fixedbugs/bug154.go index 4371cc5ce9e..a2cfd4accdb 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug154.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug154.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not panic +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug155.go b/gcc/testsuite/go.test/test/fixedbugs/bug155.go index 312c8e6a963..8872e978daa 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug155.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug155.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A || echo BUG: bug155 +// build // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug156.go b/gcc/testsuite/go.test/test/fixedbugs/bug156.go index 0b77a72d916..f26658729f8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug156.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug156.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug156 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug157.go b/gcc/testsuite/go.test/test/fixedbugs/bug157.go index 9bf68f7a475..1072d7df498 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug157.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug157.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug158.go b/gcc/testsuite/go.test/test/fixedbugs/bug158.go index cdf3195feb3..496d7e0db00 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug158.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug158.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug159.go b/gcc/testsuite/go.test/test/fixedbugs/bug159.go index 1aa64433a70..92d5345635d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug159.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug159.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug159 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug160.go b/gcc/testsuite/go.test/test/fixedbugs/bug160.go index 8fd53ea0795..c5e166a0cf9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug160.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug160.go @@ -1,5 +1,8 @@ // $G $D/bug160.dir/x.go && $G $D/bug160.dir/y.go && $L y.$A && ./$A.out +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug161.go b/gcc/testsuite/go.test/test/fixedbugs/bug161.go index e5f25f746db..aab58ee8953 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug161.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug161.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug163.go b/gcc/testsuite/go.test/test/fixedbugs/bug163.go index 919298e6f74..d69f6bef03a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug163.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug163.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug164.go b/gcc/testsuite/go.test/test/fixedbugs/bug164.go index 746f631aebe..888b495eec3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug164.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug164.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug165.go b/gcc/testsuite/go.test/test/fixedbugs/bug165.go index 8ce67a46db5..f8d50af13fd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug165.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug165.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug167.go b/gcc/testsuite/go.test/test/fixedbugs/bug167.go index 33eb3cb1a95..3a50e6ff0c1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug167.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug167.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A || echo BUG: bug167 +// build // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug168.go b/gcc/testsuite/go.test/test/fixedbugs/bug168.go index e25eb56b0b3..53301fa81ef 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug168.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug168.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug168 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug169.go b/gcc/testsuite/go.test/test/fixedbugs/bug169.go index c42727f3899..f63c2f3e1af 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug169.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug169.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug170.go b/gcc/testsuite/go.test/test/fixedbugs/bug170.go index e7f1c5120dc..11ff5ff3c75 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug170.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug170.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug171.go b/gcc/testsuite/go.test/test/fixedbugs/bug171.go index 5357b2adc60..49bbb3b892d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug171.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug171.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug172.go b/gcc/testsuite/go.test/test/fixedbugs/bug172.go index 1837a1158a6..4dbe7930f90 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug172.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug172.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug173.go b/gcc/testsuite/go.test/test/fixedbugs/bug173.go index 898b8400ba4..6479bb2531b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug173.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug173.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug173 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug174.go b/gcc/testsuite/go.test/test/fixedbugs/bug174.go index 7ff86551326..448f630867c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug174.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug174.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug174 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug175.go b/gcc/testsuite/go.test/test/fixedbugs/bug175.go index 1ca14150765..5fca4b22bc5 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug175.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug175.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug176.go b/gcc/testsuite/go.test/test/fixedbugs/bug176.go index 5820df30842..82f8dba0ad0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug176.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug176.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug177.go b/gcc/testsuite/go.test/test/fixedbugs/bug177.go index a120ad0abf2..9f2c1ea52f0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug177.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug177.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug178.go b/gcc/testsuite/go.test/test/fixedbugs/bug178.go index a7ff09daeed..2bae5a1c564 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug178.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug178.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug179.go b/gcc/testsuite/go.test/test/fixedbugs/bug179.go index 3347613d8db..dea82fe0a06 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug179.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug179.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug180.go b/gcc/testsuite/go.test/test/fixedbugs/bug180.go index 96823fb3a5f..cfdcfab2671 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug180.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug180.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug181.go b/gcc/testsuite/go.test/test/fixedbugs/bug181.go index f87bc9d4ee9..4827e9cf03d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug181.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug181.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug182.go b/gcc/testsuite/go.test/test/fixedbugs/bug182.go index 81df2ca13c6..e02dc59f860 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug182.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug182.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug183.go b/gcc/testsuite/go.test/test/fixedbugs/bug183.go index 7fd6e4942f6..dc9f5356e03 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug183.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug183.go @@ -1,4 +1,4 @@ -//errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug184.go b/gcc/testsuite/go.test/test/fixedbugs/bug184.go index 3cc9845356e..c084ea5cf5e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug184.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug184.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug185.go b/gcc/testsuite/go.test/test/fixedbugs/bug185.go index acae174f4b0..890900600f4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug185.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug185.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug186.go b/gcc/testsuite/go.test/test/fixedbugs/bug186.go index dde794a5d70..5aefd7e5cfd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug186.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug186.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug187.go b/gcc/testsuite/go.test/test/fixedbugs/bug187.go index 66aa5f024b4..5c3c2bb1e17 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug187.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug187.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug188.go b/gcc/testsuite/go.test/test/fixedbugs/bug188.go index e1cbce05dcb..55061478945 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug188.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug188.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug189.go b/gcc/testsuite/go.test/test/fixedbugs/bug189.go index ce338305cd4..9e412c66d86 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug189.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug189.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug190.go b/gcc/testsuite/go.test/test/fixedbugs/bug190.go index da0bfde0fc5..bb2d81cbb9a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug190.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug190.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug191.go b/gcc/testsuite/go.test/test/fixedbugs/bug191.go index 44fcccfc00a..11a6e58e516 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug191.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug191.go @@ -1,5 +1,8 @@ // $G $D/bug191.dir/a.go && $G $D/bug191.dir/b.go && $G $D/$F.go && $L $F.$A +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug192.go b/gcc/testsuite/go.test/test/fixedbugs/bug192.go index 282ed30d361..679aaed1f2d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug192.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug192.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug193.go b/gcc/testsuite/go.test/test/fixedbugs/bug193.go index 5ef02b1c1d7..64e06da8975 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug193.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug193.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug194.go b/gcc/testsuite/go.test/test/fixedbugs/bug194.go index dcd633ddefa..29765290311 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug194.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug194.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug195.go b/gcc/testsuite/go.test/test/fixedbugs/bug195.go index d8e112a3a68..85367cb8882 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug195.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug195.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug196.go b/gcc/testsuite/go.test/test/fixedbugs/bug196.go index ea8ab0dc193..5255de1892e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug196.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug196.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug197.go b/gcc/testsuite/go.test/test/fixedbugs/bug197.go index c205c5bcaac..4a9f103ea00 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug197.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug197.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug198.go b/gcc/testsuite/go.test/test/fixedbugs/bug198.go index ea71fad58e5..73bb64688ae 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug198.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug198.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug199.go b/gcc/testsuite/go.test/test/fixedbugs/bug199.go index 71226290f1f..f69f23b5913 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug199.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug199.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug200.go b/gcc/testsuite/go.test/test/fixedbugs/bug200.go index 63b8633bd9f..da628faf5d0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug200.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug200.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug201.go b/gcc/testsuite/go.test/test/fixedbugs/bug201.go index f7db62fc995..59248231aea 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug201.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug201.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug202.go b/gcc/testsuite/go.test/test/fixedbugs/bug202.go index 2fc91b5208b..49871e3e061 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug202.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug202.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should run +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug203.go b/gcc/testsuite/go.test/test/fixedbugs/bug203.go index bf86ee912ba..2fb084bd658 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug203.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug203.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug204.go b/gcc/testsuite/go.test/test/fixedbugs/bug204.go index adf0aafd6b2..8810a5f921b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug204.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug204.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug205.go b/gcc/testsuite/go.test/test/fixedbugs/bug205.go index e12be72f925..de17cb69841 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug205.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug205.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug206.go b/gcc/testsuite/go.test/test/fixedbugs/bug206.go index 7efc0b14afb..c2382acf13f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug206.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug206.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out >/dev/null 2>&1 || echo BUG: bug206 +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug206.out b/gcc/testsuite/go.test/test/fixedbugs/bug206.out new file mode 100644 index 00000000000..aa47d0d46d4 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug206.out @@ -0,0 +1,2 @@ +0 +0 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug207.go b/gcc/testsuite/go.test/test/fixedbugs/bug207.go index 5810d669011..50923df1c23 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug207.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug207.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug208.go b/gcc/testsuite/go.test/test/fixedbugs/bug208.go index 13b0400848d..09ec0afbedf 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug208.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug208.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug209.go b/gcc/testsuite/go.test/test/fixedbugs/bug209.go index ae6f10f6038..52faf1fb925 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug209.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug209.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug211.go b/gcc/testsuite/go.test/test/fixedbugs/bug211.go index 69aeeeeac55..b1504792763 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug211.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug211.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug212.go b/gcc/testsuite/go.test/test/fixedbugs/bug212.go index 51df9b8ae86..4e58b91ec05 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug212.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug212.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug213.go b/gcc/testsuite/go.test/test/fixedbugs/bug213.go index 4d81dbb4de4..7f4786b52bf 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug213.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug213.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug214.go b/gcc/testsuite/go.test/test/fixedbugs/bug214.go index 502e69826a8..5420058c46d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug214.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug214.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug214 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug215.go b/gcc/testsuite/go.test/test/fixedbugs/bug215.go index 8f7fb2d3c2d..08ed662c65d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug215.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug215.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug216.go b/gcc/testsuite/go.test/test/fixedbugs/bug216.go index 76f85464af8..c83a522bf91 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug216.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug216.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug216 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug217.go b/gcc/testsuite/go.test/test/fixedbugs/bug217.go index 98334c4ce1f..ec93c25d917 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug217.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug217.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug218.go b/gcc/testsuite/go.test/test/fixedbugs/bug218.go index b2c9ede7502..0e008db17f2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug218.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug218.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug218 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug219.go b/gcc/testsuite/go.test/test/fixedbugs/bug219.go index 966d3fcf31a..290c691eabe 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug219.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug219.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: bug219 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug219 func f(func()) int { return 0 } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug221.go b/gcc/testsuite/go.test/test/fixedbugs/bug221.go index b64583114f4..86fda203516 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug221.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug221.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug.go b/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug.go index 9194927b57f..16920246e00 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug.go @@ -1,3 +1,7 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package chanbug var C chan<- (chan int) var D chan<- func() diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug2.go b/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug2.go index 73e16678e9f..109581dc303 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug2.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug222.dir/chanbug2.go @@ -1,2 +1,6 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package Bar import _ "chanbug" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug222.go b/gcc/testsuite/go.test/test/fixedbugs/bug222.go index 5c23a533d19..3b99da84d4b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug222.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug222.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/chanbug.go && $G -I. $D/$F.dir/chanbug2.go +// compiledir // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug223.go b/gcc/testsuite/go.test/test/fixedbugs/bug223.go index 80f9cae8199..29ae53cb713 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug223.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug223.go @@ -1,4 +1,4 @@ -// (! $G $D/$F.go) | grep 'initialization loop' >/dev/null || echo BUG: bug223 +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -18,4 +18,4 @@ func f() { } } -var m = map[string]F{"f": f} +var m = map[string]F{"f": f} // ERROR "initialization loop|depends upon itself" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug224.go b/gcc/testsuite/go.test/test/fixedbugs/bug224.go index 11ee57ecfa2..d2fd67cf32f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug224.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug224.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug225.go b/gcc/testsuite/go.test/test/fixedbugs/bug225.go index 8acf66c4e47..1bda9ab4b6e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug225.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug225.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug227.go b/gcc/testsuite/go.test/test/fixedbugs/bug227.go index a60866044d1..ea8d02d10c6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug227.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug227.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug228.go b/gcc/testsuite/go.test/test/fixedbugs/bug228.go index da335dbc05a..3d23609dde4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug228.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug228.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug229.go b/gcc/testsuite/go.test/test/fixedbugs/bug229.go index a70a926da10..19776881d17 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug229.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug229.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug230.go b/gcc/testsuite/go.test/test/fixedbugs/bug230.go index c7ad1a3660c..210acc43075 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug230.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug230.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug231.go b/gcc/testsuite/go.test/test/fixedbugs/bug231.go index 9500e582bbe..a9d409b7d5a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug231.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug231.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug232.go b/gcc/testsuite/go.test/test/fixedbugs/bug232.go index 99bd02ff699..d18727e9071 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug232.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug232.go @@ -1,8 +1,8 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug232 type I interface { X(...int) } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug233.go b/gcc/testsuite/go.test/test/fixedbugs/bug233.go index 31bb673ebd6..63f8ee2e9e6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug233.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug233.go @@ -1,10 +1,10 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug233 import p "fmt" var _ = p.Print var fmt = 10 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug234.go b/gcc/testsuite/go.test/test/fixedbugs/bug234.go index 562109a058b..9f503f04a0b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug234.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug234.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug235.go b/gcc/testsuite/go.test/test/fixedbugs/bug235.go index 8cecd9d047d..d12d9e7368a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug235.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug235.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -6,7 +6,7 @@ // used to crash the compiler -package main +package bug235 type T struct { x [4]byte diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug236.go b/gcc/testsuite/go.test/test/fixedbugs/bug236.go index 895f82a2320..6c245565f29 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug236.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug236.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug237.go b/gcc/testsuite/go.test/test/fixedbugs/bug237.go index 55cc86acea1..58996cadc0b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug237.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug237.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug238.go b/gcc/testsuite/go.test/test/fixedbugs/bug238.go index 4d5a905f054..cc47189e168 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug238.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug238.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug239.go b/gcc/testsuite/go.test/test/fixedbugs/bug239.go index 32c3d7e1c1d..e4902527db3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug239.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug239.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug239 +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug240.go b/gcc/testsuite/go.test/test/fixedbugs/bug240.go index 6cba9c8b1e5..478b5b2eafe 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug240.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug240.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug241.go b/gcc/testsuite/go.test/test/fixedbugs/bug241.go index 172b3742e54..1f4440147b9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug241.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug241.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug242.go b/gcc/testsuite/go.test/test/fixedbugs/bug242.go index d80ae76a215..4791ae485f6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug242.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug242.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: tuple evaluation order +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug243.go b/gcc/testsuite/go.test/test/fixedbugs/bug243.go index e3ddf0e7745..4870c3614cb 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug243.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug243.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug244.go b/gcc/testsuite/go.test/test/fixedbugs/bug244.go index 915c3fcd095..29bf0d58b97 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug244.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug244.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug245.go b/gcc/testsuite/go.test/test/fixedbugs/bug245.go index 6e5a8b344f7..c607a6dc33c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug245.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug245.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug245 +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug246.go b/gcc/testsuite/go.test/test/fixedbugs/bug246.go index 12041eb1d41..e506f8c0dc3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug246.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug246.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug246 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug247.go b/gcc/testsuite/go.test/test/fixedbugs/bug247.go index 2f56b88d473..b6851e1bca0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug247.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug247.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug247 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug0.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug0.go index 7fc7401c5a9..78433f504d3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug0.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug0.go @@ -1,3 +1,7 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package p type T struct { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug1.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug1.go index 7fc7401c5a9..78433f504d3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug1.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug1.go @@ -1,3 +1,7 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package p type T struct { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go index adce3667708..ba547d64a10 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go @@ -1,3 +1,7 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package main import ( diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go index e5a24495577..4a56c5cc81c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go @@ -1,3 +1,7 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package main import ( diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.go index 055bf1fd7e1..98cda35c491 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug248.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.go @@ -5,6 +5,9 @@ // $L bug2.$A && // ./$A.out || echo BUG: failed to compile +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug249.go b/gcc/testsuite/go.test/test/fixedbugs/bug249.go index c85708fd8e8..dc922455e3f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug249.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug249.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug250.go b/gcc/testsuite/go.test/test/fixedbugs/bug250.go index cd28642bfc9..5140f3e29da 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug250.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug250.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG: bug250 +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug250 type I1 interface { m() I2 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug251.go b/gcc/testsuite/go.test/test/fixedbugs/bug251.go index fb7b98a016d..43d9d526fd1 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug251.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug251.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -16,6 +16,6 @@ type I2 interface { } -var i1 I1 = i2 // GC_ERROR "missing m method|need type assertion" +var i1 I1 = i2 var i2 I2 var i2a I2 = i1 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug252.go b/gcc/testsuite/go.test/test/fixedbugs/bug252.go index a2c1dab9d39..6f007fb7714 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug252.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug252.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug253.go b/gcc/testsuite/go.test/test/fixedbugs/bug253.go index bb5b770f51a..f6ab712ef21 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug253.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug253.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug253 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug254.go b/gcc/testsuite/go.test/test/fixedbugs/bug254.go index c0c7f249ede..9b1c81911b2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug254.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug254.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug254 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug255.go b/gcc/testsuite/go.test/test/fixedbugs/bug255.go index 44427cfdb4e..dbd41cc6ab3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug255.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug255.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug256.go b/gcc/testsuite/go.test/test/fixedbugs/bug256.go index 37fa5f5c805..0498a40d548 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug256.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug256.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug257.go b/gcc/testsuite/go.test/test/fixedbugs/bug257.go index 1b32475003a..003f3ff94d4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug257.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug257.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bugxxx +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug258.go b/gcc/testsuite/go.test/test/fixedbugs/bug258.go index 8984df592db..d362e5a6973 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug258.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug258.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug259.go b/gcc/testsuite/go.test/test/fixedbugs/bug259.go index d148fb3a0c0..e4dcaeb2fea 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug259.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug259.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug260.go b/gcc/testsuite/go.test/test/fixedbugs/bug260.go index 91dc89f77a5..6211c4885ac 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug260.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug260.go @@ -1,4 +1,8 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug260 failed +// run + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file // Test that structures pack densely, according to the alignment of the largest field. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug261.go b/gcc/testsuite/go.test/test/fixedbugs/bug261.go index 8c3fda1e715..f7879b04c10 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug261.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug261.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug262.go b/gcc/testsuite/go.test/test/fixedbugs/bug262.go index ebca7905f9a..6cf248a1811 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug262.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug262.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug263.go b/gcc/testsuite/go.test/test/fixedbugs/bug263.go index cab986ad593..f1cf9010d1c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug263.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug263.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug264.go b/gcc/testsuite/go.test/test/fixedbugs/bug264.go index 6d86c6fe5bd..fcf373cce98 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug264.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug264.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug265.go b/gcc/testsuite/go.test/test/fixedbugs/bug265.go index 55f32ececc3..7f06fced604 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug265.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug265.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug266.go b/gcc/testsuite/go.test/test/fixedbugs/bug266.go index 25c246f7df8..d4da891d31e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug266.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug266.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug266 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug267.go b/gcc/testsuite/go.test/test/fixedbugs/bug267.go index 9646142f2a0..cf8bf841f8b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug267.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug267.go @@ -1,10 +1,10 @@ -// $G $D/$F.go || echo BUG +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +package bug267 type T []int diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug269.go b/gcc/testsuite/go.test/test/fixedbugs/bug269.go index 4cc0408c373..c13eb26ce4a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug269.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug269.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug271.go b/gcc/testsuite/go.test/test/fixedbugs/bug271.go index ba93d93ed2a..88add7040ac 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug271.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug271.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug272.go b/gcc/testsuite/go.test/test/fixedbugs/bug272.go index 3b7c466748e..c27f7ee446e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug272.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug272.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug273.go b/gcc/testsuite/go.test/test/fixedbugs/bug273.go index dd5aaa7b8af..c5e73e945c9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug273.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug273.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -8,14 +8,14 @@ package main -import "unsafe" - var bug = false var minus1 = -1 var big int64 = 10 | 1<<32 -var g1 []int +type block [1<<19]byte + +var g1 []block func shouldfail(f func(), desc string) { defer func() { recover() }() @@ -28,55 +28,47 @@ func shouldfail(f func(), desc string) { } func badlen() { - g1 = make([]int, minus1) + g1 = make([]block, minus1) } func biglen() { - g1 = make([]int, big) + g1 = make([]block, big) } func badcap() { - g1 = make([]int, 10, minus1) + g1 = make([]block, 10, minus1) } func badcap1() { - g1 = make([]int, 10, 5) + g1 = make([]block, 10, 5) } func bigcap() { - g1 = make([]int, 10, big) + g1 = make([]block, 10, big) } -var g3 map[int]int +var g3 map[block]block func badmapcap() { - g3 = make(map[int]int, minus1) + g3 = make(map[block]block, minus1) } func bigmapcap() { - g3 = make(map[int]int, big) + g3 = make(map[block]block, big) } -var g4 chan int +type cblock [1<<16-1]byte + +var g4 chan cblock func badchancap() { - g4 = make(chan int, minus1) + g4 = make(chan cblock, minus1) } func bigchancap() { - g4 = make(chan int, big) + g4 = make(chan cblock, big) } -const addrBits = unsafe.Sizeof((*byte)(nil)) - -var g5 chan [1<<15]byte func overflowchan() { - if addrBits == 32 { - g5 = make(chan [1<<15]byte, 1<<20) - } else { - // cannot overflow on 64-bit, because - // int is 32 bits and max chan value size - // in the implementation is 64 kB. - panic(1) - } + g4 = make(chan cblock, 1<<30) } func main() { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug274.go b/gcc/testsuite/go.test/test/fixedbugs/bug274.go index 198544c3f54..beb2d61acc8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug274.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug274.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug275.go b/gcc/testsuite/go.test/test/fixedbugs/bug275.go index 2bbc807c599..f5f6b14f010 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug275.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug275.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug276.go b/gcc/testsuite/go.test/test/fixedbugs/bug276.go index 844a6b2382c..dc2308ea6b9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug276.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug276.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG code should run +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug277.go b/gcc/testsuite/go.test/test/fixedbugs/bug277.go index 22b2908c985..207556493e8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug277.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug277.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG should compile +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug278.go b/gcc/testsuite/go.test/test/fixedbugs/bug278.go index 3699b9a141d..68a3d811c74 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug278.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug278.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug279.go b/gcc/testsuite/go.test/test/fixedbugs/bug279.go index af8e056d97f..e5ec5943c0d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug279.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug279.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug280.go b/gcc/testsuite/go.test/test/fixedbugs/bug280.go index 869d446268c..ba594a2c482 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug280.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug280.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug281.go b/gcc/testsuite/go.test/test/fixedbugs/bug281.go index 821b0282550..24d6fdce8ce 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug281.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug281.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug282.go b/gcc/testsuite/go.test/test/fixedbugs/bug282.go index 463f21e941a..3b99da84d4b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug282.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug282.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/p1.go && $G $D/$F.dir/p2.go +// compiledir // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug283.go b/gcc/testsuite/go.test/test/fixedbugs/bug283.go index 45ee9082f0c..eefed0334b0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug283.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug283.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,7 +7,7 @@ // http://code.google.com/p/go/issues/detail?id=806 // triggered out of registers on 8g -package main +package bug283 type Point struct { x int diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug284.go b/gcc/testsuite/go.test/test/fixedbugs/bug284.go index bcf161e3de4..68208085fa8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug284.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug284.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug285.go b/gcc/testsuite/go.test/test/fixedbugs/bug285.go index 7eed8fb7abc..0a8a0f09e60 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug285.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug285.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug285 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug286.go b/gcc/testsuite/go.test/test/fixedbugs/bug286.go index eb678385610..44f05153f48 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug286.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug286.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug286 failed +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug287.go b/gcc/testsuite/go.test/test/fixedbugs/bug287.go index a4a08eedc42..2ed81c593df 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug287.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug287.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug288.go b/gcc/testsuite/go.test/test/fixedbugs/bug288.go index 0105159d138..d2461e6a9f3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug288.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug288.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug289.go b/gcc/testsuite/go.test/test/fixedbugs/bug289.go index f7180ff04c1..3c6b68767a6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug289.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug289.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug290.go b/gcc/testsuite/go.test/test/fixedbugs/bug290.go index 80437c7f856..c8ff0bc45d0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug290.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug290.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug291.go b/gcc/testsuite/go.test/test/fixedbugs/bug291.go index 09334c92112..17a5483ef54 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug291.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug291.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug292.go b/gcc/testsuite/go.test/test/fixedbugs/bug292.go index 05852cd46dd..07051dd3fbe 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug292.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug292.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug293.go b/gcc/testsuite/go.test/test/fixedbugs/bug293.go index ca9b71a3acd..bf926f5a4dd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug293.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug293.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug294.go b/gcc/testsuite/go.test/test/fixedbugs/bug294.go index 18f45931c4b..0f3e38098c5 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug294.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug294.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug295.go b/gcc/testsuite/go.test/test/fixedbugs/bug295.go index fec2351f31b..e2e5206ca14 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug295.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug295.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug296.go b/gcc/testsuite/go.test/test/fixedbugs/bug296.go index 46d8dbcfe4b..a7c4e0c464e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug296.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug296.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug297.go b/gcc/testsuite/go.test/test/fixedbugs/bug297.go index 8767cdfea54..b5dfa8d878e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug297.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug297.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug298.go b/gcc/testsuite/go.test/test/fixedbugs/bug298.go index c16c3f98af1..bd362ace2d0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug298.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug298.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug299.go b/gcc/testsuite/go.test/test/fixedbugs/bug299.go index 1c7adb5f5b8..9646723bfda 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug299.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug299.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug300.go b/gcc/testsuite/go.test/test/fixedbugs/bug300.go index 09ee3ab697f..1ef43a0ad0b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug300.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug300.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug301.go b/gcc/testsuite/go.test/test/fixedbugs/bug301.go index a58f4e13b14..572668f1911 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug301.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug301.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug301.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug302.go b/gcc/testsuite/go.test/test/fixedbugs/bug302.go index e9edb94ac80..dc7637fe52e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug302.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug302.go @@ -1,4 +1,7 @@ -// $G $D/bug302.dir/p.go && gopack grc pp.a p.$A && $G $D/bug302.dir/main.go +// $G $D/bug302.dir/p.go && pack grc pp.a p.$A && $G $D/bug302.dir/main.go + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug303.go b/gcc/testsuite/go.test/test/fixedbugs/bug303.go index 3bd790f136d..94ca07e702f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug303.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug303.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug304.go b/gcc/testsuite/go.test/test/fixedbugs/bug304.go index adcf08a3557..ad71b20f385 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug304.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug304.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug305.go b/gcc/testsuite/go.test/test/fixedbugs/bug305.go index 758fee2698a..d0a4b24b877 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug305.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug305.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug306.go b/gcc/testsuite/go.test/test/fixedbugs/bug306.go index a0a43507dcb..e8967c25ddc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug306.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug306.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/p1.go && $G $D/$F.dir/p2.go +// compiledir // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug307.go b/gcc/testsuite/go.test/test/fixedbugs/bug307.go index 1b42c09ab1e..64451252971 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug307.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug307.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug308.go b/gcc/testsuite/go.test/test/fixedbugs/bug308.go index c2845f04213..5bea5175b17 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug308.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug308.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug309.go b/gcc/testsuite/go.test/test/fixedbugs/bug309.go index d893916cd96..948ca5c796d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug309.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug309.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -6,7 +6,7 @@ // issue 1016 -package main +package bug309 func foo(t interface{}, c chan int) { switch v := t.(type) { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug311.go b/gcc/testsuite/go.test/test/fixedbugs/bug311.go index ed937a67470..edcd9759635 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug311.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug311.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug312.go b/gcc/testsuite/go.test/test/fixedbugs/bug312.go index 70888dd410f..c7c17e10118 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug312.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug312.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug313.go b/gcc/testsuite/go.test/test/fixedbugs/bug313.go index eb2a0223b6c..9009c5e8ffc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug313.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug313.go @@ -1,5 +1,8 @@ // errchk $G -e $D/$F.dir/[ab].go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug314.go b/gcc/testsuite/go.test/test/fixedbugs/bug314.go index 95d81d7951e..6e26d14e1f5 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug314.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug314.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug314 +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug315.go b/gcc/testsuite/go.test/test/fixedbugs/bug315.go index c59ef29e6c0..7b8a9e57012 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug315.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug315.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug315 +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug316.go b/gcc/testsuite/go.test/test/fixedbugs/bug316.go index 2146408a1e2..e1374122d46 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug316.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug316.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug316 +// compile // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug317.go b/gcc/testsuite/go.test/test/fixedbugs/bug317.go index 0cb26c29ba1..3ff4dc4657e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug317.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug317.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug317 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug318.go b/gcc/testsuite/go.test/test/fixedbugs/bug318.go index 9c46a04269c..93de2d84710 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug318.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug318.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug319.go b/gcc/testsuite/go.test/test/fixedbugs/bug319.go index f60eee4fb23..f8e959a3185 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug319.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug319.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug320.go b/gcc/testsuite/go.test/test/fixedbugs/bug320.go index 06d41f2ed87..c2dd31b8131 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug320.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug320.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug321.go b/gcc/testsuite/go.test/test/fixedbugs/bug321.go index d0595ff59b6..7d018271fc3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug321.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug321.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug321 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug322.go b/gcc/testsuite/go.test/test/fixedbugs/bug322.go index ad0e62dc8c9..401a8600a9e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug322.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug322.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/lib.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: fails incorrectly +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug323.go b/gcc/testsuite/go.test/test/fixedbugs/bug323.go index 23e2be6603a..9730ae5c8c6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug323.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug323.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug324.go b/gcc/testsuite/go.test/test/fixedbugs/bug324.go index 3da75630acf..ee090ae42f4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug324.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug324.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug325.go b/gcc/testsuite/go.test/test/fixedbugs/bug325.go index b86740fff93..6ccd0e3c820 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug325.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug325.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug326.go b/gcc/testsuite/go.test/test/fixedbugs/bug326.go index 7e123e3a39b..57f6471dc8e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug326.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug326.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug327.go b/gcc/testsuite/go.test/test/fixedbugs/bug327.go index 4ba5f6072e8..0598d95d682 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug327.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug327.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug328.go b/gcc/testsuite/go.test/test/fixedbugs/bug328.go index 825298371f9..73ab46d4591 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug328.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug328.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug329.go b/gcc/testsuite/go.test/test/fixedbugs/bug329.go index 0b7074d62ba..74fc78198b3 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug329.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug329.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug330.go b/gcc/testsuite/go.test/test/fixedbugs/bug330.go index 114492aff80..ef6a0777fee 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug330.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug330.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug331.go b/gcc/testsuite/go.test/test/fixedbugs/bug331.go index 6c5acd1f4d9..fac0e362894 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug331.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug331.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug331 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug332.go b/gcc/testsuite/go.test/test/fixedbugs/bug332.go index be79286b819..702779ba675 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug332.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug332.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug333.go b/gcc/testsuite/go.test/test/fixedbugs/bug333.go index 515c1f3fabd..bb690f0e5b6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug333.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug333.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug334.go b/gcc/testsuite/go.test/test/fixedbugs/bug334.go index 870c9ae24fb..bd671696ba6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug334.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug334.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug334 +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go index 5a8112a9de3..256c110d703 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/a.go @@ -4,6 +4,8 @@ package a -import "./b" +type T interface{} -var Bar = b.Foo +func f() T { return nil } + +var Foo T = f() diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go index 7428c2a918a..1474470d4ce 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.dir/b.go @@ -4,8 +4,6 @@ package b -type T interface{} +import "./a" -func f() T { return nil } - -var Foo T = f() +var Bar = a.Foo diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug335.go b/gcc/testsuite/go.test/test/fixedbugs/bug335.go index 915b746578c..37c97d7b5e2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug335.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug335.go @@ -1,5 +1,4 @@ -// $G $D/$F.dir/b.go && $G $D/$F.dir/a.go -// rm -f a.$A b.$A +// compiledir // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,4 +6,4 @@ // Issue 1705. -unused (see script at top of file) +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug336.go b/gcc/testsuite/go.test/test/fixedbugs/bug336.go index 8de36898f8c..fbf23207c2e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug336.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug336.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug337.go b/gcc/testsuite/go.test/test/fixedbugs/bug337.go index ca9b4b45369..38dc665fa68 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug337.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug337.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug338.go b/gcc/testsuite/go.test/test/fixedbugs/bug338.go index c368a7fadc5..c2193fcc253 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug338.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug338.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug339.go b/gcc/testsuite/go.test/test/fixedbugs/bug339.go index eac7c5ee623..59921d41cab 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug339.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug339.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug340.go b/gcc/testsuite/go.test/test/fixedbugs/bug340.go index 34cc013151f..d996ab64cd4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug340.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug340.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug341.go b/gcc/testsuite/go.test/test/fixedbugs/bug341.go index 8ee52e1ef05..db1af3eaa38 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug341.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug341.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug341 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug342.go b/gcc/testsuite/go.test/test/fixedbugs/bug342.go index 0852cdd3483..5f1efbdfe1e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug342.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug342.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug343.go b/gcc/testsuite/go.test/test/fixedbugs/bug343.go index efc87e3d7a5..82201088b28 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug343.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug343.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug343 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug344.go b/gcc/testsuite/go.test/test/fixedbugs/bug344.go index ce953f7f2f7..4a92624c769 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug344.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug344.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug345.go b/gcc/testsuite/go.test/test/fixedbugs/bug345.go index 874710ce88a..e3705f6c183 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug345.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug345.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/io.go && errchk $G -e $D/$F.dir/main.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug346.go b/gcc/testsuite/go.test/test/fixedbugs/bug346.go index 31284c31a1d..d9203aa4353 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug346.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug346.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: issue2056 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug347.go b/gcc/testsuite/go.test/test/fixedbugs/bug347.go index 5532cee8310..08edf0f4ffb 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug347.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug347.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug348.go b/gcc/testsuite/go.test/test/fixedbugs/bug348.go index 1a539aa3e47..54a289a8de6 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug348.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug348.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug349.go b/gcc/testsuite/go.test/test/fixedbugs/bug349.go index e7612edb77e..a3e6bd1619a 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug349.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug349.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug350.go b/gcc/testsuite/go.test/test/fixedbugs/bug350.go index f8df3f58b96..5ce8996ffaa 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug350.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug350.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug351.go b/gcc/testsuite/go.test/test/fixedbugs/bug351.go index 9625c6a501c..4c5c7c32782 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug351.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug351.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug352.go b/gcc/testsuite/go.test/test/fixedbugs/bug352.go index 62fd006c423..1ae2d6139b7 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug352.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug352.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug352 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug353.go b/gcc/testsuite/go.test/test/fixedbugs/bug353.go index b59d97f3384..2a532c49115 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug353.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug353.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug354.go b/gcc/testsuite/go.test/test/fixedbugs/bug354.go index a95256e272e..1245d91f5fd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug354.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug354.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug354 +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,7 +7,7 @@ // issue 2086 // was calling makeclosure twice on the closure -package main +package bug354 type Inner struct { F func() error diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug355.go b/gcc/testsuite/go.test/test/fixedbugs/bug355.go index a9cf0161b0d..fcf859b7fcc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug355.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug355.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug356.go b/gcc/testsuite/go.test/test/fixedbugs/bug356.go index d21f0cfac61..273c5b8efc9 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug356.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug356.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug344 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug357.go b/gcc/testsuite/go.test/test/fixedbugs/bug357.go index 448d9826370..2ac64a80b64 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug357.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug357.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug358.go b/gcc/testsuite/go.test/test/fixedbugs/bug358.go index 82fbf7f8150..6a008484f4f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug358.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug358.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug361.go b/gcc/testsuite/go.test/test/fixedbugs/bug361.go index d2a64bcef47..3e3b7c18187 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug361.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug361.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug360 +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug362.go b/gcc/testsuite/go.test/test/fixedbugs/bug362.go index f38572c0d0f..b888ccb4487 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug362.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug362.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug363.go b/gcc/testsuite/go.test/test/fixedbugs/bug363.go index 9347ec28b62..615c66865cb 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug363.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug363.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug364.go b/gcc/testsuite/go.test/test/fixedbugs/bug364.go index a93312107e3..64120d1643c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug364.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug364.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug365.go b/gcc/testsuite/go.test/test/fixedbugs/bug365.go index bc8c2c5e62c..795323bb3d2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug365.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug365.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug366.go b/gcc/testsuite/go.test/test/fixedbugs/bug366.go index 8c000f50a93..33a1a5a7ebf 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug366.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug366.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/main.go index 21e9a5002c9..c278e4dd95f 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/main.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/main.go @@ -1,3 +1,7 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package main import ( diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/p.go b/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/p.go index c8772d2d051..2028f740ccd 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/p.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug367.dir/p.go @@ -1,3 +1,7 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package p type T struct{ x int } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug367.go b/gcc/testsuite/go.test/test/fixedbugs/bug367.go index 25d11a15318..bf8edcd1b85 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug367.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug367.go @@ -1,5 +1,8 @@ // $G $D/$F.dir/p.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out || echo BUG: should not fail +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug368.go b/gcc/testsuite/go.test/test/fixedbugs/bug368.go index 8d94f531c9b..c38cc7fad79 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug368.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug368.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug369.go b/gcc/testsuite/go.test/test/fixedbugs/bug369.go index 8eb23eecf16..2ee8568e044 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug369.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug369.go @@ -1,6 +1,9 @@ // $G -N -o slow.$A $D/bug369.dir/pkg.go && // $G -o fast.$A $D/bug369.dir/pkg.go && -// $G $D/$F.go && $L $F.$A && ./$A.out +// run + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug370.go b/gcc/testsuite/go.test/test/fixedbugs/bug370.go index 9cb45f6e0de..246bc7c4e5b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug370.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug370.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug371.go b/gcc/testsuite/go.test/test/fixedbugs/bug371.go index bf993df0680..6329e9635a2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug371.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug371.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug372.go b/gcc/testsuite/go.test/test/fixedbugs/bug372.go index a6f7208bbd5..34578565afa 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug372.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug372.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug372 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug373.go b/gcc/testsuite/go.test/test/fixedbugs/bug373.go index 934a6c7328c..e91f26d6ed0 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug373.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug373.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug374.go b/gcc/testsuite/go.test/test/fixedbugs/bug374.go index b55c5df4567..4f0b721f24b 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug374.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug374.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug375.go b/gcc/testsuite/go.test/test/fixedbugs/bug375.go index 52735852637..cb159b0d6be 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug375.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug375.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug375 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug376.go b/gcc/testsuite/go.test/test/fixedbugs/bug376.go index 1efbeecf21c..5fbbc9cd444 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug376.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug376.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/one.go index c9060756b1a..e29b813a481 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/one.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/one.go @@ -1,3 +1,7 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package one func Foo() (n int64, _ *int) { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/two.go index 8a5346ab72b..2a10812d56d 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/two.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug377.dir/two.go @@ -1,3 +1,7 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + package two import _ "./one" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug377.go b/gcc/testsuite/go.test/test/fixedbugs/bug377.go index e905e34d683..22df005b2a2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug377.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug377.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go +// compiledir // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug378.go b/gcc/testsuite/go.test/test/fixedbugs/bug378.go index b393b3dc1e9..f3346c648dc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug378.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug378.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug378 +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug379.go b/gcc/testsuite/go.test/test/fixedbugs/bug379.go index 3dd3d2983bd..81e9c266ee4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug379.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug379.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug380.go b/gcc/testsuite/go.test/test/fixedbugs/bug380.go index 75b58064f5d..96e1edecac8 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug380.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug380.go @@ -1,4 +1,4 @@ -// $G $D/$F.go +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug381.go b/gcc/testsuite/go.test/test/fixedbugs/bug381.go index 3f3232bf12f..0253e1446bc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug381.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug381.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,14 +7,25 @@ // Issue 2276. // Check that the error messages says -// bug378.go:19: unsafe.Alignof(0) not used +// bug381.go:29: unsafe.Alignof(0) not used // and not -// bug378.go:19: 4 not used +// bug381.go:29: 4 not used + +// Issue 2768: previously got +// bug381.go:30: cannot use 3 (type time.Weekday) as type int in function argument +// want +// bug381.go:30: cannot use time.Wednesday (type time.Weekday) as type int in function argument package main -import "unsafe" +import ( + "time" + "unsafe" +) + +func f(int) func main() { unsafe.Alignof(0) // ERROR "unsafe\.Alignof|value computed is not used" + f(time.Wednesday) // ERROR "time.Wednesday|incompatible type" } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug382.go b/gcc/testsuite/go.test/test/fixedbugs/bug382.go index 6212fbf507c..10c71d46624 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug382.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug382.go @@ -1,5 +1,12 @@ // $G $D/$F.dir/pkg.go && $G $D/$F.go || echo "Bug 382" +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file + // Issue 2529 package main diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug383.go b/gcc/testsuite/go.test/test/fixedbugs/bug383.go index 181a897b63d..503779c3772 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug383.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug383.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug384.go b/gcc/testsuite/go.test/test/fixedbugs/bug384.go index b3d64668829..0233c197c4e 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug384.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug384.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug385_32.go b/gcc/testsuite/go.test/test/fixedbugs/bug385_32.go index a009f664e09..5ac4136e7dc 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug385_32.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug385_32.go @@ -1,4 +1,7 @@ -// [ $O == 6 ] || errchk $G -e $D/$F.go +// [ $A == 6 ] || errchk $G -e $D/$F.go + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go b/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go index 701be0d09ac..8c7b9d52081 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug385_64.go @@ -1,4 +1,7 @@ -// [ $O != 6 ] || errchk $G -e $D/$F.go +// [ $A != 6 ] || errchk $G -e $D/$F.go + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -8,7 +11,7 @@ package main func main() { // ERROR "stack frame too large" - var arr [1000200030]int + var arr [1000200030]int32 arr_bkup := arr _ = arr_bkup } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug386.go b/gcc/testsuite/go.test/test/fixedbugs/bug386.go index b42c07073b0..ec358bd36e4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug386.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug386.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug387.go b/gcc/testsuite/go.test/test/fixedbugs/bug387.go index c9db4aea89f..59d5ef90384 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug387.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug387.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo "Bug387" +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug388.go b/gcc/testsuite/go.test/test/fixedbugs/bug388.go index c17fd7ca23a..d41f9ea543c 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug388.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug388.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug389.go b/gcc/testsuite/go.test/test/fixedbugs/bug389.go index ecbbbdd585e..55a02e05c07 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug389.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug389.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug390.go b/gcc/testsuite/go.test/test/fixedbugs/bug390.go index 31c4dd40bab..7ce9e137035 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug390.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug390.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug391.go b/gcc/testsuite/go.test/test/fixedbugs/bug391.go index 81507188b23..07d129ddc48 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug391.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug391.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo "Issue2576" +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/one.go index a7017255e5a..8242f284620 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/one.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/one.go @@ -20,3 +20,24 @@ func F3() (ret []int) { return append(ret, 1) } // Call of inlined method with blank receiver. func (_ *T) M() int { return 1 } func (t *T) MM() int { return t.M() } + + +// One more like issue 2678 +type S struct { x, y int } +type U []S + +func F4(S int) U { return U{{S,S}} } + +func F5() []*S { + return []*S{ {1,2}, { 3, 4} } +} + +func F6(S int) *U { + return &U{{S,S}} +} + +// Bug in the fix. + +type PB struct { x int } + +func (t *PB) Reset() { *t = PB{} } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg2.go similarity index 83% rename from gcc/testsuite/go.test/test/fixedbugs/bug392.dir/two.go rename to gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg2.go index b0ce26d39ab..8320b2fffa2 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/two.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg2.go @@ -5,7 +5,7 @@ // Use the functions in one.go so that the inlined // forms get type-checked. -package two +package pkg2 import "./one" @@ -13,8 +13,13 @@ func use() { one.F1(nil) one.F2(nil) one.F3() + one.F4(1) var t *one.T t.M() t.MM() } + +var V = []one.PB{{}, {}} + +func F() *one.PB diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go new file mode 100644 index 00000000000..402c3b083fd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug392.dir/pkg3.go @@ -0,0 +1,13 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Use the functions in pkg2.go so that the inlined +// forms get type-checked. + +package pkg3 + +import "./pkg2" + +var x = pkg2.F() +var v = pkg2.V diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug392.go b/gcc/testsuite/go.test/test/fixedbugs/bug392.go index 50af6006fbe..48b79e01b89 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug392.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug392.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go +// compiledir // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug393.go b/gcc/testsuite/go.test/test/fixedbugs/bug393.go index e21b9c4a416..f8a9c657819 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug393.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug393.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: bug393 +// compile // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -7,7 +7,7 @@ // issue 2672 // was trying binary search with an interface type -package main +package bug393 func f(x interface{}) int { switch x { diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug394.go b/gcc/testsuite/go.test/test/fixedbugs/bug394.go index 42c20e7a918..2d77156c1ae 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug394.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug394.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug396.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug396.dir/one.go index 7902a07d535..96a1dd7dc26 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug396.dir/one.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug396.dir/one.go @@ -4,6 +4,7 @@ package one +// Issue 2687 type T struct { int } func New(i int) T { return T{i} } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug396.go b/gcc/testsuite/go.test/test/fixedbugs/bug396.go index 50af6006fbe..48b79e01b89 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug396.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug396.go @@ -1,4 +1,4 @@ -// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go +// compiledir // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug397.go b/gcc/testsuite/go.test/test/fixedbugs/bug397.go index 03957013023..56cc7cdd4d4 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug397.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug397.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug398.go b/gcc/testsuite/go.test/test/fixedbugs/bug398.go new file mode 100644 index 00000000000..1dd3fa4213a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug398.go @@ -0,0 +1,24 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Used to crash compiler in interface type equality check. + +package p + +type I1 interface { + F() interface{I1} +} + +type I2 interface { + F() interface{I2} +} + +var v1 I1 +var v2 I2 + +func f() bool { + return v1 == v2 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug399.go b/gcc/testsuite/go.test/test/fixedbugs/bug399.go new file mode 100644 index 00000000000..94852c9ee58 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug399.go @@ -0,0 +1,15 @@ +// compile + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 2674 + +package main +const dow = "\000\003" + +func main() { + println(int(dow[1])) +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug401.go b/gcc/testsuite/go.test/test/fixedbugs/bug401.go new file mode 100644 index 00000000000..5589b5b1bb0 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug401.go @@ -0,0 +1,46 @@ +// run + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 2582 +package main + +type T struct{} + +func (T) cplx() complex128 { + for false { + } // avoid inlining + return complex(1, 0) +} + +func (T) cplx2() complex128 { + return complex(0, 1) +} + +type I interface { + cplx() complex128 +} + +func main() { + + var t T + + if v := real(t.cplx()); v != 1 { + panic("not-inlined complex call failed") + } + _ = imag(t.cplx()) + + _ = real(t.cplx2()) + if v := imag(t.cplx2()); v != 1 { + panic("potentially inlined complex call failed") + } + + var i I + i = t + if v := real(i.cplx()); v != 1 { + panic("potentially inlined complex call failed") + } + _ = imag(i.cplx()) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug402.go b/gcc/testsuite/go.test/test/fixedbugs/bug402.go new file mode 100644 index 00000000000..db3f3da448e --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug402.go @@ -0,0 +1,31 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "fmt" + +var a = []int64{ + 0.0005 * 1e9, + 0.001 * 1e9, + 0.005 * 1e9, + 0.01 * 1e9, + 0.05 * 1e9, + 0.1 * 1e9, + 0.5 * 1e9, + 1 * 1e9, + 5 * 1e9, +} + +func main() { + s := "" + for _, v := range a { + s += fmt.Sprint(v) + " " + } + if s != "500000 1000000 5000000 10000000 50000000 100000000 500000000 1000000000 5000000000 " { + panic(s) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug403.go b/gcc/testsuite/go.test/test/fixedbugs/bug403.go new file mode 100644 index 00000000000..ed7b49aea2f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug403.go @@ -0,0 +1,23 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Crashed gccgo. + +package p + +type S struct { + f interface{} +} + +func F(p *S) bool { + v := p.f + switch a := v.(type) { + case nil: + _ = a + return true + } + return true +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go new file mode 100644 index 00000000000..2024eb007cd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/one.go @@ -0,0 +1,19 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package one + +type T1 int +type T2 []T1 +type T3 T2 + +func F1(T2) { +} + +func (p *T1) M1() T3 { + return nil +} + +func (p T3) M2() { +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go new file mode 100644 index 00000000000..162eae7124a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug404.dir/two.go @@ -0,0 +1,12 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The gccgo compiler would fail on the import statement. +// two.go:10:13: error: use of undefined type ‘one.T2’ + +package two + +import "./one" + +var V one.T3 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug404.go b/gcc/testsuite/go.test/test/fixedbugs/bug404.go new file mode 100644 index 00000000000..481acda3284 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug404.go @@ -0,0 +1,7 @@ +// compiledir + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug405.go b/gcc/testsuite/go.test/test/fixedbugs/bug405.go new file mode 100644 index 00000000000..e8ecc4d034a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug405.go @@ -0,0 +1,24 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test using _ receiver. Failed with gccgo. + +package main + +type S struct {} + +func (_ S) F(i int) int { + return i +} + +func main() { + s := S{} + const c = 123 + i := s.F(c) + if i != c { + panic(i) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug406.go b/gcc/testsuite/go.test/test/fixedbugs/bug406.go new file mode 100644 index 00000000000..c6f8534c9ba --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug406.go @@ -0,0 +1,25 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 2821 +package main + +type matrix struct { + e []int +} + +func (a matrix) equal() bool { + for _ = range a.e { + } + return true +} + +func main() { + var a matrix + var i interface{} + i = true && a.equal() + _ = i +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go new file mode 100644 index 00000000000..a91d904333b --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/one.go @@ -0,0 +1,20 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package one + +// Issue 2877 +type T struct { + f func(t *T, arg int) + g func(t T, arg int) +} + +func (t *T) foo(arg int) {} +func (t T) goo(arg int) {} + +func (t *T) F() { t.f = (*T).foo } +func (t *T) G() { t.g = T.goo } + + + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go new file mode 100644 index 00000000000..67e1852ea0e --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug407.dir/two.go @@ -0,0 +1,15 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Use the functions in one.go so that the inlined +// forms get type-checked. + +package two + +import "./one" + +func use() { + var r one.T + r.F() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug407.go b/gcc/testsuite/go.test/test/fixedbugs/bug407.go new file mode 100644 index 00000000000..48b79e01b89 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug407.go @@ -0,0 +1,7 @@ +// compiledir + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug409.go b/gcc/testsuite/go.test/test/fixedbugs/bug409.go new file mode 100644 index 00000000000..1dca43b7ae4 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug409.go @@ -0,0 +1,20 @@ +// cmpout + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Multiple inlined calls to a function that causes +// redundant address loads. + +package main + +func F(v [2]float64) [2]float64 { + return [2]float64{v[0], v[1]} +} + +func main() { + a := F([2]float64{1, 2}) + b := F([2]float64{3, 4}) + println(a[0], a[1], b[0], b[1]) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug409.out b/gcc/testsuite/go.test/test/fixedbugs/bug409.out new file mode 100644 index 00000000000..3cb40ed59a9 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug409.out @@ -0,0 +1 @@ ++1.000000e+000 +2.000000e+000 +3.000000e+000 +4.000000e+000 diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug410.go b/gcc/testsuite/go.test/test/fixedbugs/bug410.go new file mode 100644 index 00000000000..35ecbfc05cb --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug410.go @@ -0,0 +1,24 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Used to run 6g out of registers. Issue 2669. + +package p + +type y struct { + num int +} + +func zzz () { + k := make([]byte, 10) + arr := make ([]*y, 0) + for s := range arr { + x := make([]byte, 10) + for i := 0; i < 100 ; i++ { + x[i] ^= k[i-arr[s].num%0] + } + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug411.go b/gcc/testsuite/go.test/test/fixedbugs/bug411.go new file mode 100644 index 00000000000..3b90db88d61 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug411.go @@ -0,0 +1,19 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 2588. Used to trigger internal compiler error on 8g, +// because the compiler tried to registerize the int64 being +// used as a memory operand of a int64->float64 move. + +package p + +func f1(a int64) { + f2(float64(a), float64(a)) +} + +func f2(a,b float64) { +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug412.go b/gcc/testsuite/go.test/test/fixedbugs/bug412.go new file mode 100644 index 00000000000..8dd0a5fcc15 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug412.go @@ -0,0 +1,16 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +type t struct { + x int // ERROR "duplicate field x|duplicate field name .x." + x int +} + +func f(t *t) int { + return t.x // GC_ERROR "ambiguous selector t.x" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug413.go b/gcc/testsuite/go.test/test/fixedbugs/bug413.go new file mode 100644 index 00000000000..ba80464907b --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug413.go @@ -0,0 +1,11 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +func f(i int) int { return i } + +var i = func() int {a := f(i); return a}() // ERROR "initialization loop|depends upon itself" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go new file mode 100644 index 00000000000..52001233c62 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/main.go @@ -0,0 +1,18 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + package main + + import "./p1" + + type MyObject struct { + p1.Fer + } + + func main() { + var b p1.Fer = &p1.Object{} + p1.PrintFer(b) + var c p1.Fer = &MyObject{b} + p1.PrintFer(c) + } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go new file mode 100644 index 00000000000..7768818bf9f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug414.dir/p1.go @@ -0,0 +1,21 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + package p1 + + import "fmt" + + type Fer interface { + f() string + } + + type Object struct {} + + func (this *Object) f() string { + return "Object.f" + } + + func PrintFer(fer Fer) { + fmt.Sprintln(fer.f()) + } diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug414.go b/gcc/testsuite/go.test/test/fixedbugs/bug414.go new file mode 100644 index 00000000000..5612fd5c233 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug414.go @@ -0,0 +1,10 @@ +// $G $D/$F.dir/p1.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go new file mode 100644 index 00000000000..b4152d63a73 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/p.go @@ -0,0 +1,14 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +type A struct { + s struct{int} +} + +func (a *A) f() { + a.s = struct{int}{0} +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go new file mode 100644 index 00000000000..b894453fc37 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug415.dir/prog.go @@ -0,0 +1,9 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main +import "./p" +func main() {} +var _ p.A + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug415.go b/gcc/testsuite/go.test/test/fixedbugs/bug415.go new file mode 100644 index 00000000000..8cd4c49f24e --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug415.go @@ -0,0 +1,9 @@ +// compiledir + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 2716. Export metadata error made main.go not compile. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug416.go b/gcc/testsuite/go.test/test/fixedbugs/bug416.go new file mode 100644 index 00000000000..1d24fa935da --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug416.go @@ -0,0 +1,13 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +type T struct { + X int +} + +func (t *T) X() {} // ERROR "type T has both field and method named X|redeclares struct field name" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug417.go b/gcc/testsuite/go.test/test/fixedbugs/bug417.go new file mode 100644 index 00000000000..a9acb42386a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug417.go @@ -0,0 +1,32 @@ +// compile + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Some indirect uses of types crashed gccgo, because it assumed that +// the size of the type was known before it had been computed. + +package p + +type S1 struct { + p *[1]S3 + s [][1]S3 + m map[int][1]S3 + c chan [1]S3 + i interface { f([1]S3) [1]S3 } + f func([1]S3) [1]S3 +} + +type S2 struct { + p *struct { F S3 } + s []struct { F S3 } + m map[int]struct { F S3 } + c chan struct { F S3 } + i interface { f(struct { F S3 }) struct { F S3 } } + f func(struct { F S3 } ) struct { F S3 } +} + +type S3 struct { + I int +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug418.go b/gcc/testsuite/go.test/test/fixedbugs/bug418.go new file mode 100644 index 00000000000..64d86b34006 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug418.go @@ -0,0 +1,22 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3044. +// Multiple valued expressions in return lists. + +package p + +func Two() (a, b int) + +// F used to compile. +func F() (x interface{}, y int) { + return Two(), 0 // ERROR "single-value context" +} + +// Recursive used to trigger an internal compiler error. +func Recursive() (x interface{}, y int) { + return Recursive(), 0 // ERROR "single-value context" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug419.go b/gcc/testsuite/go.test/test/fixedbugs/bug419.go new file mode 100644 index 00000000000..cfab404eb35 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug419.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 1811. +// gccgo failed to compile this. + +package p + +type E interface{} + +type I interface { + E + E +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug420.go b/gcc/testsuite/go.test/test/fixedbugs/bug420.go new file mode 100644 index 00000000000..02b4349d807 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug420.go @@ -0,0 +1,14 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 1757. +// gccgo failed to compile this. + +package main + +func main() { + (_) = 0 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug421.go b/gcc/testsuite/go.test/test/fixedbugs/bug421.go new file mode 100644 index 00000000000..1fe02375ab6 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug421.go @@ -0,0 +1,17 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 1927. +// gccgo failed to issue the first error below. + +package main + +func main() { + println(int(1) == uint(1)) // ERROR "types" + var x int = 1 + var y uint = 1 + println(x == y) // ERROR "types" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug422.go b/gcc/testsuite/go.test/test/fixedbugs/bug422.go new file mode 100644 index 00000000000..6865fe4b63f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug422.go @@ -0,0 +1,11 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gccgo crashed compiling this file. + +package p + +var V = "a" > "b" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug423.go b/gcc/testsuite/go.test/test/fixedbugs/bug423.go new file mode 100644 index 00000000000..72689124542 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug423.go @@ -0,0 +1,277 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gc used to overflow a counter when a variable was +// mentioned 256 times, and generate stack corruption. + +package main + +func main() { + F(1) +} + +func F(arg int) { + var X interface{} + _ = X // used once + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 32 times + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 64 times + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 96 times + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 128 times + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 200 times + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 + X = 0 // used 256 times + if arg != 1 { + panic("argument was changed") + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go b/gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go new file mode 100644 index 00000000000..97054da3a31 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug424.dir/lib.go @@ -0,0 +1,16 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lib + +type I interface { + m() string +} + +type T struct{} + +// m is not accessible from outside this package. +func (t *T) m() string { + return "lib.T.m" +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug424.go b/gcc/testsuite/go.test/test/fixedbugs/bug424.go new file mode 100644 index 00000000000..41524543a84 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug424.go @@ -0,0 +1,102 @@ +// $G $D/$F.dir/lib.go && $G $D/$F.go && $L $F.$A && ./$A.out + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Tests that method calls through an interface always +// call the locally defined method localT.m independent +// at which embedding level it is and in which order +// embedding is done. + +package main + +import "./lib" +import "reflect" +import "fmt" + +type localI interface { + m() string +} + +type localT struct{} + +func (t *localT) m() string { + return "main.localT.m" +} + +type myT1 struct { + localT +} + +type myT2 struct { + localT + lib.T +} + +type myT3 struct { + lib.T + localT +} + +func main() { + var i localI + + i = new(localT) + if i.m() != "main.localT.m" { + println("BUG: localT:", i.m(), "called") + } + + i = new(myT1) + if i.m() != "main.localT.m" { + println("BUG: myT1:", i.m(), "called") + } + + i = new(myT2) + if i.m() != "main.localT.m" { + println("BUG: myT2:", i.m(), "called") + } + + t3 := new(myT3) + if t3.m() != "main.localT.m" { + println("BUG: t3:", t3.m(), "called") + } + + i = new(myT3) + if i.m() != "main.localT.m" { + t := reflect.TypeOf(i) + n := t.NumMethod() + for j := 0; j < n; j++ { + m := t.Method(j) + fmt.Printf("#%d: %s.%s %s\n", j, m.PkgPath, m.Name, m.Type) + } + println("BUG: myT3:", i.m(), "called") + } + + var t4 struct { + localT + lib.T + } + if t4.m() != "main.localT.m" { + println("BUG: t4:", t4.m(), "called") + } + i = &t4 + if i.m() != "main.localT.m" { + println("BUG: myT4:", i.m(), "called") + } + + var t5 struct { + lib.T + localT + } + if t5.m() != "main.localT.m" { + println("BUG: t5:", t5.m(), "called") + } + i = &t5 + if i.m() != "main.localT.m" { + println("BUG: myT5:", i.m(), "called") + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug425.go b/gcc/testsuite/go.test/test/fixedbugs/bug425.go new file mode 100644 index 00000000000..5546bd96ba5 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug425.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// http://code.google.com/p/go/issues/detail?id=3119 + +package main + +import "fmt" + +func main() { + s := "hello" + fmt.Println(s == "") + fmt.Println(s + "world" == "world") +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug426.go b/gcc/testsuite/go.test/test/fixedbugs/bug426.go new file mode 100644 index 00000000000..a1af3cf997d --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug426.go @@ -0,0 +1,15 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gccgo crashed compiling this. + +package p + +type T *T + +func f(t T) { + println(t, *t) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug427.go b/gcc/testsuite/go.test/test/fixedbugs/bug427.go new file mode 100644 index 00000000000..1239e7a3324 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug427.go @@ -0,0 +1,39 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// http://code.google.com/p/go/issues/detail?id=3351 + +package main + +// struct with four fields of basic type +type S struct {a, b, c, d int} + +// struct with five fields of basic type +type T struct {a, b, c, d, e int} + +// array with four elements +type A [4]int + +// array with five elements +type B [5]int + +func main() { + var i interface{} + + var s1, s2 S + i = s1 == s2 + + var t1, t2 T + i = t1 == t2 + + var a1, a2 A + i = a1 == a2 + + var b1, b2 B + i = b1 == b2 + + _ = i +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug428.go b/gcc/testsuite/go.test/test/fixedbugs/bug428.go new file mode 100644 index 00000000000..298c4551834 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug428.go @@ -0,0 +1,19 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that when the compiler expands append inline it does not +// overwrite a value before it needs it (issue 3369). + +package main + +func main() { + s := make([]byte, 5, 6) + copy(s, "12346") + s = append(s[:len(s)-1], '5', s[len(s)-1]) + if string(s) != "123456" { + panic(s) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug429.go b/gcc/testsuite/go.test/test/fixedbugs/bug429.go new file mode 100644 index 00000000000..794d293db2f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug429.go @@ -0,0 +1,16 @@ +// $G $D/$F.go && $L $F.$A && ! ./$A.out || echo BUG: bug429 + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Should print deadlock message, not hang. + +package main + +func main() { + select {} +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug430.go b/gcc/testsuite/go.test/test/fixedbugs/bug430.go new file mode 100644 index 00000000000..93d5cf2d5bd --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug430.go @@ -0,0 +1,22 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gccgo crashed compiling this. + +package main + +type S struct { + f [2][]int +} + +func F() (r [2][]int) { + return +} + +func main() { + var a []S + a[0].f = F() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug431.go b/gcc/testsuite/go.test/test/fixedbugs/bug431.go new file mode 100644 index 00000000000..1057dadcc21 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug431.go @@ -0,0 +1,18 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gccgo gave an invalid error ("floating point constant truncated to +// integer") compiling this. + +package p + +const C = 1<<63 - 1 + +func F(i int64) int64 { + return i +} + +var V = F(int64(C) / 1e6) diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug432.go b/gcc/testsuite/go.test/test/fixedbugs/bug432.go new file mode 100644 index 00000000000..0c1a9146108 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug432.go @@ -0,0 +1,13 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// gccgo crashed compiling this. + +package p + +var v struct{ I } + +type I interface{} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug433.go b/gcc/testsuite/go.test/test/fixedbugs/bug433.go new file mode 100644 index 00000000000..1139dfa0088 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug433.go @@ -0,0 +1,39 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that initializing struct fields out of order still runs +// functions in the right order. This failed with gccgo. + +package main + +type S struct { + i1, i2, i3 int +} + +var G int + +func v(i int) int { + if i != G { + panic(i) + } + G = i + 1 + return G +} + +func F() S { + return S{ + i1: v(0), + i3: v(1), + i2: v(2), + } +} + +func main() { + s := F() + if s != (S{1, 3, 2}) { + panic(s) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug434.go b/gcc/testsuite/go.test/test/fixedbugs/bug434.go new file mode 100644 index 00000000000..5abb567b43f --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug434.go @@ -0,0 +1,32 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that typed and untyped negative zero floating point constants +// are treated as equivalent to zero constants. + +package main + +import "math" + +const zero = 0.0 + +func main() { + x := -zero + b := math.Float64bits(x) + if b != 0 { + panic(b) + } + x = -float64(zero) + b = math.Float64bits(x) + if b != 0 { + panic(b) + } + v := x + b = math.Float64bits(-v) + if b != 0x8000000000000000 { + panic(b) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug435.go b/gcc/testsuite/go.test/test/fixedbugs/bug435.go new file mode 100644 index 00000000000..9c30b143bcf --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug435.go @@ -0,0 +1,15 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that a syntax error caused by an unexpected EOF +// gives an error message with the correct line number. +// +// https://code.google.com/p/go/issues/detail?id=3392 + +package main + +func foo() { + bar(1, // ERROR "unexpected|missing|undefined" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug436.go b/gcc/testsuite/go.test/test/fixedbugs/bug436.go new file mode 100644 index 00000000000..e848eaeba24 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug436.go @@ -0,0 +1,32 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Gccgo used to crash compiling this. + +package main + +func foo() (int, int) { + return 1, 2 +} + +var c = b +var a, b = foo() +var d = b + 1 + +func main() { + if a != 1 { + panic(a) + } + if b != 2 { + panic(b) + } + if c != 2 { + panic(c) + } + if d != 3 { + panic(d) + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go new file mode 100644 index 00000000000..8d3caadae13 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/one.go @@ -0,0 +1,18 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package one + +type I1 interface { + f() +} + +type S1 struct { +} + +func (s S1) f() { +} + +func F1(i1 I1) { +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go new file mode 100644 index 00000000000..406dd5903e3 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug437.dir/two.go @@ -0,0 +1,11 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package two + +import "./one" + +type S2 struct { + one.S1 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug437.go b/gcc/testsuite/go.test/test/fixedbugs/bug437.go new file mode 100644 index 00000000000..b1e76a6a744 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug437.go @@ -0,0 +1,30 @@ +// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.go && $L $F.$A && ./$A.out + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test converting a type defined in a different package to an +// interface defined in a third package, where the interface has a +// hidden method. This used to cause a link error with gccgo. + +package main + +import ( + "./one" + "./two" +) + +func F(i1 one.I1) { + switch v := i1.(type) { + case two.S2: + one.F1(v) + } +} + +func main() { + F(nil) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug438.go b/gcc/testsuite/go.test/test/fixedbugs/bug438.go new file mode 100644 index 00000000000..15d3fdab893 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug438.go @@ -0,0 +1,16 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Gccgo used to incorrectly give an error when compiling this. + +package p + +func F() (i int) { + for first := true; first; first = false { + i++ + } + return +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug439.go b/gcc/testsuite/go.test/test/fixedbugs/bug439.go new file mode 100644 index 00000000000..87d4ae0373a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug439.go @@ -0,0 +1,22 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Gccgo used to crash compiling this. + +package p + +type E int + +func (e E) P() *E { return &e } + +const ( + C1 E = 0 + C2 = C1 +) + +func F() *E { + return C2.P() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug440_32.go b/gcc/testsuite/go.test/test/fixedbugs/bug440_32.go new file mode 100644 index 00000000000..2d26fbb90ab --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug440_32.go @@ -0,0 +1,21 @@ +// run + +// Test for 8g register move bug. The optimizer gets confused +// about 16- vs 32-bit moves during splitContractIndex. + +// Issue 3910. + +package main + +func main() { + const c = 0x12345678 + index, n, offset := splitContractIndex(c) + if index != int((c&0xffff)>>5) || n != int(c&(1<<5-1)) || offset != (c>>16)&(1<<14-1) { + println("BUG", index, n, offset) + } +} + +func splitContractIndex(ce uint32) (index, n, offset int) { + h := uint16(ce) + return int(h >> 5), int(h & (1<<5 - 1)), int(ce>>16) & (1<<14 - 1) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug440_64.go b/gcc/testsuite/go.test/test/fixedbugs/bug440_64.go new file mode 100644 index 00000000000..3ab3e565da0 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug440_64.go @@ -0,0 +1,21 @@ +// run + +// Test for 6g register move bug. The optimizer gets confused +// about 32- vs 64-bit moves during splitContractIndex. + +// Issue 3918. + +package main + +func main() { + const c = 0x123400005678 + index, offset := splitContractIndex(c) + if index != (c&0xffffffff)>>5 || offset != c+1 { + println("BUG", index, offset) + } +} + +func splitContractIndex(ce uint64) (index uint32, offset uint64) { + h := uint32(ce) + return h >> 5, ce + 1 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug441.go b/gcc/testsuite/go.test/test/fixedbugs/bug441.go new file mode 100644 index 00000000000..8562bfeef85 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug441.go @@ -0,0 +1,36 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Was discarding function calls made for arguments named _ +// in inlined functions. Issue 3593. + +package main + +var did int + +func main() { + foo(side()) + foo2(side(), side()) + foo3(side(), side()) + T.m1(T(side())) + T(1).m2(side()) + const want = 7 + if did != want { + println("BUG: missing", want-did, "calls") + } +} + +func foo(_ int) {} +func foo2(_, _ int) {} +func foo3(int, int) {} +type T int +func (_ T) m1() {} +func (t T) m2(_ int) {} + +func side() int { + did++ + return 1 +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug442.go b/gcc/testsuite/go.test/test/fixedbugs/bug442.go new file mode 100644 index 00000000000..1d1a948161a --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug442.go @@ -0,0 +1,27 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Used to crash generating hash and == functions for struct +// with leading _ field. Issue 3607. + +package main + +type T struct { + _ int + X interface{} + _ string + Y float64 +} + +func main() { + m := map[T]int{} + m[T{X: 1, Y: 2}] = 1 + m[T{X: 2, Y: 3}] = 2 + m[T{X: 1, Y: 2}] = 3 // overwrites first entry + if len(m) != 2 { + println("BUG") + } +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug443.go b/gcc/testsuite/go.test/test/fixedbugs/bug443.go new file mode 100644 index 00000000000..b67bd8cb875 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug443.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Was failing to compile with 'invalid receiver' due to +// incomplete type definition evaluation. Issue 3709. + +package p + +type T1 struct { F *T2 } +type T2 T1 + +type T3 T2 +func (*T3) M() // was invalid receiver + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug444.go b/gcc/testsuite/go.test/test/fixedbugs/bug444.go new file mode 100644 index 00000000000..b54fb4f5817 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug444.go @@ -0,0 +1,36 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The no-op conversion here used to confuse the compiler +// into doing a load-effective-address of nil. +// See issue 3670. + +package main + +import "reflect" + +type T interface {} + +var x bool + +func main() { + reflect.TypeOf(nil) + reflect.TypeOf(T(nil)) // used to miscompile + shouldPanic() +} + +func f() byte { + return []byte(nil)[0] // used to miscompile +} + +func shouldPanic() { + defer func() { + if recover() == nil { + panic("not panicking") + } + }() + f() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug445.go b/gcc/testsuite/go.test/test/fixedbugs/bug445.go new file mode 100644 index 00000000000..497ecd3abae --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug445.go @@ -0,0 +1,14 @@ +// compile + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3765 + +package main + +func f(x uint) uint { + m := ^(1 << x) + return uint(m) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug446.go b/gcc/testsuite/go.test/test/fixedbugs/bug446.go new file mode 100644 index 00000000000..1e435e1109e --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug446.go @@ -0,0 +1,36 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3824. +// Method calls are ignored when deciding initialization +// order. + +package main + +type T int + +func (r T) Method1() int { return a } +func (r T) Method2() int { return b } + +// dummy1 and dummy2 must be initialized after a and b. +var dummy1 = T(0).Method1() +var dummy2 = T.Method2(0) + +// Use a function call to force generating code. +var a = identity(1) +var b = identity(2) + +func identity(a int) int { return a } + +func main() { + if dummy1 != 1 { + panic("dummy1 != 1") + } + if dummy2 != 2 { + panic("dummy2 != 2") + } +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug447.go b/gcc/testsuite/go.test/test/fixedbugs/bug447.go new file mode 100644 index 00000000000..a4c871bdbf6 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug447.go @@ -0,0 +1,105 @@ +// runoutput + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3804 +// test all possible float -> integer conversions + +package main + +import ( + "bytes" + "fmt" + "strings" +) + +var ( + intWidths = []int{8, 16, 32, 64} // int%d and uint%d + floatWidths = []int{32, 64} // float%d +) + +func main() { + + var names, funcs bytes.Buffer + + for _, iWidth := range intWidths { + for _, typ := range []string{"int", "uint"} { + var segs bytes.Buffer + itype := fmt.Sprintf("%s%d", typ, iWidth) + names.WriteString("\ttest" + itype + ",\n") + for _, fWidth := range floatWidths { + ftype := fmt.Sprintf("float%d", fWidth) + seg := strings.Replace(testSegment, "$F", ftype, -1) + seg = strings.Replace(seg, "$I", itype, -1) + segs.WriteString(seg) + } + body := strings.Replace(testFunc, "$I", itype, -1) + if typ[0] == 'u' { + body = strings.Replace(body, "$TEST", " || i < 0", 1) + } else { + body = strings.Replace(body, "$TEST", "", 1) + } + body = strings.Replace(body, "$TESTSEGMENTS", segs.String(), 1) + funcs.WriteString(body) + } + } + + program = strings.Replace(program, "$NAMES", names.String(), 1) + program = strings.Replace(program, "$FUNCS", funcs.String(), 1) + fmt.Print(program) +} + +const testSegment = ` + f$F := $F(f) + if math.Abs(float64(f$F) - f) < 0.05 { + if v := $I(f$F); v != $I(i) { + fmt.Printf("$I($F(%f)) = %v, expected %v\n", f, v, i) + } + }` + +const testFunc = +`func test$I(f float64, i int64) { + if i != int64($I(i))$TEST { + return + } +$TESTSEGMENTS +} +` + +var program = +`package main + +import ( + "fmt" + "math" +) + +var tests = []struct { + f float64 + i int64 +}{ + {39.7, 39}, + {-39.7, -39}, + {258.6, 258}, + {-258.6, -258}, + {65538.9, 65538}, + {-65538.9, -65538}, + {4294967298.8, 4294967298}, + {-4294967298.8, -4294967298}, +} + +var funcs = []func(float64, int64){ +$NAMES +} + +$FUNCS +func main() { + for _, t := range tests { + for _, f := range funcs { + f(t.f, t.i) + } + } +} +` diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go new file mode 100644 index 00000000000..032e5d9de3b --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg1.go @@ -0,0 +1,11 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package pkg1 + +var x = make(chan interface{}) + +func Do() int { + return (<-x).(int) +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go new file mode 100644 index 00000000000..5c78c7d2f3c --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug448.dir/pkg2.go @@ -0,0 +1,14 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3843: inlining bug due to wrong receive operator precedence. + +package pkg2 + +import "./pkg1" + +func F() { + pkg1.Do() +} + diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug448.go b/gcc/testsuite/go.test/test/fixedbugs/bug448.go new file mode 100644 index 00000000000..242f5999e84 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug448.go @@ -0,0 +1,7 @@ +// compiledir + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug449.go b/gcc/testsuite/go.test/test/fixedbugs/bug449.go new file mode 100644 index 00000000000..a9650f4c6f6 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug449.go @@ -0,0 +1,69 @@ +// runoutput + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3866 +// runtime.equal failed to take padding between arguments and +// return values into account, so in certain cases gc-generated +// code will read a random bool from the stack as the result of +// the comparison. +// This program generates a lot of equality tests and hopes to +// catch this. +// NOTE: this program assumes comparing instance of T and T's +// underlying []byte will make gc emit calls to runtime.equal, +// and if gc optimizes this case, then the test will no longer +// be correct (in the sense that it no longer tests runtime.equal). + +package main + +import ( + "bytes" + "fmt" + "strconv" + "strings" +) + +const ntest = 1024 + +func main() { + var decls, calls bytes.Buffer + + for i := 1; i <= ntest; i++ { + s := strconv.Itoa(i) + decls.WriteString(strings.Replace(decl, "$", s, -1)) + calls.WriteString(strings.Replace("call(test$)\n\t", "$", s, -1)) + } + + program = strings.Replace(program, "$DECLS", decls.String(), 1) + program = strings.Replace(program, "$CALLS", calls.String(), 1) + fmt.Print(program) +} + +var program = `package main + +var count int + +func call(f func() bool) { + if f() { + count++ + } +} + +$DECLS + +func main() { + $CALLS + if count != 0 { + println("failed", count, "case(s)") + } +} +` + +const decl = ` +type T$ [$]uint8 +func test$() bool { + v := T${1} + return v == [$]uint8{2} || v != [$]uint8{1} +}` diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug450.go b/gcc/testsuite/go.test/test/fixedbugs/bug450.go new file mode 100644 index 00000000000..3f13de16ceb --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug450.go @@ -0,0 +1,28 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3899: 8g incorrectly thinks a variable is +// "set but not used" and elides an assignment, causing +// variables to end up with wrong data. +// +// The reason is a miscalculation of variable width. + +package main + +func bar(f func()) { + f() +} + +func foo() { + f := func() {} + if f == nil { + } + bar(f) +} + +func main() { + foo() +} diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug451.go b/gcc/testsuite/go.test/test/fixedbugs/bug451.go new file mode 100644 index 00000000000..75ce97490ec --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug451.go @@ -0,0 +1,11 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +type T x.T // ERROR "undefined|expected package" + +// bogus "invalid recursive type" diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug452.go b/gcc/testsuite/go.test/test/fixedbugs/bug452.go new file mode 100644 index 00000000000..d2e4a0b44a6 --- /dev/null +++ b/gcc/testsuite/go.test/test/fixedbugs/bug452.go @@ -0,0 +1,38 @@ +// run + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3835: 8g tries to optimize arithmetic involving integer +// constants, but can run out of registers in the process. + +package main + +var a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G int + +func foo() int { + return a + 1 + b + 2 + c + 3 + d + 4 + e + 5 + f + 6 + g + 7 + h + 8 + i + 9 + j + 10 + + k + 1 + l + 2 + m + 3 + n + 4 + o + 5 + p + 6 + q + 7 + r + 8 + s + 9 + t + 10 + + u + 1 + v + 2 + w + 3 + x + 4 + y + 5 + z + 6 + A + 7 + B + 8 + C + 9 + D + 10 + + E + 1 + F + 2 + G + 3 +} + +func bar() int8 { + var ( + W int16 + X int32 + Y int32 + Z int32 + ) + return int8(W+int16(X+3)+3) * int8(Y+3+Z*3) +} + +func main() { + if foo() == 0 { + panic("foo") + } + if bar() == 0 { + panic("bar") + } +} diff --git a/gcc/testsuite/go.test/test/float_lit.go b/gcc/testsuite/go.test/test/float_lit.go index 7b91d88e51a..2912c3749c2 100644 --- a/gcc/testsuite/go.test/test/float_lit.go +++ b/gcc/testsuite/go.test/test/float_lit.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test floating-point literal syntax. + package main var bad bool diff --git a/gcc/testsuite/go.test/test/floatcmp.go b/gcc/testsuite/go.test/test/floatcmp.go index f51cbc27775..f9f59a937f2 100644 --- a/gcc/testsuite/go.test/test/floatcmp.go +++ b/gcc/testsuite/go.test/test/floatcmp.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test floating-point comparison involving NaN. + package main import "math" diff --git a/gcc/testsuite/go.test/test/for.go b/gcc/testsuite/go.test/test/for.go index 36ad15709b1..8a50090657f 100644 --- a/gcc/testsuite/go.test/test/for.go +++ b/gcc/testsuite/go.test/test/for.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test for loops. + package main func assertequal(is, shouldbe int, msg string) { diff --git a/gcc/testsuite/go.test/test/func.go b/gcc/testsuite/go.test/test/func.go index e8ed928bcd3..246cb56fd95 100644 --- a/gcc/testsuite/go.test/test/func.go +++ b/gcc/testsuite/go.test/test/func.go @@ -1,9 +1,10 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple functions. package main diff --git a/gcc/testsuite/go.test/test/func1.go b/gcc/testsuite/go.test/test/func1.go index 056ff9877d3..c89f7ff2eae 100644 --- a/gcc/testsuite/go.test/test/func1.go +++ b/gcc/testsuite/go.test/test/func1.go @@ -1,14 +1,15 @@ -// errchk $G $F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// does not compile and should not compile +// Test that result parameters are in the same scope as regular parameters. +// Does not compile. package main -func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return values must have names +func f1(a int) (int, float32) { return 7, 7.0 } diff --git a/gcc/testsuite/go.test/test/func2.go b/gcc/testsuite/go.test/test/func2.go index 87e78194ef9..b5966a91f60 100644 --- a/gcc/testsuite/go.test/test/func2.go +++ b/gcc/testsuite/go.test/test/func2.go @@ -1,9 +1,12 @@ -// $G $F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test function signatures. +// Compiled but not run. + package main type t1 int diff --git a/gcc/testsuite/go.test/test/func3.go b/gcc/testsuite/go.test/test/func3.go index 110b0ef1c49..6be3bf0184d 100644 --- a/gcc/testsuite/go.test/test/func3.go +++ b/gcc/testsuite/go.test/test/func3.go @@ -1,9 +1,12 @@ -// errchk $G $F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal function signatures are detected. +// Does not compile. + package main type t1 int diff --git a/gcc/testsuite/go.test/test/func4.go b/gcc/testsuite/go.test/test/func4.go index 2a1a932de90..85f1e4b81e9 100644 --- a/gcc/testsuite/go.test/test/func4.go +++ b/gcc/testsuite/go.test/test/func4.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that it is illegal to take the address of a function. +// Does not compile. + package main var notmain func() diff --git a/gcc/testsuite/go.test/test/func5.go b/gcc/testsuite/go.test/test/func5.go index e27825c2b28..2e058be7e6e 100644 --- a/gcc/testsuite/go.test/test/func5.go +++ b/gcc/testsuite/go.test/test/func5.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test functions and goroutines. + package main func caller(f func(int, int) int, a, b int, c chan int) { diff --git a/gcc/testsuite/go.test/test/func6.go b/gcc/testsuite/go.test/test/func6.go index 1356b6aa8b8..456cb49f092 100644 --- a/gcc/testsuite/go.test/test/func6.go +++ b/gcc/testsuite/go.test/test/func6.go @@ -1,9 +1,11 @@ -// $G $D/$F.go +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test closures in if conditions. + package main func main() { diff --git a/gcc/testsuite/go.test/test/func7.go b/gcc/testsuite/go.test/test/func7.go index e38b008cc09..6f6766f29f6 100644 --- a/gcc/testsuite/go.test/test/func7.go +++ b/gcc/testsuite/go.test/test/func7.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test evaluation order in if condition. + package main var calledf = false diff --git a/gcc/testsuite/go.test/test/func8.go b/gcc/testsuite/go.test/test/func8.go new file mode 100644 index 00000000000..7defe265b58 --- /dev/null +++ b/gcc/testsuite/go.test/test/func8.go @@ -0,0 +1,49 @@ +// run + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test evaluation order. + +package main + +var calledf int + +func f() int { + calledf++ + return 0 +} + +func g() int { + return calledf +} + +var xy string + +func x() bool { + for false { + } // no inlining + xy += "x" + return false +} + +func y() string { + for false { + } // no inlining + xy += "y" + return "abc" +} + +func main() { + if f() == g() { + println("wrong f,g order") + } + + if x() == (y() == "abc") { + panic("wrong compare") + } + if xy != "xy" { + println("wrong x,y order") + } +} diff --git a/gcc/testsuite/go.test/test/gc.go b/gcc/testsuite/go.test/test/gc.go index 3aab8fac953..6688f9fbddb 100644 --- a/gcc/testsuite/go.test/test/gc.go +++ b/gcc/testsuite/go.test/test/gc.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Simple test of the garbage collector. + package main import "runtime" diff --git a/gcc/testsuite/go.test/test/gc1.go b/gcc/testsuite/go.test/test/gc1.go index 84034e7cea9..6049ea14e9b 100644 --- a/gcc/testsuite/go.test/test/gc1.go +++ b/gcc/testsuite/go.test/test/gc1.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// A simple test of the garbage collector. + package main func main() { diff --git a/gcc/testsuite/go.test/test/gc2.go b/gcc/testsuite/go.test/test/gc2.go index 772f9810daa..de52a4fbf2e 100644 --- a/gcc/testsuite/go.test/test/gc2.go +++ b/gcc/testsuite/go.test/test/gc2.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that buffered channels are garbage collected properly. +// Test that buffered channels are garbage collected properly. // An interesting case because they have finalizers and used to // have self loops that kept them from being collected. // (Cyclic data with finalizers is never finalized, nor collected.) diff --git a/gcc/testsuite/go.test/test/golden.out b/gcc/testsuite/go.test/test/golden.out index e0b4cf6e2a7..3e44e04c6aa 100644 --- a/gcc/testsuite/go.test/test/golden.out +++ b/gcc/testsuite/go.test/test/golden.out @@ -11,9 +11,18 @@ == dwarf/ +== safe/ + == fixedbugs/ +=========== fixedbugs/bug429.go +throw: all goroutines are asleep - deadlock! + == bugs/ =========== bugs/bug395.go bug395 is broken + +=========== bugs/bug434.go +bugs/bug434.dir/two.go:10: one.t.int undefined (cannot refer to unexported field or method one.int) +BUG:bug434 diff --git a/gcc/testsuite/go.test/test/goprint.go b/gcc/testsuite/go.test/test/goprint.go index 53ed055a070..2f0d3c3904d 100644 --- a/gcc/testsuite/go.test/test/goprint.go +++ b/gcc/testsuite/go.test/test/goprint.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that println can be the target of a go statement. + package main import "time" diff --git a/gcc/testsuite/go.test/test/goto.go b/gcc/testsuite/go.test/test/goto.go index 1fccb314c87..ca477b3d0c3 100644 --- a/gcc/testsuite/go.test/test/goto.go +++ b/gcc/testsuite/go.test/test/goto.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify goto semantics. +// Does not compile. +// // Each test is in a separate function just so that if the // compiler stops processing after one error, we don't // lose other ones. diff --git a/gcc/testsuite/go.test/test/hashmap.go b/gcc/testsuite/go.test/test/hashmap.go deleted file mode 100755 index 0a4d7ab61ee..00000000000 --- a/gcc/testsuite/go.test/test/hashmap.go +++ /dev/null @@ -1,181 +0,0 @@ -// $G $F.go && $L $F.$A && ./$A.out - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -// ---------------------------------------------------------------------------- -// Helper functions - -func ASSERT(p bool) { - if !p { - // panic 0 - } -} - - -// ---------------------------------------------------------------------------- -// Implementation of the HashMap - -type KeyType interface { - Hash() uint32 - Match(other KeyType) bool -} - - -type ValueType interface { - // empty interface -} - - -type Entry struct { - key KeyType - value ValueType -} - - -type Array [1024]Entry - -type HashMap struct { - map_ *Array - log2_capacity_ uint32 - occupancy_ uint32 -} - - -func (m *HashMap) capacity() uint32 { - return 1 << m.log2_capacity_ -} - - -func (m *HashMap) Clear() { - // Mark all entries as empty. - var i uint32 = m.capacity() - 1 - for i > 0 { - m.map_[i].key = nil - i = i - 1 - } - m.occupancy_ = 0 -} - - -func (m *HashMap) Initialize (initial_log2_capacity uint32) { - m.log2_capacity_ = initial_log2_capacity - m.map_ = new(Array) - m.Clear() -} - - -func (m *HashMap) Probe (key KeyType) *Entry { - ASSERT(key != nil) - - var i uint32 = key.Hash() % m.capacity() - ASSERT(0 <= i && i < m.capacity()) - - ASSERT(m.occupancy_ < m.capacity()) // guarantees loop termination - for m.map_[i].key != nil && !m.map_[i].key.Match(key) { - i++ - if i >= m.capacity() { - i = 0 - } - } - - return &m.map_[i] -} - - -func (m *HashMap) Lookup (key KeyType, insert bool) *Entry { - // Find a matching entry. - var p *Entry = m.Probe(key) - if p.key != nil { - return p - } - - // No entry found; insert one if necessary. - if insert { - p.key = key - p.value = nil - m.occupancy_++ - - // Grow the map if we reached >= 80% occupancy. - if m.occupancy_ + m.occupancy_/4 >= m.capacity() { - m.Resize() - p = m.Probe(key) - } - - return p - } - - // No entry found and none inserted. - return nil -} - - -func (m *HashMap) Resize() { - var hmap *Array = m.map_ - var n uint32 = m.occupancy_ - - // Allocate a new map of twice the current size. - m.Initialize(m.log2_capacity_ << 1) - - // Rehash all current entries. - var i uint32 = 0 - for n > 0 { - if hmap[i].key != nil { - m.Lookup(hmap[i].key, true).value = hmap[i].value - n = n - 1 - } - i++ - } -} - - -// ---------------------------------------------------------------------------- -// Test code - -type Number struct { - x uint32 -} - - -func (n *Number) Hash() uint32 { - return n.x * 23 -} - - -func (n *Number) Match(other KeyType) bool { - // var y *Number = other - // return n.x == y.x - return false -} - - -func MakeNumber (x uint32) *Number { - var n *Number = new(Number) - n.x = x - return n -} - - -func main() { - // func (n int) int { return n + 1; }(1) - - //print "HashMap - gri 2/8/2008\n" - - var hmap *HashMap = new(HashMap) - hmap.Initialize(0) - - var x1 *Number = MakeNumber(1001) - var x2 *Number = MakeNumber(2002) - var x3 *Number = MakeNumber(3003) - _, _, _ = x1, x2, x3 - - // this doesn't work I think... - //hmap.Lookup(x1, true) - //hmap.Lookup(x2, true) - //hmap.Lookup(x3, true) - - //print "done\n" -} diff --git a/gcc/testsuite/go.test/test/helloworld.go b/gcc/testsuite/go.test/test/helloworld.go index 16c95f00686..5025ec9bb35 100644 --- a/gcc/testsuite/go.test/test/helloworld.go +++ b/gcc/testsuite/go.test/test/helloworld.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that we can do page 1 of the C book. + package main func main() { diff --git a/gcc/testsuite/go.test/test/if.go b/gcc/testsuite/go.test/test/if.go index 18a6715d7eb..25cc141648b 100644 --- a/gcc/testsuite/go.test/test/if.go +++ b/gcc/testsuite/go.test/test/if.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test if statements in various forms. + package main func assertequal(is, shouldbe int, msg string) { diff --git a/gcc/testsuite/go.test/test/import.go b/gcc/testsuite/go.test/test/import.go index bd83dc3bdd3..d135cd28451 100644 --- a/gcc/testsuite/go.test/test/import.go +++ b/gcc/testsuite/go.test/test/import.go @@ -1,11 +1,11 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// check that when import gives multiple names -// to a type, they're still all the same type +// Test that when import gives multiple names +// to a single type, they still all refer to the same type. package main diff --git a/gcc/testsuite/go.test/test/import1.go b/gcc/testsuite/go.test/test/import1.go index ebd704ef995..56b29d58c06 100644 --- a/gcc/testsuite/go.test/test/import1.go +++ b/gcc/testsuite/go.test/test/import1.go @@ -1,10 +1,11 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// check for import conflicts +// Verify that import conflicts are detected by the compiler. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/import2.go b/gcc/testsuite/go.test/test/import2.go index 0efc285fac8..5c275f34b36 100644 --- a/gcc/testsuite/go.test/test/import2.go +++ b/gcc/testsuite/go.test/test/import2.go @@ -1,9 +1,12 @@ -// true # used by import3 +// skip # used by import3 // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Various declarations of exported variables and functions. +// Imported by import3.go. + package p var C1 chan <- chan int = (chan<- (chan int))(nil) diff --git a/gcc/testsuite/go.test/test/import3.go b/gcc/testsuite/go.test/test/import3.go index e4900b93ddc..0a5ba1d01ac 100644 --- a/gcc/testsuite/go.test/test/import3.go +++ b/gcc/testsuite/go.test/test/import3.go @@ -1,10 +1,13 @@ // $G $D/import2.go && $G $D/$F.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that all the types from import2.go made it +// Test that all the types from import2.go made it // intact and with the same meaning, by assigning to or using them. package main diff --git a/gcc/testsuite/go.test/test/import4.go b/gcc/testsuite/go.test/test/import4.go index 1ae1d0e4ad3..f35f5678184 100644 --- a/gcc/testsuite/go.test/test/import4.go +++ b/gcc/testsuite/go.test/test/import4.go @@ -1,12 +1,17 @@ // $G $D/empty.go && errchk $G $D/$F.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +// Verify that various kinds of "imported and not used" +// errors are caught by the compiler. +// Does not compile. -// various kinds of imported and not used +package main // standard import "fmt" // ERROR "imported and not used.*fmt" diff --git a/gcc/testsuite/go.test/test/import5.go b/gcc/testsuite/go.test/test/import5.go new file mode 100644 index 00000000000..6480acff92c --- /dev/null +++ b/gcc/testsuite/go.test/test/import5.go @@ -0,0 +1,55 @@ +// errorcheck + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that invalid imports are rejected by the compiler. +// Does not compile. + +package main + +// Correct import paths. +import _ "fmt" +import _ `time` +import _ "m\x61th" +import _ "go/parser" + +// Correct import paths, but the packages don't exist. +// Don't test. +//import "a.b" +//import "greek/αβ" + +// Import paths must be strings. +import 42 // ERROR "import statement" +import 'a' // ERROR "import statement" +import 3.14 // ERROR "import statement" +import 0.25i // ERROR "import statement" + +// Each of these pairs tests both `` vs "" strings +// and also use of invalid characters spelled out as +// escape sequences and written directly. +// For example `"\x00"` tests import "\x00" +// while "`\x00`" tests import ``. +import "" // ERROR "import path" +import `` // ERROR "import path" +import "\x00" // ERROR "import path" +import `\x00` // ERROR "import path" +import "\x7f" // ERROR "import path" +import `\x7f` // ERROR "import path" +import "a!" // ERROR "import path" +import `a!` // ERROR "import path" +import "a b" // ERROR "import path" +import `a b` // ERROR "import path" +import "a\\b" // ERROR "import path" +import `a\\b` // ERROR "import path" +import "\"`a`\"" // ERROR "import path" +import `\"a\"` // ERROR "import path" +import "\x80\x80" // ERROR "import path" +import `\x80\x80` // ERROR "import path" +import "\xFFFD" // ERROR "import path" +import `\xFFFD` // ERROR "import path" + +// Invalid local imports. +import "/foo" // ERROR "import path cannot be absolute path" +import "c:/foo" // ERROR "import path contains invalid character" diff --git a/gcc/testsuite/go.test/test/index.go b/gcc/testsuite/go.test/test/index.go index 38aa33dd305..447d708969f 100644 --- a/gcc/testsuite/go.test/test/index.go +++ b/gcc/testsuite/go.test/test/index.go @@ -4,11 +4,15 @@ // ./$A.out -pass 2 >tmp.go && errchk $G -e tmp.go // rm -f tmp.go $A.out1 +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Generate test of index and slice bounds checks. +// The output is compiled and run. package main @@ -30,16 +34,20 @@ import ( type quad struct { x, y, z, w int } const ( - cj = 11 - ci int = 12 - ci32 int32 = 13 - ci64 int64 = 14 + cj = 100011 + ci int = 100012 + ci8 int8 = 115 + ci16 int16 = 10016 + ci32 int32 = 100013 + ci64 int64 = 100014 ci64big int64 = 1<<31 ci64bigger int64 = 1<<32 chuge = 1<<100 cnj = -2 cni int = -3 + cni8 int8 = -6 + cni16 int16 = -7 cni32 int32 = -4 cni64 int64 = -5 cni64big int64 = -1<<31 @@ -47,16 +55,20 @@ const ( cnhuge = -1<<100 ) -var j int = 20 -var i int = 21 -var i32 int32 = 22 -var i64 int64 = 23 +var j int = 100020 +var i int = 100021 +var i8 int8 = 126 +var i16 int16 = 10025 +var i32 int32 = 100022 +var i64 int64 = 100023 var i64big int64 = 1<<31 var i64bigger int64 = 1<<32 var huge uint64 = 1<<64 - 1 var nj int = -10 var ni int = -11 +var ni8 int8 = -14 +var ni16 int16 = -15 var ni32 int32 = -12 var ni64 int64 = -13 var ni64big int64 = -1<<31 @@ -71,6 +83,14 @@ var sq []quad = make([]quad, 10) var aq [10]quad var paq *[10]quad = &aq +var sib []int = make([]int, 100000) +var aib [100000]int +var paib *[100000]int = &aib + +var sqb []quad = make([]quad, 100000) +var aqb [100000]quad +var paqb *[100000]quad = &aqb + type T struct { si []int ai [10]int @@ -78,11 +98,18 @@ type T struct { sq []quad aq [10]quad paq *[10]quad + + sib []int + aib [100000]int + paib *[100000]int + sqb []quad + aqb [100000]quad + paqb *[100000]quad } -var t = T{si, ai, pai, sq, aq, paq} +var t = T{si, ai, pai, sq, aq, paq, sib, aib, paib, sqb, aqb, paqb} -var pt = &T{si, ai, pai, sq, aq, paq} +var pt = &T{si, ai, pai, sq, aq, paq, sib, aib, paib, sqb, aqb, paqb} // test that f panics func test(f func(), s string) { @@ -91,11 +118,25 @@ func test(f func(), s string) { _, file, line, _ := runtime.Caller(2) bug() print(file, ":", line, ": ", s, " did not panic\n") + } else if !contains(err.(error).Error(), "out of range") { + _, file, line, _ := runtime.Caller(2) + bug() + print(file, ":", line, ": ", s, " unexpected panic: ", err.(error).Error(), "\n") } }() f() } +func contains(x, y string) bool { + for i := 0; i+len(y) <= len(x); i++ { + if x[i:i+len(y)] == y { + return true + } + } + return false +} + + var X interface{} func use(y interface{}) { X = y @@ -146,11 +187,14 @@ func main() { // Array, pointer to array, slice. []string{"a", "pa", "s"}, - + // Element is int, element is quad (struct). // This controls whether we end up in gsubr.c (i) or cgen.c (q). []string{"i", "q"}, + // Small or big len. + []string{"", "b"}, + // Variable or constant. []string{"", "c"}, @@ -158,11 +202,11 @@ func main() { []string{"", "n"}, // Size of index. - []string{"j", "i", "i32", "i64", "i64big", "i64bigger", "huge"}, + []string{"j", "i", "i8", "i16", "i32", "i64", "i64big", "i64bigger", "huge"}, } forall(choices, func(x []string) { - p, a, e, c, n, i := x[0], x[1], x[2], x[3], x[4], x[5] + p, a, e, big, c, n, i := x[0], x[1], x[2], x[3], x[4], x[5], x[6] // Pass: dynamic=0, static=1, 2. // Which cases should be caught statically? @@ -184,10 +228,15 @@ func main() { thisPass = 2 } } + + // If we're using the big-len data, positive int8 and int16 cannot overflow. + if big == "b" && n == "" && (i == "i8" || i == "i16") { + return + } // Only print the test case if it is appropriate for this pass. if thisPass == *pass { - pae := p+a+e + pae := p+a+e+big cni := c+n+i // Index operation diff --git a/gcc/testsuite/go.test/test/indirect.go b/gcc/testsuite/go.test/test/indirect.go index cfddde9ce2b..bb20f3009bf 100644 --- a/gcc/testsuite/go.test/test/indirect.go +++ b/gcc/testsuite/go.test/test/indirect.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG indirect +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test various safe uses of indirection. + package main var m0 map[string]int diff --git a/gcc/testsuite/go.test/test/indirect1.go b/gcc/testsuite/go.test/test/indirect1.go index ecb4f138ace..51da4cc7c45 100644 --- a/gcc/testsuite/go.test/test/indirect1.go +++ b/gcc/testsuite/go.test/test/indirect1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that illegal uses of indirection are caught by the compiler. +// Does not compile. + package main var m0 map[string]int diff --git a/gcc/testsuite/go.test/test/init.go b/gcc/testsuite/go.test/test/init.go index 74c2d5c2614..f4689443cf1 100644 --- a/gcc/testsuite/go.test/test/init.go +++ b/gcc/testsuite/go.test/test/init.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that erroneous use of init is detected. +// Does not compile. + package main import "runtime" diff --git a/gcc/testsuite/go.test/test/init1.go b/gcc/testsuite/go.test/test/init1.go index 9ce3c12ee68..a888ad7440c 100644 --- a/gcc/testsuite/go.test/test/init1.go +++ b/gcc/testsuite/go.test/test/init1.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -16,10 +16,11 @@ func init() { c := make(chan int) go send(c) <-c - - const chunk = 1<<20 - runtime.UpdateMemStats() - sys := runtime.MemStats.Sys + + const chunk = 1 << 20 + memstats := new(runtime.MemStats) + runtime.ReadMemStats(memstats) + sys := memstats.Sys b := make([]byte, chunk) for i := range b { b[i] = byte(i%10 + '0') @@ -28,8 +29,8 @@ func init() { for i := 0; i < 1000; i++ { x = []byte(s) } - runtime.UpdateMemStats() - sys1 := runtime.MemStats.Sys + runtime.ReadMemStats(memstats) + sys1 := memstats.Sys if sys1-sys > chunk*50 { println("allocated 1000 chunks of", chunk, "and used ", sys1-sys, "memory") } @@ -41,4 +42,3 @@ func send(c chan int) { func main() { } - diff --git a/gcc/testsuite/go.test/test/initcomma.go b/gcc/testsuite/go.test/test/initcomma.go index 195d4575f76..a54fce42802 100644 --- a/gcc/testsuite/go.test/test/initcomma.go +++ b/gcc/testsuite/go.test/test/initcomma.go @@ -1,15 +1,17 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test trailing commas. DO NOT gofmt THIS FILE. + package main -var a = []int{1, 2} -var b = [5]int{1, 2, 3} -var c = []int{1} -var d = [...]int{1, 2, 3} +var a = []int{1, 2, } +var b = [5]int{1, 2, 3, } +var c = []int{1, } +var d = [...]int{1, 2, 3, } func main() { if len(a) != 2 { diff --git a/gcc/testsuite/go.test/test/initialize.go b/gcc/testsuite/go.test/test/initialize.go index 6dd7d67dc37..1307e020961 100644 --- a/gcc/testsuite/go.test/test/initialize.go +++ b/gcc/testsuite/go.test/test/initialize.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test initialization of package-level variables. + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/initializerr.go b/gcc/testsuite/go.test/test/initializerr.go index e7f8b0e92fe..48908c34786 100644 --- a/gcc/testsuite/go.test/test/initializerr.go +++ b/gcc/testsuite/go.test/test/initializerr.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that erroneous initialization expressions are caught by the compiler +// Does not compile. + package main type S struct { diff --git a/gcc/testsuite/go.test/test/initsyscall.go b/gcc/testsuite/go.test/test/initsyscall.go deleted file mode 100644 index d0c26d2a837..00000000000 --- a/gcc/testsuite/go.test/test/initsyscall.go +++ /dev/null @@ -1,26 +0,0 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This used to crash because the scheduler -// tried to kick off a new scheduling thread for f -// when time.Nanoseconds went into the system call. -// It's not okay to schedule new goroutines -// until main has started. - -package main - -import "time" - -func f() { -} - -func init() { - go f() - time.Now() -} - -func main() { -} diff --git a/gcc/testsuite/go.test/test/int_lit.go b/gcc/testsuite/go.test/test/int_lit.go index 2644e17b57d..78deaea1302 100644 --- a/gcc/testsuite/go.test/test/int_lit.go +++ b/gcc/testsuite/go.test/test/int_lit.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test integer literal syntax. + package main import "os" diff --git a/gcc/testsuite/go.test/test/intcvt.go b/gcc/testsuite/go.test/test/intcvt.go index 407bcfd9bae..3920528a403 100644 --- a/gcc/testsuite/go.test/test/intcvt.go +++ b/gcc/testsuite/go.test/test/intcvt.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test implicit and explicit conversions of constants. + package main const ( diff --git a/gcc/testsuite/go.test/test/interface/bigdata.go b/gcc/testsuite/go.test/test/interface/bigdata.go index 44f6ab127ea..0f2e9a990ec 100644 --- a/gcc/testsuite/go.test/test/interface/bigdata.go +++ b/gcc/testsuite/go.test/test/interface/bigdata.go @@ -1,11 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// check that big vs small, pointer vs not -// interface methods work. +// Test big vs. small, pointer vs. value interface methods. package main diff --git a/gcc/testsuite/go.test/test/interface/convert.go b/gcc/testsuite/go.test/test/interface/convert.go index 7f429f7031e..eb6fd1d5542 100644 --- a/gcc/testsuite/go.test/test/interface/convert.go +++ b/gcc/testsuite/go.test/test/interface/convert.go @@ -1,11 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check uses of all the different interface -// conversion runtime functions. +// Test all the different interface conversion runtime functions. package main diff --git a/gcc/testsuite/go.test/test/interface/convert1.go b/gcc/testsuite/go.test/test/interface/convert1.go index 658b1a92fa8..4a3ec8a375d 100644 --- a/gcc/testsuite/go.test/test/interface/convert1.go +++ b/gcc/testsuite/go.test/test/interface/convert1.go @@ -1,11 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that static interface conversion of -// interface value nil succeeds. +// Test static interface conversion of interface value nil. package main diff --git a/gcc/testsuite/go.test/test/interface/convert2.go b/gcc/testsuite/go.test/test/interface/convert2.go index 658b1a92fa8..4a3ec8a375d 100644 --- a/gcc/testsuite/go.test/test/interface/convert2.go +++ b/gcc/testsuite/go.test/test/interface/convert2.go @@ -1,11 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that static interface conversion of -// interface value nil succeeds. +// Test static interface conversion of interface value nil. package main diff --git a/gcc/testsuite/go.test/test/interface/embed.go b/gcc/testsuite/go.test/test/interface/embed.go index 2fddee1905a..5c52ac02323 100644 --- a/gcc/testsuite/go.test/test/interface/embed.go +++ b/gcc/testsuite/go.test/test/interface/embed.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check methods derived from embedded interface values. +// Test methods derived from embedded interface values. package main diff --git a/gcc/testsuite/go.test/test/interface/embed0.go b/gcc/testsuite/go.test/test/interface/embed0.go index bbd81e76038..e2ee20adeba 100644 --- a/gcc/testsuite/go.test/test/interface/embed0.go +++ b/gcc/testsuite/go.test/test/interface/embed0.go @@ -1,10 +1,10 @@ -// true # used by embed1.go +// skip # used by embed1.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that embedded interface types can have local methods. +// Test that embedded interface types can have local methods. package p diff --git a/gcc/testsuite/go.test/test/interface/embed1.go b/gcc/testsuite/go.test/test/interface/embed1.go index 24e50471f2d..07b873a633b 100644 --- a/gcc/testsuite/go.test/test/interface/embed1.go +++ b/gcc/testsuite/go.test/test/interface/embed1.go @@ -1,10 +1,13 @@ // $G $D/embed0.go && $G $D/$F.go && $L $F.$A && ./$A.out +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that embedded interface types can have local methods. +// Test that embedded interface types can have local methods. package main diff --git a/gcc/testsuite/go.test/test/interface/embed2.go b/gcc/testsuite/go.test/test/interface/embed2.go index c18a1fecec2..1636db78eb8 100644 --- a/gcc/testsuite/go.test/test/interface/embed2.go +++ b/gcc/testsuite/go.test/test/interface/embed2.go @@ -1,10 +1,10 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check methods derived from embedded interface and *interface values. +// Test methods derived from embedded interface and *interface values. package main diff --git a/gcc/testsuite/go.test/test/interface/explicit.go b/gcc/testsuite/go.test/test/interface/explicit.go index daae59b3618..eb81156e081 100644 --- a/gcc/testsuite/go.test/test/interface/explicit.go +++ b/gcc/testsuite/go.test/test/interface/explicit.go @@ -1,10 +1,11 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Static error messages about interface conversions. +// Verify compiler messages about erroneous static interface conversions. +// Does not compile. package main @@ -14,6 +15,10 @@ type T struct { var t *T +type X int + +func (x *X) M() {} + type I interface { M() } @@ -39,7 +44,7 @@ func main() { // because i has an extra method // that t does not, so i cannot contain a t. i = t // ERROR "incompatible|missing M method" - t = i // ERROR "incompatible|need type assertion" + t = i // ERROR "incompatible|assignment$" i = i2 // ok i2 = i // ERROR "incompatible|missing N method" @@ -65,6 +70,8 @@ func (Int) M(float64) {} var _ = m.(Int) // ERROR "impossible type assertion" +var _ = m.(X) // ERROR "pointer receiver" + var ii int var jj Int diff --git a/gcc/testsuite/go.test/test/interface/fail.go b/gcc/testsuite/go.test/test/interface/fail.go index 0c20bcf756a..72b854dc00c 100644 --- a/gcc/testsuite/go.test/test/interface/fail.go +++ b/gcc/testsuite/go.test/test/interface/fail.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that interface conversion fails when method is missing. +// Test that interface conversion fails when method is missing. package main diff --git a/gcc/testsuite/go.test/test/interface/fake.go b/gcc/testsuite/go.test/test/interface/fake.go index ddb83254278..861a640842f 100644 --- a/gcc/testsuite/go.test/test/interface/fake.go +++ b/gcc/testsuite/go.test/test/interface/fake.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Interface comparisons using types hidden +// Test interface comparisons using types hidden // inside reflected-on structs. package main diff --git a/gcc/testsuite/go.test/test/interface/noeq.go b/gcc/testsuite/go.test/test/interface/noeq.go index 3c2ea5975a1..1c5166ededf 100644 --- a/gcc/testsuite/go.test/test/interface/noeq.go +++ b/gcc/testsuite/go.test/test/interface/noeq.go @@ -1,10 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: interface/noeq +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Interface values containing types that cannot be compared for equality. +// Test run-time error detection for interface values containing types +// that cannot be compared for equality. package main diff --git a/gcc/testsuite/go.test/test/interface/pointer.go b/gcc/testsuite/go.test/test/interface/pointer.go index f1e363cbff6..2927050669a 100644 --- a/gcc/testsuite/go.test/test/interface/pointer.go +++ b/gcc/testsuite/go.test/test/interface/pointer.go @@ -1,10 +1,11 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that interface{M()} = *interface{M()} produces a compiler error. +// Test that interface{M()} = *interface{M()} produces a compiler error. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/interface/private.go b/gcc/testsuite/go.test/test/interface/private.go index 37890c923a5..0a42385ea7b 100644 --- a/gcc/testsuite/go.test/test/interface/private.go +++ b/gcc/testsuite/go.test/test/interface/private.go @@ -1,9 +1,15 @@ // $G $D/${F}1.go && errchk $G $D/$F.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that unexported methods are not visible outside the package. +// Does not compile. + package main import "./private1" diff --git a/gcc/testsuite/go.test/test/interface/private1.go b/gcc/testsuite/go.test/test/interface/private1.go index 3173fbef41f..3281c38be60 100644 --- a/gcc/testsuite/go.test/test/interface/private1.go +++ b/gcc/testsuite/go.test/test/interface/private1.go @@ -1,9 +1,11 @@ -// true # used by private.go +// skip # used by private.go // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Imported by private.go, which should not be able to see the private method. + package p type Exported interface { diff --git a/gcc/testsuite/go.test/test/interface/receiver.go b/gcc/testsuite/go.test/test/interface/receiver.go index f53daf8dab1..4511ab3b473 100644 --- a/gcc/testsuite/go.test/test/interface/receiver.go +++ b/gcc/testsuite/go.test/test/interface/receiver.go @@ -1,11 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Implicit methods for embedded types. -// Mixed pointer and non-pointer receivers. +// Test Implicit methods for embedded types and +// mixed pointer and non-pointer receivers. package main diff --git a/gcc/testsuite/go.test/test/interface/receiver1.go b/gcc/testsuite/go.test/test/interface/receiver1.go index 51312d00025..2b7ccdc1a7b 100644 --- a/gcc/testsuite/go.test/test/interface/receiver1.go +++ b/gcc/testsuite/go.test/test/interface/receiver1.go @@ -1,10 +1,11 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Error messages about missing implicit methods. +// Verify compiler complains about missing implicit methods. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/interface/recursive.go b/gcc/testsuite/go.test/test/interface/recursive.go index 1eb56e97672..fcc88331e0b 100644 --- a/gcc/testsuite/go.test/test/interface/recursive.go +++ b/gcc/testsuite/go.test/test/interface/recursive.go @@ -1,4 +1,4 @@ -// $G $D/$F.go || echo BUG: should compile +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -6,7 +6,7 @@ // Check mutually recursive interfaces -package main +package recursive type I1 interface { foo() I2 diff --git a/gcc/testsuite/go.test/test/interface/recursive1.go b/gcc/testsuite/go.test/test/interface/recursive1.go index 2c93a28363a..cc3cdc37f1a 100644 --- a/gcc/testsuite/go.test/test/interface/recursive1.go +++ b/gcc/testsuite/go.test/test/interface/recursive1.go @@ -1,9 +1,11 @@ -// true # used by recursive2 +// skip # used by recursive2 // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Mutually recursive type definitions imported and used by recursive1.go. + package p type I1 interface { diff --git a/gcc/testsuite/go.test/test/interface/recursive2.go b/gcc/testsuite/go.test/test/interface/recursive2.go index a7f9ab5dbd9..3a1059960cf 100644 --- a/gcc/testsuite/go.test/test/interface/recursive2.go +++ b/gcc/testsuite/go.test/test/interface/recursive2.go @@ -1,10 +1,13 @@ // $G $D/recursive1.go && $G $D/$F.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check that the mutually recursive types in recursive1.go made it +// Test that the mutually recursive types in recursive1.go made it // intact and with the same meaning, by assigning to or using them. package main diff --git a/gcc/testsuite/go.test/test/interface/returntype.go b/gcc/testsuite/go.test/test/interface/returntype.go index 5cf08361781..4d86f391840 100644 --- a/gcc/testsuite/go.test/test/interface/returntype.go +++ b/gcc/testsuite/go.test/test/interface/returntype.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check methods with different return types. +// Test interface methods with different return types are distinct. package main diff --git a/gcc/testsuite/go.test/test/interface/struct.go b/gcc/testsuite/go.test/test/interface/struct.go index 40b7f4f9101..f60819ca811 100644 --- a/gcc/testsuite/go.test/test/interface/struct.go +++ b/gcc/testsuite/go.test/test/interface/struct.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG interface6 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Interface values containing structures. +// Test interface values containing structures. package main diff --git a/gcc/testsuite/go.test/test/iota.go b/gcc/testsuite/go.test/test/iota.go index c40ca1f3824..7187dbe335e 100644 --- a/gcc/testsuite/go.test/test/iota.go +++ b/gcc/testsuite/go.test/test/iota.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test iota. + package main func assert(cond bool, msg string) { diff --git a/gcc/testsuite/go.test/test/ken/array.go b/gcc/testsuite/go.test/test/ken/array.go index 40209f5da37..9412e3502dd 100644 --- a/gcc/testsuite/go.test/test/ken/array.go +++ b/gcc/testsuite/go.test/test/ken/array.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test arrays and slices. + package main func setpd(a []int) { @@ -68,6 +70,9 @@ func testpdpd() { a = a[5:25] res(sumpd(a), 5, 25) + + a = a[30:95] + res(sumpd(a), 35, 100) } // call ptr fixed with ptr fixed diff --git a/gcc/testsuite/go.test/test/ken/chan.go b/gcc/testsuite/go.test/test/ken/chan.go index ef75b044d7c..36b18f80ea9 100644 --- a/gcc/testsuite/go.test/test/ken/chan.go +++ b/gcc/testsuite/go.test/test/ken/chan.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test communication operations including select. + package main import "os" diff --git a/gcc/testsuite/go.test/test/ken/chan1.go b/gcc/testsuite/go.test/test/ken/chan1.go index e5fc033f3d6..cbd21a3d69c 100644 --- a/gcc/testsuite/go.test/test/ken/chan1.go +++ b/gcc/testsuite/go.test/test/ken/chan1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test communication with multiple simultaneous goroutines. + package main import "runtime" diff --git a/gcc/testsuite/go.test/test/ken/complit.go b/gcc/testsuite/go.test/test/ken/complit.go index da0a84a043a..bc50bbe224c 100644 --- a/gcc/testsuite/go.test/test/ken/complit.go +++ b/gcc/testsuite/go.test/test/ken/complit.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test composite literals. + package main type M map[int]int diff --git a/gcc/testsuite/go.test/test/ken/convert.go b/gcc/testsuite/go.test/test/ken/convert.go index 3780ec886a4..33acbd8cd21 100644 --- a/gcc/testsuite/go.test/test/ken/convert.go +++ b/gcc/testsuite/go.test/test/ken/convert.go @@ -1,10 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// near-exhaustive test of converting numbers between types. +// Test, near-exhaustive, of converting numbers between types. +// No complex numbers though. package main diff --git a/gcc/testsuite/go.test/test/ken/cplx0.go b/gcc/testsuite/go.test/test/ken/cplx0.go index f38ce5b65d1..665e52a5f35 100644 --- a/gcc/testsuite/go.test/test/ken/cplx0.go +++ b/gcc/testsuite/go.test/test/ken/cplx0.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test trivial, bootstrap-level complex numbers, including printing. + package main const ( diff --git a/gcc/testsuite/go.test/test/ken/cplx1.go b/gcc/testsuite/go.test/test/ken/cplx1.go index 8ec7d40f5e5..78240a56397 100644 --- a/gcc/testsuite/go.test/test/ken/cplx1.go +++ b/gcc/testsuite/go.test/test/ken/cplx1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple arithmetic and assignment for complex numbers. + package main const ( diff --git a/gcc/testsuite/go.test/test/ken/cplx2.go b/gcc/testsuite/go.test/test/ken/cplx2.go index 89f4a04181e..eb1da7b8c0d 100644 --- a/gcc/testsuite/go.test/test/ken/cplx2.go +++ b/gcc/testsuite/go.test/test/ken/cplx2.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test arithmetic on complex numbers, including multiplication and division. + package main const ( diff --git a/gcc/testsuite/go.test/test/ken/cplx3.go b/gcc/testsuite/go.test/test/ken/cplx3.go index 048c93eef67..be0b8646ab8 100644 --- a/gcc/testsuite/go.test/test/ken/cplx3.go +++ b/gcc/testsuite/go.test/test/ken/cplx3.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test composition, decomposition, and reflection on complex numbers. + package main import "unsafe" diff --git a/gcc/testsuite/go.test/test/ken/cplx4.go b/gcc/testsuite/go.test/test/ken/cplx4.go index 738afcd2cad..97d5d16f4aa 100644 --- a/gcc/testsuite/go.test/test/ken/cplx4.go +++ b/gcc/testsuite/go.test/test/ken/cplx4.go @@ -1,9 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test complex numbers,including fmt support. +// Used to crash. + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/ken/cplx5.go b/gcc/testsuite/go.test/test/ken/cplx5.go index e6696674b0a..4e8f4433d3c 100644 --- a/gcc/testsuite/go.test/test/ken/cplx5.go +++ b/gcc/testsuite/go.test/test/ken/cplx5.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test compound types made of complex numbers. + package main var a [12]complex128 diff --git a/gcc/testsuite/go.test/test/ken/divconst.go b/gcc/testsuite/go.test/test/ken/divconst.go index 5a64d16b490..670e07417aa 100644 --- a/gcc/testsuite/go.test/test/ken/divconst.go +++ b/gcc/testsuite/go.test/test/ken/divconst.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test integer division by constants. + package main import "math/rand" diff --git a/gcc/testsuite/go.test/test/ken/divmod.go b/gcc/testsuite/go.test/test/ken/divmod.go index dc44ea245b9..f1bd56ec66b 100644 --- a/gcc/testsuite/go.test/test/ken/divmod.go +++ b/gcc/testsuite/go.test/test/ken/divmod.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test integer division and modulus. + package main const ( diff --git a/gcc/testsuite/go.test/test/ken/embed.go b/gcc/testsuite/go.test/test/ken/embed.go index 9805e479bb9..9b35c56acfd 100644 --- a/gcc/testsuite/go.test/test/ken/embed.go +++ b/gcc/testsuite/go.test/test/ken/embed.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test embedded fields of structs, including methods. + package main diff --git a/gcc/testsuite/go.test/test/ken/for.go b/gcc/testsuite/go.test/test/ken/for.go index 176ecd74930..db35548db85 100644 --- a/gcc/testsuite/go.test/test/ken/for.go +++ b/gcc/testsuite/go.test/test/ken/for.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple for loop. package main diff --git a/gcc/testsuite/go.test/test/ken/interbasic.go b/gcc/testsuite/go.test/test/ken/interbasic.go index 9bb50886a4a..d8fbb95a311 100644 --- a/gcc/testsuite/go.test/test/ken/interbasic.go +++ b/gcc/testsuite/go.test/test/ken/interbasic.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test interfaces on basic types. + package main type myint int diff --git a/gcc/testsuite/go.test/test/ken/interfun.go b/gcc/testsuite/go.test/test/ken/interfun.go index 94bc7eaada6..9432181df2a 100644 --- a/gcc/testsuite/go.test/test/ken/interfun.go +++ b/gcc/testsuite/go.test/test/ken/interfun.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test interfaces and methods. + package main type S struct { diff --git a/gcc/testsuite/go.test/test/ken/intervar.go b/gcc/testsuite/go.test/test/ken/intervar.go index 73d1b0660bd..8a2fca0d4bd 100644 --- a/gcc/testsuite/go.test/test/ken/intervar.go +++ b/gcc/testsuite/go.test/test/ken/intervar.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test interface assignment. + package main type Iputs interface { diff --git a/gcc/testsuite/go.test/test/ken/label.go b/gcc/testsuite/go.test/test/ken/label.go index 7a509f0484a..fcb3e611d9d 100644 --- a/gcc/testsuite/go.test/test/ken/label.go +++ b/gcc/testsuite/go.test/test/ken/label.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test goto and labels. + package main func main() { diff --git a/gcc/testsuite/go.test/test/ken/litfun.go b/gcc/testsuite/go.test/test/ken/litfun.go index bac2bc17cce..e241d4edb79 100644 --- a/gcc/testsuite/go.test/test/ken/litfun.go +++ b/gcc/testsuite/go.test/test/ken/litfun.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple function literals. package main diff --git a/gcc/testsuite/go.test/test/ken/mfunc.go b/gcc/testsuite/go.test/test/ken/mfunc.go index ae0bc0c58ab..ef2499194f7 100644 --- a/gcc/testsuite/go.test/test/ken/mfunc.go +++ b/gcc/testsuite/go.test/test/ken/mfunc.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple multi-argument multi-valued function. + package main func diff --git a/gcc/testsuite/go.test/test/ken/modconst.go b/gcc/testsuite/go.test/test/ken/modconst.go index c2603a0a099..d88cf100321 100644 --- a/gcc/testsuite/go.test/test/ken/modconst.go +++ b/gcc/testsuite/go.test/test/ken/modconst.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test integer modulus by contstants. + package main import "math/rand" diff --git a/gcc/testsuite/go.test/test/ken/ptrfun.go b/gcc/testsuite/go.test/test/ken/ptrfun.go index 6739ba33ae6..af806cfd928 100644 --- a/gcc/testsuite/go.test/test/ken/ptrfun.go +++ b/gcc/testsuite/go.test/test/ken/ptrfun.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test method invocation with pointer receivers and function-valued fields. package main diff --git a/gcc/testsuite/go.test/test/ken/ptrvar.go b/gcc/testsuite/go.test/test/ken/ptrvar.go index e2ddde62928..d78170c9d25 100644 --- a/gcc/testsuite/go.test/test/ken/ptrvar.go +++ b/gcc/testsuite/go.test/test/ken/ptrvar.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test pointers and the . (selector) operator on structs. package main diff --git a/gcc/testsuite/go.test/test/ken/range.go b/gcc/testsuite/go.test/test/ken/range.go index 9535fd497d6..89c14e5c35b 100644 --- a/gcc/testsuite/go.test/test/ken/range.go +++ b/gcc/testsuite/go.test/test/ken/range.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test 'for range' on arrays, slices, and maps. + package main const size = 16 diff --git a/gcc/testsuite/go.test/test/ken/rob1.go b/gcc/testsuite/go.test/test/ken/rob1.go index a5854b93e2f..3042a671bfb 100644 --- a/gcc/testsuite/go.test/test/ken/rob1.go +++ b/gcc/testsuite/go.test/test/ken/rob1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test general operation using a list implementation. + package main type Item interface { diff --git a/gcc/testsuite/go.test/test/ken/rob2.go b/gcc/testsuite/go.test/test/ken/rob2.go index d13e2441d40..4b4410ee859 100644 --- a/gcc/testsuite/go.test/test/ken/rob2.go +++ b/gcc/testsuite/go.test/test/ken/rob2.go @@ -1,9 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test general operation using s-list. +// First Go program ever run (although not in this exact form). + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/ken/robfor.go b/gcc/testsuite/go.test/test/ken/robfor.go index 05188a47232..c6a420b39d7 100644 --- a/gcc/testsuite/go.test/test/ken/robfor.go +++ b/gcc/testsuite/go.test/test/ken/robfor.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test for loops of many forms. + package main func assertequal(is, shouldbe int, msg string) { diff --git a/gcc/testsuite/go.test/test/ken/robfunc.go b/gcc/testsuite/go.test/test/ken/robfunc.go index 6b3d4b2e460..885267e30c2 100644 --- a/gcc/testsuite/go.test/test/ken/robfunc.go +++ b/gcc/testsuite/go.test/test/ken/robfunc.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test functions of many signatures. + package main func assertequal(is, shouldbe int, msg string) { diff --git a/gcc/testsuite/go.test/test/ken/shift.go b/gcc/testsuite/go.test/test/ken/shift.go index 157a07aec54..af8789615ee 100644 --- a/gcc/testsuite/go.test/test/ken/shift.go +++ b/gcc/testsuite/go.test/test/ken/shift.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test shift. + package main var ians [18]int; diff --git a/gcc/testsuite/go.test/test/ken/simparray.go b/gcc/testsuite/go.test/test/ken/simparray.go index 1b6f245eea2..0e81a341b85 100644 --- a/gcc/testsuite/go.test/test/ken/simparray.go +++ b/gcc/testsuite/go.test/test/ken/simparray.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple operations on arrays. + package main var b[10] float32; diff --git a/gcc/testsuite/go.test/test/ken/simpbool.go b/gcc/testsuite/go.test/test/ken/simpbool.go index dbd9c8d8bcf..ab2ecc21aad 100644 --- a/gcc/testsuite/go.test/test/ken/simpbool.go +++ b/gcc/testsuite/go.test/test/ken/simpbool.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test basic operations on bool. + package main type s struct { diff --git a/gcc/testsuite/go.test/test/ken/simpconv.go b/gcc/testsuite/go.test/test/ken/simpconv.go index feb85d29997..22cad2ad0e4 100644 --- a/gcc/testsuite/go.test/test/ken/simpconv.go +++ b/gcc/testsuite/go.test/test/ken/simpconv.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple arithmetic conversion. + package main type vlong int64 diff --git a/gcc/testsuite/go.test/test/ken/simpfun.go b/gcc/testsuite/go.test/test/ken/simpfun.go index ba9ce6f7bce..e5dc2b24955 100644 --- a/gcc/testsuite/go.test/test/ken/simpfun.go +++ b/gcc/testsuite/go.test/test/ken/simpfun.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple functions. package main diff --git a/gcc/testsuite/go.test/test/ken/simpswitch.go b/gcc/testsuite/go.test/test/ken/simpswitch.go index 710af2e08c6..b28250b1d38 100644 --- a/gcc/testsuite/go.test/test/ken/simpswitch.go +++ b/gcc/testsuite/go.test/test/ken/simpswitch.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple switch. + package main func main() { diff --git a/gcc/testsuite/go.test/test/ken/simpvar.go b/gcc/testsuite/go.test/test/ken/simpvar.go index fd060b0e2e9..c6eefbb5add 100644 --- a/gcc/testsuite/go.test/test/ken/simpvar.go +++ b/gcc/testsuite/go.test/test/ken/simpvar.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test scoping of variables. + package main diff --git a/gcc/testsuite/go.test/test/ken/slicearray.go b/gcc/testsuite/go.test/test/ken/slicearray.go index 5c31270fcd3..6cf676c588b 100644 --- a/gcc/testsuite/go.test/test/ken/slicearray.go +++ b/gcc/testsuite/go.test/test/ken/slicearray.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test basic operations of slices and arrays. + package main var bx [10]byte diff --git a/gcc/testsuite/go.test/test/ken/sliceslice.go b/gcc/testsuite/go.test/test/ken/sliceslice.go index 63904212877..c07c591252d 100644 --- a/gcc/testsuite/go.test/test/ken/sliceslice.go +++ b/gcc/testsuite/go.test/test/ken/sliceslice.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test slicing and re-slicing. + package main var bx []byte diff --git a/gcc/testsuite/go.test/test/ken/string.go b/gcc/testsuite/go.test/test/ken/string.go index e0510824293..6df8dc4ddf1 100644 --- a/gcc/testsuite/go.test/test/ken/string.go +++ b/gcc/testsuite/go.test/test/ken/string.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test string operations including printing. package main diff --git a/gcc/testsuite/go.test/test/ken/strvar.go b/gcc/testsuite/go.test/test/ken/strvar.go index dfaaf12131c..4d511fe6735 100644 --- a/gcc/testsuite/go.test/test/ken/strvar.go +++ b/gcc/testsuite/go.test/test/ken/strvar.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test struct-valued variables (not pointers). package main diff --git a/gcc/testsuite/go.test/test/label.go b/gcc/testsuite/go.test/test/label.go index e3d853266e1..b30c27ec44b 100644 --- a/gcc/testsuite/go.test/test/label.go +++ b/gcc/testsuite/go.test/test/label.go @@ -1,10 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Pass 1 label errors. +// Verify that erroneous labels are caught by the compiler. +// This set is caught by pass 1. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/label1.go b/gcc/testsuite/go.test/test/label1.go index 656daaeea54..f923a18820e 100644 --- a/gcc/testsuite/go.test/test/label1.go +++ b/gcc/testsuite/go.test/test/label1.go @@ -1,10 +1,13 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Pass 2 label errors. + +// Verify that erroneous labels are caught by the compiler. +// This set is caught by pass 2. That's why this file is label1.go. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/linkx.go b/gcc/testsuite/go.test/test/linkx.go new file mode 100644 index 00000000000..12d446ffc13 --- /dev/null +++ b/gcc/testsuite/go.test/test/linkx.go @@ -0,0 +1,20 @@ +// $G $D/$F.go && $L -X main.tbd hello $F.$A && ./$A.out + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test the -X facility of the gc linker (6l etc.). + +package main + +var tbd string + +func main() { + if tbd != "hello" { + println("BUG: test/linkx", len(tbd), tbd) + } +} diff --git a/gcc/testsuite/go.test/test/literal.go b/gcc/testsuite/go.test/test/literal.go index bf05388127c..ba185fc9ace 100644 --- a/gcc/testsuite/go.test/test/literal.go +++ b/gcc/testsuite/go.test/test/literal.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test literal syntax for basic types. + package main var nbad int diff --git a/gcc/testsuite/go.test/test/mallocfin.go b/gcc/testsuite/go.test/test/mallocfin.go index ff62392473d..be6d79b2b8e 100644 --- a/gcc/testsuite/go.test/test/mallocfin.go +++ b/gcc/testsuite/go.test/test/mallocfin.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// trivial finalizer test +// Test basic operation of finalizers. package main diff --git a/gcc/testsuite/go.test/test/map.go b/gcc/testsuite/go.test/test/map.go index c3963499bce..6dec0dfd719 100644 --- a/gcc/testsuite/go.test/test/map.go +++ b/gcc/testsuite/go.test/test/map.go @@ -1,14 +1,18 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test maps, almost exhaustively. + package main import ( "fmt" + "math" "strconv" + "time" ) const count = 100 @@ -26,6 +30,12 @@ func P(a []string) string { } func main() { + testbasic() + testfloat() + testnan() +} + +func testbasic() { // Test a map literal. mlit := map[string]int{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4} for i := 0; i < len(mlit); i++ { @@ -479,7 +489,7 @@ func main() { mipM[i][i]++ if mipM[i][i] != (i+1)+1 { - fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i]) + fmt.Printf("update mipM[%d][%d] = %d\n", i, i, mipM[i][i]) } } @@ -489,3 +499,195 @@ func main() { panic("range mnil") } } + +func testfloat() { + // Test floating point numbers in maps. + // Two map keys refer to the same entry if the keys are ==. + // The special cases, then, are that +0 == -0 and that NaN != NaN. + + { + var ( + pz = float32(0) + nz = math.Float32frombits(1 << 31) + nana = float32(math.NaN()) + nanb = math.Float32frombits(math.Float32bits(nana) ^ 2) + ) + + m := map[float32]string{ + pz: "+0", + nana: "NaN", + nanb: "NaN", + } + if m[pz] != "+0" { + fmt.Println("float32 map cannot read back m[+0]:", m[pz]) + } + if m[nz] != "+0" { + fmt.Println("float32 map does not treat", pz, "and", nz, "as equal for read") + fmt.Println("float32 map does not treat -0 and +0 as equal for read") + } + m[nz] = "-0" + if m[pz] != "-0" { + fmt.Println("float32 map does not treat -0 and +0 as equal for write") + } + if _, ok := m[nana]; ok { + fmt.Println("float32 map allows NaN lookup (a)") + } + if _, ok := m[nanb]; ok { + fmt.Println("float32 map allows NaN lookup (b)") + } + if len(m) != 3 { + fmt.Println("float32 map should have 3 entries:", m) + } + m[nana] = "NaN" + m[nanb] = "NaN" + if len(m) != 5 { + fmt.Println("float32 map should have 5 entries:", m) + } + } + + { + var ( + pz = float64(0) + nz = math.Float64frombits(1 << 63) + nana = float64(math.NaN()) + nanb = math.Float64frombits(math.Float64bits(nana) ^ 2) + ) + + m := map[float64]string{ + pz: "+0", + nana: "NaN", + nanb: "NaN", + } + if m[nz] != "+0" { + fmt.Println("float64 map does not treat -0 and +0 as equal for read") + } + m[nz] = "-0" + if m[pz] != "-0" { + fmt.Println("float64 map does not treat -0 and +0 as equal for write") + } + if _, ok := m[nana]; ok { + fmt.Println("float64 map allows NaN lookup (a)") + } + if _, ok := m[nanb]; ok { + fmt.Println("float64 map allows NaN lookup (b)") + } + if len(m) != 3 { + fmt.Println("float64 map should have 3 entries:", m) + } + m[nana] = "NaN" + m[nanb] = "NaN" + if len(m) != 5 { + fmt.Println("float64 map should have 5 entries:", m) + } + } + + { + var ( + pz = complex64(0) + nz = complex(0, math.Float32frombits(1<<31)) + nana = complex(5, float32(math.NaN())) + nanb = complex(5, math.Float32frombits(math.Float32bits(float32(math.NaN()))^2)) + ) + + m := map[complex64]string{ + pz: "+0", + nana: "NaN", + nanb: "NaN", + } + if m[nz] != "+0" { + fmt.Println("complex64 map does not treat -0 and +0 as equal for read") + } + m[nz] = "-0" + if m[pz] != "-0" { + fmt.Println("complex64 map does not treat -0 and +0 as equal for write") + } + if _, ok := m[nana]; ok { + fmt.Println("complex64 map allows NaN lookup (a)") + } + if _, ok := m[nanb]; ok { + fmt.Println("complex64 map allows NaN lookup (b)") + } + if len(m) != 3 { + fmt.Println("complex64 map should have 3 entries:", m) + } + m[nana] = "NaN" + m[nanb] = "NaN" + if len(m) != 5 { + fmt.Println("complex64 map should have 5 entries:", m) + } + } + + { + var ( + pz = complex128(0) + nz = complex(0, math.Float64frombits(1<<63)) + nana = complex(5, float64(math.NaN())) + nanb = complex(5, math.Float64frombits(math.Float64bits(float64(math.NaN()))^2)) + ) + + m := map[complex128]string{ + pz: "+0", + nana: "NaN", + nanb: "NaN", + } + if m[nz] != "+0" { + fmt.Println("complex128 map does not treat -0 and +0 as equal for read") + } + m[nz] = "-0" + if m[pz] != "-0" { + fmt.Println("complex128 map does not treat -0 and +0 as equal for write") + } + if _, ok := m[nana]; ok { + fmt.Println("complex128 map allows NaN lookup (a)") + } + if _, ok := m[nanb]; ok { + fmt.Println("complex128 map allows NaN lookup (b)") + } + if len(m) != 3 { + fmt.Println("complex128 map should have 3 entries:", m) + } + m[nana] = "NaN" + m[nanb] = "NaN" + if len(m) != 5 { + fmt.Println("complex128 map should have 5 entries:", m) + } + } +} + +func testnan() { + // Test that NaNs in maps don't go quadratic. + t := func(n int) time.Duration { + t0 := time.Now() + m := map[float64]int{} + nan := math.NaN() + for i := 0; i < n; i++ { + m[nan] = 1 + } + if len(m) != n { + panic("wrong size map after nan insertion") + } + return time.Since(t0) + } + + // Depending on the machine and OS, this test might be too fast + // to measure with accurate enough granularity. On failure, + // make it run longer, hoping that the timing granularity + // is eventually sufficient. + + n := 30000 // 0.02 seconds on a MacBook Air + fails := 0 + for { + t1 := t(n) + t2 := t(2 * n) + // should be 2x (linear); allow up to 3x + if t2 < 3*t1 { + return + } + fails++ + if fails == 4 { + fmt.Printf("too slow: %d inserts: %v; %d inserts: %v\n", n, t1, 2*n, t2) + return + } + n *= 2 + } +} diff --git a/gcc/testsuite/go.test/test/map1.go b/gcc/testsuite/go.test/test/map1.go index 6af10565cd1..6f1a1c8ac01 100644 --- a/gcc/testsuite/go.test/test/map1.go +++ b/gcc/testsuite/go.test/test/map1.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test map declarations of many types, including erroneous ones. +// Does not compile. + package main func main() {} @@ -38,4 +41,22 @@ var ( _ map[[]int]v // ERROR "invalid map key" _ map[func()]v // ERROR "invalid map key" _ map[map[int]int]v // ERROR "invalid map key" + _ map[T1]v // ERROR "invalid map key" + _ map[T2]v // ERROR "invalid map key" + _ map[T3]v // ERROR "invalid map key" + _ map[T4]v // ERROR "invalid map key" + _ map[T5]v + _ map[T6]v + _ map[T7]v + _ map[T8]v ) + +type T1 []int +type T2 struct { F T1 } +type T3 []T4 +type T4 struct { F T3 } + +type T5 *int +type T6 struct { F T5 } +type T7 *T4 +type T8 struct { F *T7 } diff --git a/gcc/testsuite/go.test/test/method.go b/gcc/testsuite/go.test/test/method.go index b5a02c6873e..0c239afbd19 100644 --- a/gcc/testsuite/go.test/test/method.go +++ b/gcc/testsuite/go.test/test/method.go @@ -1,9 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple methods of various types, with pointer and +// value receivers. + package main type S string @@ -91,27 +94,27 @@ func main() { } if val(s) != 1 { - println("s.val:", val(s)) + println("val(s):", val(s)) panic("fail") } if val(ps) != 2 { - println("ps.val:", val(ps)) + println("val(ps):", val(ps)) panic("fail") } if val(i) != 3 { - println("i.val:", val(i)) + println("val(i):", val(i)) panic("fail") } if val(pi) != 4 { - println("pi.val:", val(pi)) + println("val(pi):", val(pi)) panic("fail") } if val(t) != 7 { - println("t.val:", val(t)) + println("val(t):", val(t)) panic("fail") } if val(pt) != 8 { - println("pt.val:", val(pt)) + println("val(pt):", val(pt)) panic("fail") } @@ -124,4 +127,124 @@ func main() { println("Val.val(v):", Val.val(v)) panic("fail") } + + var zs struct { S } + var zps struct { *S1 } + var zi struct { I } + var zpi struct { *I1 } + var zpt struct { *T1 } + var zt struct { T } + var zv struct { Val } + + if zs.val() != 1 { + println("zs.val:", zs.val()) + panic("fail") + } + if zps.val() != 2 { + println("zps.val:", zps.val()) + panic("fail") + } + if zi.val() != 3 { + println("zi.val:", zi.val()) + panic("fail") + } + if zpi.val() != 4 { + println("zpi.val:", zpi.val()) + panic("fail") + } + if zt.val() != 7 { + println("zt.val:", zt.val()) + panic("fail") + } + if zpt.val() != 8 { + println("zpt.val:", zpt.val()) + panic("fail") + } + + if val(zs) != 1 { + println("val(zs):", val(zs)) + panic("fail") + } + if val(zps) != 2 { + println("val(zps):", val(zps)) + panic("fail") + } + if val(zi) != 3 { + println("val(zi):", val(zi)) + panic("fail") + } + if val(zpi) != 4 { + println("val(zpi):", val(zpi)) + panic("fail") + } + if val(zt) != 7 { + println("val(zt):", val(zt)) + panic("fail") + } + if val(zpt) != 8 { + println("val(zpt):", val(zpt)) + panic("fail") + } + + zv.Val = zi + if zv.val() != 3 { + println("zv.val():", zv.val()) + panic("fail") + } + + if (&zs).val() != 1 { + println("(&zs).val:", (&zs).val()) + panic("fail") + } + if (&zps).val() != 2 { + println("(&zps).val:", (&zps).val()) + panic("fail") + } + if (&zi).val() != 3 { + println("(&zi).val:", (&zi).val()) + panic("fail") + } + if (&zpi).val() != 4 { + println("(&zpi).val:", (&zpi).val()) + panic("fail") + } + if (&zt).val() != 7 { + println("(&zt).val:", (&zt).val()) + panic("fail") + } + if (&zpt).val() != 8 { + println("(&zpt).val:", (&zpt).val()) + panic("fail") + } + + if val(&zs) != 1 { + println("val(&zs):", val(&zs)) + panic("fail") + } + if val(&zps) != 2 { + println("val(&zps):", val(&zps)) + panic("fail") + } + if val(&zi) != 3 { + println("val(&zi):", val(&zi)) + panic("fail") + } + if val(&zpi) != 4 { + println("val(&zpi):", val(&zpi)) + panic("fail") + } + if val(&zt) != 7 { + println("val(&zt):", val(&zt)) + panic("fail") + } + if val(&zpt) != 8 { + println("val(&zpt):", val(&zpt)) + panic("fail") + } + + zv.Val = &zi + if zv.val() != 3 { + println("zv.val():", zv.val()) + panic("fail") + } } diff --git a/gcc/testsuite/go.test/test/method1.go b/gcc/testsuite/go.test/test/method1.go index ec14ef9e4f4..365b8ca553d 100644 --- a/gcc/testsuite/go.test/test/method1.go +++ b/gcc/testsuite/go.test/test/method1.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that method redeclarations are caught by the compiler. +// Does not compile. + package main type T struct { } diff --git a/gcc/testsuite/go.test/test/method2.go b/gcc/testsuite/go.test/test/method2.go index 039779efbe1..b63da10dc69 100644 --- a/gcc/testsuite/go.test/test/method2.go +++ b/gcc/testsuite/go.test/test/method2.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that pointers and interface types cannot be method receivers. +// Does not compile. + package main type T struct { diff --git a/gcc/testsuite/go.test/test/method3.go b/gcc/testsuite/go.test/test/method3.go index 7946a87502b..fd64771527e 100644 --- a/gcc/testsuite/go.test/test/method3.go +++ b/gcc/testsuite/go.test/test/method3.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG method3 +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// test that methods on slices work +// Test methods on slices. package main diff --git a/gcc/testsuite/go.test/test/method4.go b/gcc/testsuite/go.test/test/method4.go new file mode 100644 index 00000000000..7e7b1ff3b96 --- /dev/null +++ b/gcc/testsuite/go.test/test/method4.go @@ -0,0 +1,109 @@ +// $G $D/method4a.go && $G $D/$F.go && $L $F.$A && ./$A.out + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test method expressions with arguments. + +package main + +import "./method4a" + +type T1 int + +type T2 struct { + f int +} + +type I1 interface { + Sum([]int, int) int +} + +type I2 interface { + Sum(a []int, b int) int +} + +func (i T1) Sum(a []int, b int) int { + r := int(i) + b + for _, v := range a { + r += v + } + return r +} + +func (p *T2) Sum(a []int, b int) int { + r := p.f + b + for _, v := range a { + r += v + } + return r +} + +func eq(v1, v2 int) { + if v1 != v2 { + panic(0) + } +} + +func main() { + a := []int{1, 2, 3} + t1 := T1(4) + t2 := &T2{4} + + eq(t1.Sum(a, 5), 15) + eq(t2.Sum(a, 6), 16) + + eq(T1.Sum(t1, a, 7), 17) + eq((*T2).Sum(t2, a, 8), 18) + + f1 := T1.Sum + eq(f1(t1, a, 9), 19) + f2 := (*T2).Sum + eq(f2(t2, a, 10), 20) + + eq(I1.Sum(t1, a, 11), 21) + eq(I1.Sum(t2, a, 12), 22) + + f3 := I1.Sum + eq(f3(t1, a, 13), 23) + eq(f3(t2, a, 14), 24) + + eq(I2.Sum(t1, a, 15), 25) + eq(I2.Sum(t2, a, 16), 26) + + f4 := I2.Sum + eq(f4(t1, a, 17), 27) + eq(f4(t2, a, 18), 28) + + mt1 := method4a.T1(4) + mt2 := &method4a.T2{4} + + eq(mt1.Sum(a, 30), 40) + eq(mt2.Sum(a, 31), 41) + + eq(method4a.T1.Sum(mt1, a, 32), 42) + eq((*method4a.T2).Sum(mt2, a, 33), 43) + + g1 := method4a.T1.Sum + eq(g1(mt1, a, 34), 44) + g2 := (*method4a.T2).Sum + eq(g2(mt2, a, 35), 45) + + eq(method4a.I1.Sum(mt1, a, 36), 46) + eq(method4a.I1.Sum(mt2, a, 37), 47) + + g3 := method4a.I1.Sum + eq(g3(mt1, a, 38), 48) + eq(g3(mt2, a, 39), 49) + + eq(method4a.I2.Sum(mt1, a, 40), 50) + eq(method4a.I2.Sum(mt2, a, 41), 51) + + g4 := method4a.I2.Sum + eq(g4(mt1, a, 42), 52) + eq(g4(mt2, a, 43), 53) +} diff --git a/gcc/testsuite/go.test/test/method4a.go b/gcc/testsuite/go.test/test/method4a.go new file mode 100644 index 00000000000..d23039bfaaa --- /dev/null +++ b/gcc/testsuite/go.test/test/method4a.go @@ -0,0 +1,40 @@ +// skip + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test method expressions with arguments. +// This file is not tested by itself; it is imported by method4.go. + +package method4a + +type T1 int + +type T2 struct { + F int +} + +type I1 interface { + Sum([]int, int) int +} + +type I2 interface { + Sum(a []int, b int) int +} + +func (i T1) Sum(a []int, b int) int { + r := int(i) + b + for _, v := range a { + r += v + } + return r +} + +func (p *T2) Sum(a []int, b int) int { + r := p.F + b + for _, v := range a { + r += v + } + return r +} diff --git a/gcc/testsuite/go.test/test/named.go b/gcc/testsuite/go.test/test/named.go index 5b6bb81fe34..d0330ab2389 100644 --- a/gcc/testsuite/go.test/test/named.go +++ b/gcc/testsuite/go.test/test/named.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/named1.go b/gcc/testsuite/go.test/test/named1.go index 561d84a43dc..62b874c5cb9 100644 --- a/gcc/testsuite/go.test/test/named1.go +++ b/gcc/testsuite/go.test/test/named1.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -6,6 +6,7 @@ // Test that basic operations on named types are valid // and preserve the type. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/nil.go b/gcc/testsuite/go.test/test/nil.go index efcf4f7822b..9f7bcbb59fd 100644 --- a/gcc/testsuite/go.test/test/nil.go +++ b/gcc/testsuite/go.test/test/nil.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test nil. + package main import ( diff --git a/gcc/testsuite/go.test/test/nilptr.go b/gcc/testsuite/go.test/test/nilptr.go index b0c1df2d95c..b784914e590 100644 --- a/gcc/testsuite/go.test/test/nilptr.go +++ b/gcc/testsuite/go.test/test/nilptr.go @@ -1,9 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that the implementation catches nil ptr indirection +// in a large address space. + package main import "unsafe" diff --git a/gcc/testsuite/go.test/test/nul1.go b/gcc/testsuite/go.test/test/nul1.go index 142d4deb1f4..968c9529513 100644 --- a/gcc/testsuite/go.test/test/nul1.go +++ b/gcc/testsuite/go.test/test/nul1.go @@ -3,6 +3,9 @@ // errchk $G -e tmp.go // rm -f tmp.go +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/gcc/testsuite/go.test/test/parentype.go b/gcc/testsuite/go.test/test/parentype.go index 1872cd0ebc9..eafa076481a 100644 --- a/gcc/testsuite/go.test/test/parentype.go +++ b/gcc/testsuite/go.test/test/parentype.go @@ -1,9 +1,11 @@ -// $G $D/$F.go +// compile // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that types can be parenthesized. + package main func f(interface{}) diff --git a/gcc/testsuite/go.test/test/peano.go b/gcc/testsuite/go.test/test/peano.go index dd4c36e0b43..745f5153f6b 100644 --- a/gcc/testsuite/go.test/test/peano.go +++ b/gcc/testsuite/go.test/test/peano.go @@ -1,9 +1,12 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that heavy recursion works. Simple torture test for +// segmented stacks: do math in unary by recursion. + package main type Number *Number diff --git a/gcc/testsuite/go.test/test/printbig.go b/gcc/testsuite/go.test/test/printbig.go index d867bdc646c..5693c58d4f6 100644 --- a/gcc/testsuite/go.test/test/printbig.go +++ b/gcc/testsuite/go.test/test/printbig.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +// cmpout // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that big numbers work as constants and print can print them. + package main func main() { diff --git a/gcc/testsuite/go.test/test/range.go b/gcc/testsuite/go.test/test/range.go index 84119450b28..68b0c9a2f33 100644 --- a/gcc/testsuite/go.test/test/range.go +++ b/gcc/testsuite/go.test/test/range.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test the 'for range' construct. + package main // test range over channels @@ -56,6 +58,17 @@ func testslice() { println("wrong sum ranging over makeslice") panic("fail") } + + x := []int{10, 20} + y := []int{99} + i := 1 + for i, x[i] = range y { + break + } + if i != 0 || x[0] != 10 || x[1] != 99 { + println("wrong parallel assignment", i, x[0], x[1]) + panic("fail") + } } func testslice1() { diff --git a/gcc/testsuite/go.test/test/recover.go b/gcc/testsuite/go.test/test/recover.go index ca6f0728860..eea655ec578 100644 --- a/gcc/testsuite/go.test/test/recover.go +++ b/gcc/testsuite/go.test/test/recover.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -244,3 +244,30 @@ func test7() { die() } } + +func varargs(s *int, a ...int) { + *s = 0 + for _, v := range a { + *s += v + } + if recover() != nil { + *s += 100 + } +} + +func test8a() (r int) { + defer varargs(&r, 1, 2, 3) + panic(0) +} + +func test8b() (r int) { + defer varargs(&r, 4, 5, 6) + return +} + +func test8() { + if test8a() != 106 || test8b() != 15 { + println("wrong value") + die() + } +} diff --git a/gcc/testsuite/go.test/test/recover1.go b/gcc/testsuite/go.test/test/recover1.go index db584738bb5..b763a107417 100644 --- a/gcc/testsuite/go.test/test/recover1.go +++ b/gcc/testsuite/go.test/test/recover1.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/recover2.go b/gcc/testsuite/go.test/test/recover2.go index b5db6f0d1ca..946d05ae637 100644 --- a/gcc/testsuite/go.test/test/recover2.go +++ b/gcc/testsuite/go.test/test/recover2.go @@ -1,4 +1,4 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/recover3.go b/gcc/testsuite/go.test/test/recover3.go index 60ade9b61c5..98700231ef5 100644 --- a/gcc/testsuite/go.test/test/recover3.go +++ b/gcc/testsuite/go.test/test/recover3.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test recovering from runtime errors. + package main import ( diff --git a/gcc/testsuite/go.test/test/rename.go b/gcc/testsuite/go.test/test/rename.go index f21ef015b22..e5442745538 100644 --- a/gcc/testsuite/go.test/test/rename.go +++ b/gcc/testsuite/go.test/test/rename.go @@ -1,73 +1,99 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that predeclared names can be redeclared by the user. + package main import "fmt" func main() { n := - bool + + append + + bool + byte + - float + + complex + + complex64 + + complex128 + + cap + + close + + delete + + error + + false + float32 + float64 + + imag + int + int8 + int16 + int32 + int64 + + len + + make + + new + + nil + + panic + + print + + println + + real + + recover + + rune + + string + + true + uint + uint8 + uint16 + uint32 + uint64 + uintptr + - true + - false + - iota + - nil + - cap + - len + - make + - new + - panic + - print + - println - if n != 27*28/2 { - fmt.Println("BUG: wrong n", n, 27*28/2) + iota + if n != NUM*(NUM-1)/2 { + fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2) } } const ( - bool = 1 - byte = 2 - float = 3 - float32 = 4 - float64 = 5 - int = 6 - int8 = 7 - int16 = 8 - int32 = 9 - int64 = 10 - uint = 11 - uint8 = 12 - uint16 = 13 - uint32 = 14 - uint64 = 15 - uintptr = 16 - true = 17 - false = 18 - iota = 19 - nil = 20 - cap = 21 - len = 22 - make = 23 - new = 24 - panic = 25 - print = 26 - println = 27 + // cannot use iota here, because iota = 38 below + append = 1 + bool = 2 + byte = 3 + complex = 4 + complex64 = 5 + complex128 = 6 + cap = 7 + close = 8 + delete = 9 + error = 10 + false = 11 + float32 = 12 + float64 = 13 + imag = 14 + int = 15 + int8 = 16 + int16 = 17 + int32 = 18 + int64 = 19 + len = 20 + make = 21 + new = 22 + nil = 23 + panic = 24 + print = 25 + println = 26 + real = 27 + recover = 28 + rune = 29 + string = 30 + true = 31 + uint = 32 + uint8 = 33 + uint16 = 34 + uint32 = 35 + uint64 = 36 + uintptr = 37 + iota = 38 + NUM = 39 ) diff --git a/gcc/testsuite/go.test/test/rename1.go b/gcc/testsuite/go.test/test/rename1.go index 3e78bfca0bc..53db68de16e 100644 --- a/gcc/testsuite/go.test/test/rename1.go +++ b/gcc/testsuite/go.test/test/rename1.go @@ -1,14 +1,17 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that renamed identifiers no longer have their old meaning. +// Does not compile. + package main func main() { var n byte // ERROR "not a type|expected type" - var y = float(0) // ERROR "cannot call|expected function" + var y = float32(0) // ERROR "cannot call|expected function" const ( a = 1 + iota // ERROR "string|incompatible types" "convert iota" ) @@ -16,31 +19,42 @@ func main() { } const ( - bool = 1 - byte = 2 - float = 3 - float32 = 4 - float64 = 5 - int = 6 - int8 = 7 - int16 = 8 - int32 = 9 - int64 = 10 - uint = 11 - uint8 = 12 - uint16 = 13 - uint32 = 14 - uint64 = 15 - uintptr = 16 - true = 17 - false = 18 - iota = "abc" - nil = 20 - cap = 21 - len = 22 - make = 23 - new = 24 - panic = 25 - print = 26 - println = 27 + append = 1 + bool = 2 + byte = 3 + complex = 4 + complex64 = 5 + complex128 = 6 + cap = 7 + close = 8 + delete = 9 + error = 10 + false = 11 + float32 = 12 + float64 = 13 + imag = 14 + int = 15 + int8 = 16 + int16 = 17 + int32 = 18 + int64 = 19 + len = 20 + make = 21 + new = 22 + nil = 23 + panic = 24 + print = 25 + println = 26 + real = 27 + recover = 28 + rune = 29 + string = 30 + true = 31 + uint = 32 + uint8 = 33 + uint16 = 34 + uint32 = 35 + uint64 = 36 + uintptr = 37 + iota = "38" ) diff --git a/gcc/testsuite/go.test/test/reorder.go b/gcc/testsuite/go.test/test/reorder.go index 67d07523b41..0cdeebd0f31 100644 --- a/gcc/testsuite/go.test/test/reorder.go +++ b/gcc/testsuite/go.test/test/reorder.go @@ -1,10 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check reordering of assignments. +// Test reordering of assignments. package main @@ -19,6 +19,7 @@ func main() { p6() p7() p8() + p9() } var gx []int @@ -119,3 +120,11 @@ func p8() { i := 0 i, x[i], x[5] = 1, 100, 500 } + +func p9() { + m := make(map[int]int) + m[0] = len(m) + if m[0] != 0 { + panic(m[0]) + } +} diff --git a/gcc/testsuite/go.test/test/reorder2.go b/gcc/testsuite/go.test/test/reorder2.go new file mode 100644 index 00000000000..d91f1d89531 --- /dev/null +++ b/gcc/testsuite/go.test/test/reorder2.go @@ -0,0 +1,174 @@ +// run + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test reorderings; derived from fixedbugs/bug294.go. + +package main + +var log string + +type TT int + +func (t TT) a(s string) TT { + log += "a(" + s + ")" + return t +} + +func (TT) b(s string) string { + log += "b(" + s + ")" + return s +} + +type F func(s string) F + +func a(s string) F { + log += "a(" + s + ")" + return F(a) +} + +func b(s string) string { + log += "b(" + s + ")" + return s +} + +type I interface { + a(s string) I + b(s string) string +} + +type T1 int + +func (t T1) a(s string) I { + log += "a(" + s + ")" + return t +} + +func (T1) b(s string) string { + log += "b(" + s + ")" + return s +} + +// f(g(), h()) where g is not inlinable but h is will have the same problem. +// As will x := g() + h() (same conditions). +// And g() <- h(). +func f(x, y string) { + log += "f(" + x + ", " + y + ")" +} + +func ff(x, y string) { + for false { + } // prevent inl + log += "ff(" + x + ", " + y + ")" +} + +func h(x string) string { + log += "h(" + x + ")" + return x +} + +func g(x string) string { + for false { + } // prevent inl + log += "g(" + x + ")" + return x +} + +func main() { + err := 0 + var t TT + if a("1")("2")("3"); log != "a(1)a(2)a(3)" { + println("expecting a(1)a(2)a(3) , got ", log) + err++ + } + log = "" + + if t.a("1").a(t.b("2")); log != "a(1)b(2)a(2)" { + println("expecting a(1)b(2)a(2), got ", log) + err++ + } + log = "" + if a("3")(b("4"))(b("5")); log != "a(3)b(4)a(4)b(5)a(5)" { + println("expecting a(3)b(4)a(4)b(5)a(5), got ", log) + err++ + } + log = "" + var i I = T1(0) + if i.a("6").a(i.b("7")).a(i.b("8")).a(i.b("9")); log != "a(6)b(7)a(7)b(8)a(8)b(9)a(9)" { + println("expecting a(6)ba(7)ba(8)ba(9), got", log) + err++ + } + log = "" + + if s := t.a("1").b("3"); log != "a(1)b(3)" || s != "3" { + println("expecting a(1)b(3) and 3, got ", log, " and ", s) + err++ + } + log = "" + + if s := t.a("1").a(t.b("2")).b("3") + t.a("4").b("5"); log != "a(1)b(2)a(2)b(3)a(4)b(5)" || s != "35" { + println("expecting a(1)b(2)a(2)b(3)a(4)b(5) and 35, got ", log, " and ", s) + err++ + } + log = "" + + if s := t.a("4").b("5") + t.a("1").a(t.b("2")).b("3"); log != "a(4)b(5)a(1)b(2)a(2)b(3)" || s != "53" { + println("expecting a(4)b(5)a(1)b(2)a(2)b(3) and 35, got ", log, " and ", s) + err++ + } + log = "" + + if ff(g("1"), g("2")); log != "g(1)g(2)ff(1, 2)" { + println("expecting g(1)g(2)ff..., got ", log) + err++ + } + log = "" + + if ff(g("1"), h("2")); log != "g(1)h(2)ff(1, 2)" { + println("expecting g(1)h(2)ff..., got ", log) + err++ + } + log = "" + + if ff(h("1"), g("2")); log != "h(1)g(2)ff(1, 2)" { + println("expecting h(1)g(2)ff..., got ", log) + err++ + } + log = "" + + if ff(h("1"), h("2")); log != "h(1)h(2)ff(1, 2)" { + println("expecting h(1)h(2)ff..., got ", log) + err++ + } + log = "" + + if s := g("1") + g("2"); log != "g(1)g(2)" || s != "12" { + println("expecting g1g2 and 12, got ", log, " and ", s) + err++ + } + log = "" + + if s := g("1") + h("2"); log != "g(1)h(2)" || s != "12" { + println("expecting g1h2 and 12, got ", log, " and ", s) + err++ + } + log = "" + + if s := h("1") + g("2"); log != "h(1)g(2)" || s != "12" { + println("expecting h1g2 and 12, got ", log, " and ", s) + err++ + } + log = "" + + if s := h("1") + h("2"); log != "h(1)h(2)" || s != "12" { + println("expecting h1h2 and 12, got ", log, " and ", s) + err++ + } + log = "" + + if err > 0 { + panic("fail") + } +} diff --git a/gcc/testsuite/go.test/test/rotate.go b/gcc/testsuite/go.test/test/rotate.go new file mode 100644 index 00000000000..aa334b4218c --- /dev/null +++ b/gcc/testsuite/go.test/test/rotate.go @@ -0,0 +1,171 @@ +// $G $D/$F.go && $L $F.$A && +// ./$A.out >tmp.go && $G tmp.go && $L -o $A.out1 tmp.$A && ./$A.out1 +// rm -f tmp.go $A.out1 + +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Generate test of shift and rotate by constants. +// The output is compiled and run. +// +// The output takes around a gigabyte of memory to compile, link, and run +// but it is only done during ./run, not in normal builds using run.go. + +package main + +import ( + "bufio" + "flag" + "fmt" + "os" + "strings" +) + +func main() { + flag.Parse() + + b := bufio.NewWriter(os.Stdout) + defer b.Flush() + + fmt.Fprintf(b, "%s\n", prolog) + + for logBits := uint(3); logBits <= 6; logBits++ { + typ := fmt.Sprintf("int%d", 1< 0 { + fmt.Printf("BUG\n") + } +} + +` + +const checkFunc = ` +func check_XXX(desc string, have, want XXX) { + if have != want { + nfail++ + fmt.Printf("%s = %T(%#x), want %T(%#x)\n", desc, have, have, want, want) + if nfail >= 100 { + fmt.Printf("BUG: stopping after 100 failures\n") + os.Exit(0) + } + } +} +` + +var ( + uop = [2]func(x, y uint64) uint64{ + func(x, y uint64) uint64 { + return x | y + }, + func(x, y uint64) uint64 { + return x ^ y + }, + } + iop = [2]func(x, y int64) int64{ + func(x, y int64) int64 { + return x | y + }, + func(x, y int64) int64 { + return x ^ y + }, + } + cop = [2]byte{'|', '^'} +) + +func gentest(b *bufio.Writer, bits uint, unsigned, inverted bool) { + fmt.Fprintf(b, "func init() {\n") + defer fmt.Fprintf(b, "}\n") + n := 0 + + // Generate tests for left/right and right/left. + for l := uint(0); l <= bits; l++ { + for r := uint(0); r <= bits; r++ { + for o, op := range cop { + typ := fmt.Sprintf("int%d", bits) + v := fmt.Sprintf("i%d", bits) + if unsigned { + typ = "u" + typ + v = "u" + v + } + v0 := int64(0x123456789abcdef0) + if inverted { + v = "n" + v + v0 = ^v0 + } + expr1 := fmt.Sprintf("%s<<%d %c %s>>%d", v, l, op, v, r) + expr2 := fmt.Sprintf("%s>>%d %c %s<<%d", v, r, op, v, l) + + var result string + if unsigned { + v := uint64(v0) >> (64 - bits) + v = uop[o](v<>r) + v <<= 64 - bits + v >>= 64 - bits + result = fmt.Sprintf("%#x", v) + } else { + v := int64(v0) >> (64 - bits) + v = iop[o](v<>r) + v <<= 64 - bits + v >>= 64 - bits + result = fmt.Sprintf("%#x", v) + } + + fmt.Fprintf(b, "\tcheck_%s(%q, %s, %s(%s))\n", typ, expr1, expr1, typ, result) + fmt.Fprintf(b, "\tcheck_%s(%q, %s, %s(%s))\n", typ, expr2, expr2, typ, result) + + // Chop test into multiple functions so that there's not one + // enormous function to compile/link. + // All the functions are named init so we don't have to do + // anything special to call them. ☺ + if n++; n >= 50 { + fmt.Fprintf(b, "}\n") + fmt.Fprintf(b, "func init() {\n") + n = 0 + } + } + } + } +} diff --git a/gcc/testsuite/go.test/test/run b/gcc/testsuite/go.test/test/run index 03c91ee30ee..d206312a29c 100755 --- a/gcc/testsuite/go.test/test/run +++ b/gcc/testsuite/go.test/test/run @@ -3,8 +3,8 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -eval $(gomake --no-print-directory -f ../src/Make.inc go-env) - +eval $(go tool dist env) +export GOARCH GOOS GOROOT export E= case X"$GOARCH" in @@ -29,13 +29,18 @@ export GOTRACEBACK=0 export LANG=C unset GREP_OPTIONS # in case user has a non-standard set +unset GOROOT_FINAL # breaks ./ imports + failed=0 PATH=${GOBIN:-$GOROOT/bin}:`pwd`:/bin:/usr/bin:/usr/local/bin -RUNFILE="/tmp/gorun-$$-$USER" -TMP1FILE="/tmp/gotest1-$$-$USER" -TMP2FILE="/tmp/gotest2-$$-$USER" +# TODO: We add the tool directory to the PATH to avoid thinking about a better way. +PATH="$GOTOOLDIR:$PATH" + +RUNFILE="${TMPDIR:-/tmp}/gorun-$$-$USER" +TMP1FILE="${TMPDIR:-/tmp}/gotest1-$$-$USER" +TMP2FILE="${TMPDIR:-/tmp}/gotest2-$$-$USER" # don't run the machine out of memory: limit individual processes to 4GB. # on thresher, 3GB suffices to run the tests; with 2GB, peano fails. @@ -49,11 +54,13 @@ true >pass.out >times.out exclude=false # exclude nothing golden=golden.out +rm -f tmp.go # generated by some tests, left behind if interrupted + filterout() { grep '^'"$2"'$' $1 >/dev/null } -for dir in . ken chan interface syntax dwarf fixedbugs bugs +for dir in . ken chan interface syntax dwarf safe fixedbugs bugs do echo echo '==' $dir'/' @@ -64,7 +71,8 @@ do fi export F=$(basename $i .go) export D=$dir - sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE" + echo '. ./testlib' >"$RUNFILE" + sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >>"$RUNFILE" if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE" then echo @@ -94,7 +102,7 @@ do echo $i >>pass.out fi echo $(awk 'NR==1{print $2}' "$TMP2FILE") $D/$F >>times.out - rm -f $F.$A $A.out + rm -f $F.$A $A.out tmp.go ) done done | # clean up some stack noise egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' | diff --git a/gcc/testsuite/go.test/test/run.go b/gcc/testsuite/go.test/test/run.go new file mode 100644 index 00000000000..10dbceff5d4 --- /dev/null +++ b/gcc/testsuite/go.test/test/run.go @@ -0,0 +1,607 @@ +// skip + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Run runs tests in the test directory. +// +// TODO(bradfitz): docs of some sort, once we figure out how we're changing +// headers of files +package main + +import ( + "bytes" + "errors" + "flag" + "fmt" + "go/build" + "io/ioutil" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "regexp" + "runtime" + "sort" + "strconv" + "strings" +) + +var ( + verbose = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.") + numParallel = flag.Int("n", runtime.NumCPU(), "number of parallel tests to run") + summary = flag.Bool("summary", false, "show summary of results") + showSkips = flag.Bool("show_skips", false, "show skipped tests") +) + +var ( + // gc and ld are [568][gl]. + gc, ld string + + // letter is the build.ArchChar + letter string + + // dirs are the directories to look for *.go files in. + // TODO(bradfitz): just use all directories? + dirs = []string{".", "ken", "chan", "interface", "syntax", "dwarf", "fixedbugs", "bugs"} + + // ratec controls the max number of tests running at a time. + ratec chan bool + + // toRun is the channel of tests to run. + // It is nil until the first test is started. + toRun chan *test +) + +// maxTests is an upper bound on the total number of tests. +// It is used as a channel buffer size to make sure sends don't block. +const maxTests = 5000 + +func main() { + flag.Parse() + + // Disable parallelism if printing + if *verbose { + *numParallel = 1 + } + + ratec = make(chan bool, *numParallel) + var err error + letter, err = build.ArchChar(build.Default.GOARCH) + check(err) + gc = letter + "g" + ld = letter + "l" + + var tests []*test + if flag.NArg() > 0 { + for _, arg := range flag.Args() { + if arg == "-" || arg == "--" { + // Permit running: + // $ go run run.go - env.go + // $ go run run.go -- env.go + // $ go run run.go - ./fixedbugs + // $ go run run.go -- ./fixedbugs + continue + } + if fi, err := os.Stat(arg); err == nil && fi.IsDir() { + for _, baseGoFile := range goFiles(arg) { + tests = append(tests, startTest(arg, baseGoFile)) + } + } else if strings.HasSuffix(arg, ".go") { + dir, file := filepath.Split(arg) + tests = append(tests, startTest(dir, file)) + } else { + log.Fatalf("can't yet deal with non-directory and non-go file %q", arg) + } + } + } else { + for _, dir := range dirs { + for _, baseGoFile := range goFiles(dir) { + tests = append(tests, startTest(dir, baseGoFile)) + } + } + } + + failed := false + resCount := map[string]int{} + for _, test := range tests { + <-test.donec + _, isSkip := test.err.(skipError) + errStr := "pass" + if test.err != nil { + errStr = test.err.Error() + if !isSkip { + failed = true + } + } + if isSkip && !skipOkay[path.Join(test.dir, test.gofile)] { + errStr = "unexpected skip for " + path.Join(test.dir, test.gofile) + ": " + errStr + isSkip = false + failed = true + } + resCount[errStr]++ + if isSkip && !*verbose && !*showSkips { + continue + } + if !*verbose && test.err == nil { + continue + } + fmt.Printf("%-10s %-20s: %s\n", test.action, test.goFileName(), errStr) + } + + if *summary { + for k, v := range resCount { + fmt.Printf("%5d %s\n", v, k) + } + } + + if failed { + os.Exit(1) + } +} + +func toolPath(name string) string { + p := filepath.Join(os.Getenv("GOROOT"), "bin", "tool", name) + if _, err := os.Stat(p); err != nil { + log.Fatalf("didn't find binary at %s", p) + } + return p +} + +func goFiles(dir string) []string { + f, err := os.Open(dir) + check(err) + dirnames, err := f.Readdirnames(-1) + check(err) + names := []string{} + for _, name := range dirnames { + if !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") { + names = append(names, name) + } + } + sort.Strings(names) + return names +} + +// skipError describes why a test was skipped. +type skipError string + +func (s skipError) Error() string { return string(s) } + +func check(err error) { + if err != nil { + log.Fatal(err) + } +} + +// test holds the state of a test. +type test struct { + dir, gofile string + donec chan bool // closed when done + + src string + action string // "compile", "build", "run", "errorcheck", "skip", "runoutput", "compiledir" + + tempDir string + err error +} + +// startTest +func startTest(dir, gofile string) *test { + t := &test{ + dir: dir, + gofile: gofile, + donec: make(chan bool, 1), + } + if toRun == nil { + toRun = make(chan *test, maxTests) + go runTests() + } + select { + case toRun <- t: + default: + panic("toRun buffer size (maxTests) is too small") + } + return t +} + +// runTests runs tests in parallel, but respecting the order they +// were enqueued on the toRun channel. +func runTests() { + for { + ratec <- true + t := <-toRun + go func() { + t.run() + <-ratec + }() + } +} + +var cwd, _ = os.Getwd() + +func (t *test) goFileName() string { + return filepath.Join(t.dir, t.gofile) +} + +func (t *test) goDirName() string { + return filepath.Join(t.dir, strings.Replace(t.gofile, ".go", ".dir", -1)) +} + +// run runs a test. +func (t *test) run() { + defer close(t.donec) + + srcBytes, err := ioutil.ReadFile(t.goFileName()) + if err != nil { + t.err = err + return + } + t.src = string(srcBytes) + if t.src[0] == '\n' { + t.err = skipError("starts with newline") + return + } + pos := strings.Index(t.src, "\n\n") + if pos == -1 { + t.err = errors.New("double newline not found") + return + } + action := t.src[:pos] + if strings.HasPrefix(action, "//") { + action = action[2:] + } + + var args, flags []string + wantError := false + f := strings.Fields(action) + if len(f) > 0 { + action = f[0] + args = f[1:] + } + + switch action { + case "cmpout": + action = "run" // the run case already looks for /.out files + fallthrough + case "compile", "compiledir", "build", "run", "runoutput": + t.action = action + case "errorcheck": + t.action = action + wantError = true + for len(args) > 0 && strings.HasPrefix(args[0], "-") { + if args[0] == "-0" { + wantError = false + } else { + flags = append(flags, args[0]) + } + args = args[1:] + } + case "skip": + t.action = "skip" + return + default: + t.err = skipError("skipped; unknown pattern: " + action) + t.action = "??" + return + } + + t.makeTempDir() + defer os.RemoveAll(t.tempDir) + + err = ioutil.WriteFile(filepath.Join(t.tempDir, t.gofile), srcBytes, 0644) + check(err) + + // A few tests (of things like the environment) require these to be set. + os.Setenv("GOOS", runtime.GOOS) + os.Setenv("GOARCH", runtime.GOARCH) + + useTmp := true + runcmd := func(args ...string) ([]byte, error) { + cmd := exec.Command(args[0], args[1:]...) + var buf bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &buf + if useTmp { + cmd.Dir = t.tempDir + } + err := cmd.Run() + return buf.Bytes(), err + } + + long := filepath.Join(cwd, t.goFileName()) + switch action { + default: + t.err = fmt.Errorf("unimplemented action %q", action) + + case "errorcheck": + cmdline := []string{"go", "tool", gc, "-e", "-o", "a." + letter} + cmdline = append(cmdline, flags...) + cmdline = append(cmdline, long) + out, err := runcmd(cmdline...) + if wantError { + if err == nil { + t.err = fmt.Errorf("compilation succeeded unexpectedly\n%s", out) + return + } + } else { + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + return + } + } + t.err = t.errorCheck(string(out), long, t.gofile) + return + + case "compile": + out, err := runcmd("go", "tool", gc, "-e", "-o", "a."+letter, long) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + } + + case "compiledir": + // Compile all files in the directory in lexicographic order. + longdir := filepath.Join(cwd, t.goDirName()) + files, dirErr := ioutil.ReadDir(longdir) + if dirErr != nil { + t.err = dirErr + return + } + for _, gofile := range files { + if filepath.Ext(gofile.Name()) != ".go" { + continue + } + afile := strings.Replace(gofile.Name(), ".go", "."+letter, -1) + out, err := runcmd("go", "tool", gc, "-e", "-D.", "-I.", "-o", afile, filepath.Join(longdir, gofile.Name())) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + break + } + } + + case "build": + out, err := runcmd("go", "build", "-o", "a.exe", long) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + } + + case "run": + useTmp = false + out, err := runcmd(append([]string{"go", "run", t.goFileName()}, args...)...) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + } + if strings.Replace(string(out), "\r\n", "\n", -1) != t.expectedOutput() { + t.err = fmt.Errorf("incorrect output\n%s", out) + } + + case "runoutput": + useTmp = false + out, err := runcmd("go", "run", t.goFileName()) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + } + tfile := filepath.Join(t.tempDir, "tmp__.go") + err = ioutil.WriteFile(tfile, out, 0666) + if err != nil { + t.err = fmt.Errorf("write tempfile:%s", err) + return + } + out, err = runcmd("go", "run", tfile) + if err != nil { + t.err = fmt.Errorf("%s\n%s", err, out) + } + if string(out) != t.expectedOutput() { + t.err = fmt.Errorf("incorrect output\n%s", out) + } + } +} + +func (t *test) String() string { + return filepath.Join(t.dir, t.gofile) +} + +func (t *test) makeTempDir() { + var err error + t.tempDir, err = ioutil.TempDir("", "") + check(err) +} + +func (t *test) expectedOutput() string { + filename := filepath.Join(t.dir, t.gofile) + filename = filename[:len(filename)-len(".go")] + filename += ".out" + b, _ := ioutil.ReadFile(filename) + return string(b) +} + +func (t *test) errorCheck(outStr string, full, short string) (err error) { + defer func() { + if *verbose && err != nil { + log.Printf("%s gc output:\n%s", t, outStr) + } + }() + var errs []error + + var out []string + // 6g error messages continue onto additional lines with leading tabs. + // Split the output at the beginning of each line that doesn't begin with a tab. + for _, line := range strings.Split(outStr, "\n") { + if strings.HasSuffix(line, "\r") { // remove '\r', output by compiler on windows + line = line[:len(line)-1] + } + if strings.HasPrefix(line, "\t") { + out[len(out)-1] += "\n" + line + } else { + out = append(out, line) + } + } + + // Cut directory name. + for i := range out { + out[i] = strings.Replace(out[i], full, short, -1) + } + + for _, we := range t.wantedErrors() { + var errmsgs []string + errmsgs, out = partitionStrings(we.filterRe, out) + if len(errmsgs) == 0 { + errs = append(errs, fmt.Errorf("%s:%d: missing error %q", we.file, we.lineNum, we.reStr)) + continue + } + matched := false + for _, errmsg := range errmsgs { + if we.re.MatchString(errmsg) { + matched = true + } else { + out = append(out, errmsg) + } + } + if !matched { + errs = append(errs, fmt.Errorf("%s:%d: no match for %q in%s", we.file, we.lineNum, we.reStr, strings.Join(out, "\n"))) + continue + } + } + + if len(errs) == 0 { + return nil + } + if len(errs) == 1 { + return errs[0] + } + var buf bytes.Buffer + fmt.Fprintf(&buf, "\n") + for _, err := range errs { + fmt.Fprintf(&buf, "%s\n", err.Error()) + } + return errors.New(buf.String()) + +} + +func partitionStrings(rx *regexp.Regexp, strs []string) (matched, unmatched []string) { + for _, s := range strs { + if rx.MatchString(s) { + matched = append(matched, s) + } else { + unmatched = append(unmatched, s) + } + } + return +} + +type wantedError struct { + reStr string + re *regexp.Regexp + lineNum int + file string + filterRe *regexp.Regexp // /^file:linenum\b/m +} + +var ( + errRx = regexp.MustCompile(`// (?:GC_)?ERROR (.*)`) + errQuotesRx = regexp.MustCompile(`"([^"]*)"`) + lineRx = regexp.MustCompile(`LINE(([+-])([0-9]+))?`) +) + +func (t *test) wantedErrors() (errs []wantedError) { + for i, line := range strings.Split(t.src, "\n") { + lineNum := i + 1 + if strings.Contains(line, "////") { + // double comment disables ERROR + continue + } + m := errRx.FindStringSubmatch(line) + if m == nil { + continue + } + all := m[1] + mm := errQuotesRx.FindAllStringSubmatch(all, -1) + if mm == nil { + log.Fatalf("invalid errchk line in %s: %s", t.goFileName(), line) + } + for _, m := range mm { + rx := lineRx.ReplaceAllStringFunc(m[1], func(m string) string { + n := lineNum + if strings.HasPrefix(m, "LINE+") { + delta, _ := strconv.Atoi(m[5:]) + n += delta + } else if strings.HasPrefix(m, "LINE-") { + delta, _ := strconv.Atoi(m[5:]) + n -= delta + } + return fmt.Sprintf("%s:%d", t.gofile, n) + }) + filterPattern := fmt.Sprintf(`^(\w+/)?%s:%d[:[]`, t.gofile, lineNum) + errs = append(errs, wantedError{ + reStr: rx, + re: regexp.MustCompile(rx), + filterRe: regexp.MustCompile(filterPattern), + lineNum: lineNum, + file: t.gofile, + }) + } + } + + return +} + +var skipOkay = map[string]bool{ + "args.go": true, + "ddd3.go": true, + "import3.go": true, + "import4.go": true, + "index.go": true, + "linkx.go": true, + "method4.go": true, + "nul1.go": true, + "rotate.go": true, + "sigchld.go": true, + "sinit.go": true, + "interface/embed1.go": true, + "interface/private.go": true, + "interface/recursive2.go": true, + "dwarf/main.go": true, + "dwarf/z1.go": true, + "dwarf/z10.go": true, + "dwarf/z11.go": true, + "dwarf/z12.go": true, + "dwarf/z13.go": true, + "dwarf/z14.go": true, + "dwarf/z15.go": true, + "dwarf/z16.go": true, + "dwarf/z17.go": true, + "dwarf/z18.go": true, + "dwarf/z19.go": true, + "dwarf/z2.go": true, + "dwarf/z20.go": true, + "dwarf/z3.go": true, + "dwarf/z4.go": true, + "dwarf/z5.go": true, + "dwarf/z6.go": true, + "dwarf/z7.go": true, + "dwarf/z8.go": true, + "dwarf/z9.go": true, + "fixedbugs/bug083.go": true, + "fixedbugs/bug133.go": true, + "fixedbugs/bug160.go": true, + "fixedbugs/bug191.go": true, + "fixedbugs/bug248.go": true, + "fixedbugs/bug302.go": true, + "fixedbugs/bug313.go": true, + "fixedbugs/bug322.go": true, + "fixedbugs/bug324.go": true, + "fixedbugs/bug345.go": true, + "fixedbugs/bug367.go": true, + "fixedbugs/bug369.go": true, + "fixedbugs/bug382.go": true, + "fixedbugs/bug385_32.go": true, + "fixedbugs/bug385_64.go": true, + "fixedbugs/bug414.go": true, + "fixedbugs/bug424.go": true, + "fixedbugs/bug429.go": true, + "fixedbugs/bug437.go": true, + "bugs/bug395.go": true, + "bugs/bug434.go": true, +} diff --git a/gcc/testsuite/go.test/test/rune.go b/gcc/testsuite/go.test/test/rune.go index 3386972b6d7..c013c471d32 100644 --- a/gcc/testsuite/go.test/test/rune.go +++ b/gcc/testsuite/go.test/test/rune.go @@ -1,10 +1,13 @@ -// $G $D/$F.go +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package main +// Test rune constants, expressions and types. +// Compiles but does not run. + +package rune var ( r0 = 'a' diff --git a/gcc/testsuite/go.test/test/runtime.go b/gcc/testsuite/go.test/test/runtime.go index 4be1d055b52..89f59e3edb1 100644 --- a/gcc/testsuite/go.test/test/runtime.go +++ b/gcc/testsuite/go.test/test/runtime.go @@ -1,15 +1,16 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// make sure that even if a file imports runtime, +// Test that even if a file imports runtime, // it cannot get at the low-level runtime definitions -// known to the compiler. for normal packages +// known to the compiler. For normal packages // the compiler doesn't even record the lower case // functions in its symbol table, but some functions // in runtime are hard-coded into the compiler. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/safe/main.go b/gcc/testsuite/go.test/test/safe/main.go new file mode 100644 index 00000000000..d173ed92663 --- /dev/null +++ b/gcc/testsuite/go.test/test/safe/main.go @@ -0,0 +1,14 @@ +// true + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// can't use local path with -u, use -I. instead +import "pkg" // ERROR "import unsafe package" + +func main() { + print(pkg.Float32bits(1.0)) +} diff --git a/gcc/testsuite/go.test/test/safe/nousesafe.go b/gcc/testsuite/go.test/test/safe/nousesafe.go new file mode 100644 index 00000000000..f61e7fe4f09 --- /dev/null +++ b/gcc/testsuite/go.test/test/safe/nousesafe.go @@ -0,0 +1,8 @@ +// $G $D/pkg.go && pack grc pkg.a pkg.$A 2> /dev/null && rm pkg.$A && errchk $G -I. -u $D/main.go +// rm -f pkg.a + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/safe/pkg.go b/gcc/testsuite/go.test/test/safe/pkg.go new file mode 100644 index 00000000000..bebc43a214c --- /dev/null +++ b/gcc/testsuite/go.test/test/safe/pkg.go @@ -0,0 +1,16 @@ +// true + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// a package that uses unsafe on the inside but not in it's api + +package pkg + +import "unsafe" + +// this should be inlinable +func Float32bits(f float32) uint32 { + return *(*uint32)(unsafe.Pointer(&f)) +} \ No newline at end of file diff --git a/gcc/testsuite/go.test/test/safe/usesafe.go b/gcc/testsuite/go.test/test/safe/usesafe.go new file mode 100644 index 00000000000..07c13c1c3a1 --- /dev/null +++ b/gcc/testsuite/go.test/test/safe/usesafe.go @@ -0,0 +1,8 @@ +// $G $D/pkg.go && pack grcS pkg.a pkg.$A 2> /dev/null && rm pkg.$A && $G -I. -u $D/main.go +// rm -f pkg.a + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ignored diff --git a/gcc/testsuite/go.test/test/shift1.go b/gcc/testsuite/go.test/test/shift1.go index c197eef66e5..b33d22ff8ef 100644 --- a/gcc/testsuite/go.test/test/shift1.go +++ b/gcc/testsuite/go.test/test/shift1.go @@ -1,10 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test illegal shifts. // Issue 1708, illegal cases. +// Does not compile. package p diff --git a/gcc/testsuite/go.test/test/shift2.go b/gcc/testsuite/go.test/test/shift2.go index ec4c7addc2d..88ef3c40f52 100644 --- a/gcc/testsuite/go.test/test/shift2.go +++ b/gcc/testsuite/go.test/test/shift2.go @@ -1,10 +1,12 @@ -// $G $D/$F.go || echo BUG: shift2 +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test legal shifts. // Issue 1708, legal cases. +// Compiles but does not run. package p diff --git a/gcc/testsuite/go.test/test/sieve.go b/gcc/testsuite/go.test/test/sieve.go index 4fa1115824f..0cd120c548e 100644 --- a/gcc/testsuite/go.test/test/sieve.go +++ b/gcc/testsuite/go.test/test/sieve.go @@ -1,9 +1,12 @@ -// $G $F.go && $L $F.$A # don't run it - goes forever +// build // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test basic concurrency: the classic prime sieve. +// Do not run - loops forever. + package main // Send the sequence 2, 3, 4, ... to channel 'ch'. diff --git a/gcc/testsuite/go.test/test/sigchld.go b/gcc/testsuite/go.test/test/sigchld.go index e7c3d5abb48..c1cfc2a8d0c 100644 --- a/gcc/testsuite/go.test/test/sigchld.go +++ b/gcc/testsuite/go.test/test/sigchld.go @@ -1,10 +1,15 @@ // [ "$GOOS" == windows ] || // ($G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out) +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that a program can survive SIGCHLD. + package main import "syscall" diff --git a/gcc/testsuite/go.test/test/simassign.go b/gcc/testsuite/go.test/test/simassign.go index 28408abc23a..6ba5c783e96 100644 --- a/gcc/testsuite/go.test/test/simassign.go +++ b/gcc/testsuite/go.test/test/simassign.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simultaneous assignment. + package main var a, b, c, d, e, f, g, h, i int diff --git a/gcc/testsuite/go.test/test/sinit.go b/gcc/testsuite/go.test/test/sinit.go index 5cd3a4567b8..ffb8ef75110 100644 --- a/gcc/testsuite/go.test/test/sinit.go +++ b/gcc/testsuite/go.test/test/sinit.go @@ -1,9 +1,15 @@ // $G -S $D/$F.go | egrep initdone >/dev/null && echo BUG sinit || true +// NOTE: This test is not run by 'run.go' and so not run by all.bash. +// To run this test you must use the ./run shell script. + // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that many initializations can be done at link time and +// generate no executable init functions. + package p // Should be no init func in the assembly. diff --git a/gcc/testsuite/go.test/test/sizeof.go b/gcc/testsuite/go.test/test/sizeof.go index 544e4c52c1b..a6abdd5c657 100644 --- a/gcc/testsuite/go.test/test/sizeof.go +++ b/gcc/testsuite/go.test/test/sizeof.go @@ -1,9 +1,11 @@ -// $G $D/$F.go +// compile // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test unsafe.Sizeof, unsafe.Alignof, and unsafe.Offsetof all return uintptr. + package main import "unsafe" diff --git a/gcc/testsuite/go.test/test/solitaire.go b/gcc/testsuite/go.test/test/solitaire.go index 473a1d12d7d..ac54cec0ac7 100644 --- a/gcc/testsuite/go.test/test/solitaire.go +++ b/gcc/testsuite/go.test/test/solitaire.go @@ -1,9 +1,13 @@ -// $G $F.go && $L $F.$A # don't run it - produces too much output +// build // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test general operation by solving a peg solitaire game. +// A version of this is in the Go playground. +// Don't run it - produces too much output. + // This program solves the (English) peg solitaire board game. // See also: http://en.wikipedia.org/wiki/Peg_solitaire diff --git a/gcc/testsuite/go.test/test/stack.go b/gcc/testsuite/go.test/test/stack.go index 1fd57161ff2..b62febd48dd 100644 --- a/gcc/testsuite/go.test/test/stack.go +++ b/gcc/testsuite/go.test/test/stack.go @@ -1,9 +1,10 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test stack splitting code. // Try to tickle stack splitting bugs by doing // go, defer, and closure calls at different stack depths. diff --git a/gcc/testsuite/go.test/test/string_lit.go b/gcc/testsuite/go.test/test/string_lit.go index c702a05e91f..457faaa88cd 100644 --- a/gcc/testsuite/go.test/test/string_lit.go +++ b/gcc/testsuite/go.test/test/string_lit.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test string literal syntax. + package main import "os" @@ -91,7 +93,7 @@ func main() { "backslashes 2 (backquote)") assert("\\x\\u\\U\\", `\x\u\U\`, "backslash 3 (backquote)") - // test large runes. perhaps not the most logical place for this test. + // test large and surrogate-half runes. perhaps not the most logical place for these tests. var r int32 r = 0x10ffff // largest rune value s = string(r) @@ -99,6 +101,28 @@ func main() { r = 0x10ffff + 1 s = string(r) assert(s, "\xef\xbf\xbd", "too-large rune") + r = 0xD800 + s = string(r) + assert(s, "\xef\xbf\xbd", "surrogate rune min") + r = 0xDFFF + s = string(r) + assert(s, "\xef\xbf\xbd", "surrogate rune max") + r = -1 + s = string(r) + assert(s, "\xef\xbf\xbd", "negative rune") + + // the large rune tests again, this time using constants instead of a variable. + // these conversions will be done at compile time. + s = string(0x10ffff) // largest rune value + assert(s, "\xf4\x8f\xbf\xbf", "largest rune constant") + s = string(0x10ffff + 1) + assert(s, "\xef\xbf\xbd", "too-large rune constant") + s = string(0xD800) + assert(s, "\xef\xbf\xbd", "surrogate rune min constant") + s = string(0xDFFF) + assert(s, "\xef\xbf\xbd", "surrogate rune max constant") + s = string(-1) + assert(s, "\xef\xbf\xbd", "negative rune") assert(string(gr1), gx1, "global ->[]rune") assert(string(gr2), gx2fix, "global invalid ->[]rune") diff --git a/gcc/testsuite/go.test/test/stringrange.go b/gcc/testsuite/go.test/test/stringrange.go index 6a7063e239d..99e5edb5a42 100644 --- a/gcc/testsuite/go.test/test/stringrange.go +++ b/gcc/testsuite/go.test/test/stringrange.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test range over strings. + package main import ( @@ -55,6 +57,13 @@ func main() { ok = false } + for _, c := range "a\xed\xa0\x80a" { + if c != 'a' && c != utf8.RuneError { + fmt.Printf("surrogate UTF-8 does not error: %U\n", c) + ok = false + } + } + if !ok { fmt.Println("BUG: stringrange") os.Exit(1) diff --git a/gcc/testsuite/go.test/test/struct0.go b/gcc/testsuite/go.test/test/struct0.go index 2398c4117d3..e29eb30f544 100644 --- a/gcc/testsuite/go.test/test/struct0.go +++ b/gcc/testsuite/go.test/test/struct0.go @@ -1,12 +1,12 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// zero length structs. -// used to not be evaluated. -// issue 2232. +// Test zero length structs. +// Used to not be evaluated. +// Issue 2232. package main diff --git a/gcc/testsuite/go.test/test/switch.go b/gcc/testsuite/go.test/test/switch.go index bed027ce85f..fd8748b9bce 100644 --- a/gcc/testsuite/go.test/test/switch.go +++ b/gcc/testsuite/go.test/test/switch.go @@ -1,11 +1,15 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test switch statements. + package main +import "os" + func assert(cond bool, msg string) { if !cond { print("assertion fail: ", msg, "\n") @@ -279,4 +283,56 @@ func main() { assert(false, "m should not be nil") default: } + + // switch on interface. + switch i := interface{}("hello"); i { + case 42: + assert(false, `i should be "hello"`) + case "hello": + assert(true, "hello") + default: + assert(false, `i should be "hello"`) + } + + // switch on implicit bool converted to interface + // was broken: see issue 3980 + switch i := interface{}(true); { + case i: + assert(true, "true") + case false: + assert(false, "i should be true") + default: + assert(false, "i should be true") + } + + // switch on array. + switch ar := [3]int{1, 2, 3}; ar { + case [3]int{1,2,3}: + assert(true, "[1 2 3]") + case [3]int{4,5,6}: + assert(false, "ar should be [1 2 3]") + default: + assert(false, "ar should be [1 2 3]") + } + + // switch on channel + switch c1, c2 := make(chan int), make(chan int); c1 { + case nil: + assert(false, "c1 did not match itself") + case c2: + assert(false, "c1 did not match itself") + case c1: + assert(true, "chan") + default: + assert(false, "c1 did not match itself") + } + + i := 0 + switch x := 5; { + case i < x: + os.Exit(0) + case i == x: + case i > x: + os.Exit(1) + } } diff --git a/gcc/testsuite/go.test/test/switch1.go b/gcc/testsuite/go.test/test/switch1.go deleted file mode 100644 index 5bd9d7c5d05..00000000000 --- a/gcc/testsuite/go.test/test/switch1.go +++ /dev/null @@ -1,20 +0,0 @@ -// $G $F.go && $L $F.$A && ./$A.out - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import "os" - -func main() { - i := 0 - switch x := 5; { - case i < x: - os.Exit(0) - case i == x: - case i > x: - os.Exit(1) - } -} diff --git a/gcc/testsuite/go.test/test/switch3.go b/gcc/testsuite/go.test/test/switch3.go index 6c9ebfe6d48..28705e464ef 100644 --- a/gcc/testsuite/go.test/test/switch3.go +++ b/gcc/testsuite/go.test/test/switch3.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that erroneous switch statements are detected by the compiler. +// Does not compile. + package main type I interface { @@ -42,6 +45,17 @@ func bad() { case f1: // ERROR "can only compare func f to nil|func can only be compared to nil" default: } + + var ar, ar1 [4]func() + switch ar { // ERROR "cannot switch on" + case ar1: + default: + } + + var st, st1 struct{ f func() } + switch st { // ERROR "cannot switch on" + case st1: + } } func good() { diff --git a/gcc/testsuite/go.test/test/syntax/chan.go b/gcc/testsuite/go.test/test/syntax/chan.go index ff3577502f2..3b68bda35f5 100644 --- a/gcc/testsuite/go.test/test/syntax/chan.go +++ b/gcc/testsuite/go.test/test/syntax/chan.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/chan1.go b/gcc/testsuite/go.test/test/syntax/chan1.go index 9c12e5e6fed..868a1226d9f 100644 --- a/gcc/testsuite/go.test/test/syntax/chan1.go +++ b/gcc/testsuite/go.test/test/syntax/chan1.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/composite.go b/gcc/testsuite/go.test/test/syntax/composite.go new file mode 100644 index 00000000000..6565334935b --- /dev/null +++ b/gcc/testsuite/go.test/test/syntax/composite.go @@ -0,0 +1,11 @@ +// errorcheck + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +var a = []int{ + 3 // ERROR "need trailing comma before newline in composite literal" +} diff --git a/gcc/testsuite/go.test/test/syntax/else.go b/gcc/testsuite/go.test/test/syntax/else.go index 99595254fd4..e985a9c09c7 100644 --- a/gcc/testsuite/go.test/test/syntax/else.go +++ b/gcc/testsuite/go.test/test/syntax/else.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/forvar.go b/gcc/testsuite/go.test/test/syntax/forvar.go index f12ce55caeb..dc592d2b641 100644 --- a/gcc/testsuite/go.test/test/syntax/forvar.go +++ b/gcc/testsuite/go.test/test/syntax/forvar.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/if.go b/gcc/testsuite/go.test/test/syntax/if.go index a3b51f0c07b..b2a65f9a593 100644 --- a/gcc/testsuite/go.test/test/syntax/if.go +++ b/gcc/testsuite/go.test/test/syntax/if.go @@ -1,4 +1,4 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/import.go b/gcc/testsuite/go.test/test/syntax/import.go index dd1f2613445..f0a79212626 100644 --- a/gcc/testsuite/go.test/test/syntax/import.go +++ b/gcc/testsuite/go.test/test/syntax/import.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/interface.go b/gcc/testsuite/go.test/test/syntax/interface.go index a7f43533a2c..0b76b5416fb 100644 --- a/gcc/testsuite/go.test/test/syntax/interface.go +++ b/gcc/testsuite/go.test/test/syntax/interface.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi1.go b/gcc/testsuite/go.test/test/syntax/semi1.go index 547d9bf7995..8fbfb206ad7 100644 --- a/gcc/testsuite/go.test/test/syntax/semi1.go +++ b/gcc/testsuite/go.test/test/syntax/semi1.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi2.go b/gcc/testsuite/go.test/test/syntax/semi2.go index 28d1d3906dd..cfb0ed17b74 100644 --- a/gcc/testsuite/go.test/test/syntax/semi2.go +++ b/gcc/testsuite/go.test/test/syntax/semi2.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi3.go b/gcc/testsuite/go.test/test/syntax/semi3.go index ab5941bda5b..645af7354a5 100644 --- a/gcc/testsuite/go.test/test/syntax/semi3.go +++ b/gcc/testsuite/go.test/test/syntax/semi3.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi4.go b/gcc/testsuite/go.test/test/syntax/semi4.go index 7a9c2956e72..e192348aa20 100644 --- a/gcc/testsuite/go.test/test/syntax/semi4.go +++ b/gcc/testsuite/go.test/test/syntax/semi4.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi5.go b/gcc/testsuite/go.test/test/syntax/semi5.go index 5f8ccc688f7..cf690f08406 100644 --- a/gcc/testsuite/go.test/test/syntax/semi5.go +++ b/gcc/testsuite/go.test/test/syntax/semi5.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi6.go b/gcc/testsuite/go.test/test/syntax/semi6.go index b6279ed307a..c1e1cc363a2 100644 --- a/gcc/testsuite/go.test/test/syntax/semi6.go +++ b/gcc/testsuite/go.test/test/syntax/semi6.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/semi7.go b/gcc/testsuite/go.test/test/syntax/semi7.go index 5a7b3ff4cc8..6c9ade8bc2b 100644 --- a/gcc/testsuite/go.test/test/syntax/semi7.go +++ b/gcc/testsuite/go.test/test/syntax/semi7.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/topexpr.go b/gcc/testsuite/go.test/test/syntax/topexpr.go index 93d86fbe959..c5958f5dd2c 100644 --- a/gcc/testsuite/go.test/test/syntax/topexpr.go +++ b/gcc/testsuite/go.test/test/syntax/topexpr.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/typesw.go b/gcc/testsuite/go.test/test/syntax/typesw.go index 47f683cdf29..cd8cf35236a 100644 --- a/gcc/testsuite/go.test/test/syntax/typesw.go +++ b/gcc/testsuite/go.test/test/syntax/typesw.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/vareq.go b/gcc/testsuite/go.test/test/syntax/vareq.go index 8525be8cf59..f08955e91bc 100644 --- a/gcc/testsuite/go.test/test/syntax/vareq.go +++ b/gcc/testsuite/go.test/test/syntax/vareq.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/syntax/vareq1.go b/gcc/testsuite/go.test/test/syntax/vareq1.go index 9d70bea39f5..e900eabebec 100644 --- a/gcc/testsuite/go.test/test/syntax/vareq1.go +++ b/gcc/testsuite/go.test/test/syntax/vareq1.go @@ -1,4 +1,4 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style diff --git a/gcc/testsuite/go.test/test/test0.go b/gcc/testsuite/go.test/test/test0.go deleted file mode 100644 index d8d86c42793..00000000000 --- a/gcc/testsuite/go.test/test/test0.go +++ /dev/null @@ -1,92 +0,0 @@ -// $G $F.go && $L $F.$A && ./$A.out - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -const a_const = 0 - -const ( - pi = /* the usual */ 3.14159265358979323 - e = 2.718281828 - mask1 int = 1 << iota - mask2 = 1 << iota - mask3 = 1 << iota - mask4 = 1 << iota -) - -type ( - Empty interface{} - Point struct { - x, y int - } - Point2 Point -) - -func (p *Point) Initialize(x, y int) *Point { - p.x, p.y = x, y - return p -} - -func (p *Point) Distance() int { - return p.x*p.x + p.y*p.y -} - -var ( - x1 int - x2 int - u, v, w float32 -) - -func foo() {} - -func min(x, y int) int { - if x < y { - return x - } - return y -} - -func swap(x, y int) (u, v int) { - u = y - v = x - return -} - -func control_structs() { - var p *Point = new(Point).Initialize(2, 3) - i := p.Distance() - var f float32 = 0.3 - _ = f - for { - } - for { - } - for j := 0; j < i; j++ { - if i == 0 { - } else { - i = 0 - } - var x float32 - _ = x - } -foo: // a label - var j int - switch y := 0; true { - case i < y: - fallthrough - case i < j: - case i == 0, i == 1, i == j: - i++ - i++ - goto foo - default: - i = -+-+i - break - } -} - -func main() { -} diff --git a/gcc/testsuite/go.test/test/testlib b/gcc/testsuite/go.test/test/testlib new file mode 100644 index 00000000000..29de7672ce1 --- /dev/null +++ b/gcc/testsuite/go.test/test/testlib @@ -0,0 +1,61 @@ +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# These function names are also known to +# (and are the plan for transitioning to) run.go. + +compile() { + $G $D/$F.go +} + +compiledir() { + for gofile in $D/$F.dir/*.go + do + $G -I. "$gofile" || return 1 + done +} + +build() { + $G $D/$F.go && $L $F.$A +} + +runoutput() { + go run "$D/$F.go" > tmp.go + go run tmp.go +} + +run() { + gofiles="" + ingo=true + while $ingo; do + case "$1" in + *.go) + gofiles="$gofiles $1" + shift + ;; + *) + ingo=false + ;; + esac + done + + $G $D/$F.go $gofiles && $L $F.$A && ./$A.out "$@" +} + +cmpout() { + $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out +} + +errorcheck() { + zero="" + if [ "$1" = "-0" ]; then + zero="-0" + shift + fi + errchk $zero $G -e $* $D/$F.go +} + +skip() { + true +} diff --git a/gcc/testsuite/go.test/test/times.out b/gcc/testsuite/go.test/test/times.out deleted file mode 100644 index 841fab9ef2b..00000000000 --- a/gcc/testsuite/go.test/test/times.out +++ /dev/null @@ -1,632 +0,0 @@ -0.04 ./235 -1.72 ./64bit -0.03 ./alias -0.03 ./alias1 -0.30 ./append -0.07 ./args -0.02 ./assign -0.04 ./assign1 -0.04 ./bigalg -0.03 ./bigmap -0.14 ./blank -0.03 ./blank1 -0.03 ./chancap -0.07 ./char_lit -0.03 ./char_lit1 -0.09 ./closedchan -0.05 ./closure -0.06 ./cmp -0.02 ./cmp6 -0.03 ./cmplx -0.60 ./cmplxdivide -0.00 ./cmplxdivide1 -0.04 ./complit -0.02 ./complit1 -0.03 ./compos -0.04 ./const -0.03 ./const1 -0.03 ./const2 -0.13 ./const3 -0.08 ./convert -0.03 ./convert1 -0.02 ./convert3 -0.04 ./convlit -0.02 ./convlit1 -0.34 ./copy -0.27 ./crlf -0.05 ./ddd -0.02 ./ddd1 -0.00 ./ddd2 -0.04 ./ddd3 -0.03 ./decl -0.03 ./declbad -0.14 ./defer -0.03 ./deferprint -0.14 ./divide -0.00 ./empty -0.08 ./env -0.00 ./eof -0.00 ./eof1 -0.04 ./escape -0.12 ./escape2 -0.03 ./escape3 -0.05 ./float_lit -0.14 ./floatcmp -0.03 ./for -0.04 ./func -0.03 ./func1 -0.00 ./func2 -0.03 ./func3 -0.03 ./func4 -0.03 ./func5 -0.00 ./func6 -0.04 ./func7 -0.03 ./gc -0.04 ./gc1 -0.26 ./gc2 -0.06 ./goprint -0.04 ./goto -0.04 ./hashmap -0.03 ./helloworld -0.03 ./if -0.02 ./import -0.15 ./import1 -0.00 ./import2 -0.01 ./import3 -0.14 ./import4 -1.70 ./index -0.03 ./indirect -0.02 ./indirect1 -0.02 ./init -0.25 ./init1 -0.03 ./initcomma -0.15 ./initialize -0.02 ./initializerr -0.06 ./initsyscall -0.07 ./int_lit -0.03 ./intcvt -0.03 ./iota -0.03 ./label -0.03 ./label1 -0.04 ./literal -0.15 ./malloc1 -0.06 ./mallocfin -0.19 ./mallocrand -0.21 ./mallocrep -0.52 ./mallocrep1 -0.17 ./map -0.02 ./map1 -0.05 ./method -0.02 ./method1 -0.03 ./method2 -0.04 ./method3 -0.06 ./named -0.03 ./named1 -0.18 ./nil -0.15 ./nilptr -0.16 ./nul1 -0.00 ./parentype -0.11 ./peano -0.02 ./printbig -0.05 ./range -0.04 ./recover -0.04 ./recover1 -0.08 ./recover2 -0.06 ./recover3 -0.14 ./rename -0.02 ./rename1 -0.16 ./reorder -0.00 ./rune -0.03 ./runtime -0.03 ./shift1 -0.01 ./shift2 -0.03 ./sieve -0.06 ./sigchld -0.03 ./simassign -0.02 ./sinit -0.00 ./sizeof -0.03 ./solitaire -0.06 ./stack -0.08 ./string_lit -0.14 ./stringrange -0.04 ./struct0 -0.04 ./switch -0.08 ./switch1 -0.02 ./switch3 -0.04 ./test0 -0.03 ./turing -0.07 ./typeswitch -0.15 ./typeswitch1 -0.02 ./typeswitch2 -0.03 ./typeswitch3 -0.02 ./undef -0.04 ./utf -0.03 ./varerr -0.03 ./varinit -0.26 ./zerodivide -0.04 ken/array -0.11 ken/chan -0.04 ken/chan1 -0.04 ken/complit -0.07 ken/convert -0.03 ken/cplx0 -0.02 ken/cplx1 -0.06 ken/cplx2 -0.09 ken/cplx3 -0.14 ken/cplx4 -0.03 ken/cplx5 -0.31 ken/divconst -0.05 ken/divmod -0.04 ken/embed -0.03 ken/for -0.04 ken/interbasic -0.03 ken/interfun -0.04 ken/intervar -0.03 ken/label -0.03 ken/litfun -0.03 ken/mfunc -0.34 ken/modconst -0.03 ken/ptrfun -0.03 ken/ptrvar -0.04 ken/range -0.03 ken/rob1 -0.18 ken/rob2 -0.04 ken/robfor -0.04 ken/robfunc -0.03 ken/shift -0.03 ken/simparray -0.04 ken/simpbool -0.03 ken/simpconv -0.03 ken/simpfun -0.03 ken/simpswitch -0.03 ken/simpvar -0.02 ken/slicearray -0.03 ken/sliceslice -0.03 ken/string -0.03 ken/strvar -0.32 chan/doubleselect -0.06 chan/fifo -0.12 chan/goroutines -0.07 chan/nonblock -0.02 chan/perm -0.10 chan/powser1 -0.09 chan/powser2 -0.03 chan/select -0.15 chan/select2 -0.97 chan/select3 -0.03 chan/select4 -0.72 chan/select5 -0.03 chan/select6 -0.04 chan/select7 -0.03 chan/sendstmt -0.03 chan/sieve1 -0.04 chan/sieve2 -0.02 chan/zerosize -0.04 interface/bigdata -0.04 interface/convert -0.03 interface/convert1 -0.03 interface/convert2 -0.09 interface/embed -0.00 interface/embed0 -0.03 interface/embed1 -0.02 interface/embed2 -0.02 interface/explicit -0.03 interface/fail -0.09 interface/fake -0.03 interface/noeq -0.03 interface/pointer -0.03 interface/private -0.00 interface/private1 -0.04 interface/receiver -0.03 interface/receiver1 -0.00 interface/recursive -0.03 interface/returntype -0.09 interface/struct -0.02 syntax/chan -0.03 syntax/chan1 -0.02 syntax/else -0.02 syntax/forvar -0.03 syntax/if -0.03 syntax/import -0.03 syntax/interface -0.03 syntax/semi1 -0.02 syntax/semi2 -0.03 syntax/semi3 -0.03 syntax/semi4 -0.02 syntax/semi5 -0.03 syntax/semi6 -0.02 syntax/semi7 -0.02 syntax/topexpr -0.03 syntax/typesw -0.02 syntax/vareq -0.03 syntax/vareq1 -0.04 dwarf/linedirectives -0.05 dwarf/main -0.00 dwarf/z1 -0.00 dwarf/z10 -0.00 dwarf/z11 -0.00 dwarf/z12 -0.00 dwarf/z13 -0.00 dwarf/z14 -0.00 dwarf/z15 -0.00 dwarf/z16 -0.00 dwarf/z17 -0.00 dwarf/z18 -0.00 dwarf/z19 -0.00 dwarf/z2 -0.00 dwarf/z20 -0.00 dwarf/z3 -0.00 dwarf/z4 -0.00 dwarf/z5 -0.00 dwarf/z6 -0.00 dwarf/z7 -0.00 dwarf/z8 -0.00 dwarf/z9 -0.03 fixedbugs/bug000 -0.03 fixedbugs/bug002 -0.03 fixedbugs/bug003 -0.03 fixedbugs/bug004 -0.04 fixedbugs/bug005 -0.08 fixedbugs/bug006 -0.03 fixedbugs/bug007 -0.03 fixedbugs/bug008 -0.02 fixedbugs/bug009 -0.03 fixedbugs/bug010 -0.03 fixedbugs/bug011 -0.03 fixedbugs/bug012 -0.03 fixedbugs/bug013 -0.03 fixedbugs/bug014 -0.02 fixedbugs/bug015 -0.02 fixedbugs/bug016 -0.03 fixedbugs/bug017 -0.00 fixedbugs/bug020 -0.03 fixedbugs/bug021 -0.02 fixedbugs/bug022 -0.03 fixedbugs/bug023 -0.03 fixedbugs/bug024 -0.03 fixedbugs/bug026 -0.14 fixedbugs/bug027 -0.03 fixedbugs/bug028 -0.02 fixedbugs/bug030 -0.03 fixedbugs/bug031 -0.02 fixedbugs/bug035 -0.00 fixedbugs/bug036 -0.02 fixedbugs/bug037 -0.00 fixedbugs/bug038 -0.03 fixedbugs/bug039 -0.00 fixedbugs/bug040 -0.03 fixedbugs/bug045 -0.03 fixedbugs/bug046 -0.03 fixedbugs/bug047 -0.02 fixedbugs/bug048 -0.03 fixedbugs/bug049 -0.03 fixedbugs/bug050 -0.02 fixedbugs/bug051 -0.03 fixedbugs/bug052 -0.03 fixedbugs/bug053 -0.03 fixedbugs/bug054 -0.03 fixedbugs/bug055 -0.03 fixedbugs/bug056 -0.00 fixedbugs/bug057 -0.04 fixedbugs/bug058 -0.08 fixedbugs/bug059 -0.08 fixedbugs/bug060 -0.03 fixedbugs/bug061 -0.03 fixedbugs/bug062 -0.00 fixedbugs/bug063 -0.00 fixedbugs/bug064 -0.03 fixedbugs/bug065 -0.00 fixedbugs/bug066 -0.03 fixedbugs/bug067 -0.03 fixedbugs/bug068 -0.00 fixedbugs/bug069 -0.15 fixedbugs/bug070 -0.00 fixedbugs/bug071 -0.03 fixedbugs/bug072 -0.03 fixedbugs/bug073 -0.03 fixedbugs/bug074 -0.03 fixedbugs/bug075 -0.03 fixedbugs/bug076 -0.00 fixedbugs/bug077 -0.03 fixedbugs/bug078 -0.00 fixedbugs/bug080 -0.02 fixedbugs/bug081 -0.03 fixedbugs/bug082 -0.03 fixedbugs/bug083 -0.04 fixedbugs/bug084 -0.02 fixedbugs/bug085 -0.03 fixedbugs/bug086 -0.00 fixedbugs/bug087 -0.01 fixedbugs/bug088 -0.00 fixedbugs/bug089 -0.03 fixedbugs/bug090 -0.02 fixedbugs/bug091 -0.03 fixedbugs/bug092 -0.03 fixedbugs/bug093 -0.00 fixedbugs/bug094 -0.00 fixedbugs/bug096 -0.03 fixedbugs/bug097 -0.00 fixedbugs/bug098 -0.03 fixedbugs/bug099 -0.03 fixedbugs/bug101 -0.03 fixedbugs/bug102 -0.02 fixedbugs/bug103 -0.03 fixedbugs/bug104 -0.01 fixedbugs/bug106 -0.03 fixedbugs/bug107 -0.03 fixedbugs/bug108 -0.00 fixedbugs/bug109 -0.03 fixedbugs/bug110 -0.03 fixedbugs/bug111 -0.00 fixedbugs/bug112 -0.03 fixedbugs/bug113 -0.03 fixedbugs/bug114 -0.00 fixedbugs/bug115 -0.03 fixedbugs/bug116 -0.02 fixedbugs/bug117 -0.00 fixedbugs/bug118 -0.03 fixedbugs/bug119 -0.11 fixedbugs/bug120 -0.02 fixedbugs/bug121 -0.03 fixedbugs/bug122 -0.03 fixedbugs/bug123 -0.02 fixedbugs/bug126 -0.02 fixedbugs/bug127 -0.03 fixedbugs/bug128 -0.01 fixedbugs/bug129 -0.08 fixedbugs/bug130 -0.02 fixedbugs/bug131 -0.02 fixedbugs/bug132 -0.03 fixedbugs/bug133 -0.00 fixedbugs/bug135 -0.02 fixedbugs/bug136 -0.00 fixedbugs/bug137 -0.00 fixedbugs/bug139 -0.00 fixedbugs/bug140 -0.07 fixedbugs/bug141 -0.03 fixedbugs/bug142 -0.00 fixedbugs/bug143 -0.00 fixedbugs/bug144 -0.00 fixedbugs/bug145 -0.03 fixedbugs/bug146 -0.06 fixedbugs/bug147 -0.03 fixedbugs/bug148 -0.00 fixedbugs/bug149 -0.00 fixedbugs/bug150 -0.00 fixedbugs/bug151 -0.03 fixedbugs/bug1515 -0.03 fixedbugs/bug152 -0.14 fixedbugs/bug154 -0.03 fixedbugs/bug155 -0.00 fixedbugs/bug156 -0.00 fixedbugs/bug157 -0.00 fixedbugs/bug158 -0.07 fixedbugs/bug159 -0.09 fixedbugs/bug160 -0.00 fixedbugs/bug161 -0.02 fixedbugs/bug163 -0.00 fixedbugs/bug164 -0.03 fixedbugs/bug165 -0.03 fixedbugs/bug167 -0.03 fixedbugs/bug168 -0.02 fixedbugs/bug169 -0.03 fixedbugs/bug170 -0.03 fixedbugs/bug171 -0.02 fixedbugs/bug172 -0.00 fixedbugs/bug173 -0.00 fixedbugs/bug174 -0.03 fixedbugs/bug175 -0.03 fixedbugs/bug176 -0.09 fixedbugs/bug177 -0.03 fixedbugs/bug178 -0.03 fixedbugs/bug179 -0.03 fixedbugs/bug180 -0.03 fixedbugs/bug181 -0.02 fixedbugs/bug182 -0.03 fixedbugs/bug183 -0.15 fixedbugs/bug184 -0.04 fixedbugs/bug185 -0.02 fixedbugs/bug186 -0.08 fixedbugs/bug187 -0.03 fixedbugs/bug188 -0.03 fixedbugs/bug189 -0.00 fixedbugs/bug190 -0.04 fixedbugs/bug191 -0.03 fixedbugs/bug192 -0.03 fixedbugs/bug193 -0.03 fixedbugs/bug194 -0.02 fixedbugs/bug195 -0.04 fixedbugs/bug196 -0.02 fixedbugs/bug197 -0.03 fixedbugs/bug198 -0.03 fixedbugs/bug199 -0.03 fixedbugs/bug200 -0.03 fixedbugs/bug201 -0.03 fixedbugs/bug202 -0.03 fixedbugs/bug203 -0.03 fixedbugs/bug204 -0.02 fixedbugs/bug205 -0.21 fixedbugs/bug206 -0.14 fixedbugs/bug207 -0.02 fixedbugs/bug208 -0.02 fixedbugs/bug209 -0.03 fixedbugs/bug211 -0.03 fixedbugs/bug212 -0.03 fixedbugs/bug213 -0.00 fixedbugs/bug214 -0.02 fixedbugs/bug215 -0.00 fixedbugs/bug216 -0.03 fixedbugs/bug217 -0.00 fixedbugs/bug218 -0.00 fixedbugs/bug219 -0.04 fixedbugs/bug221 -0.01 fixedbugs/bug222 -0.00 fixedbugs/bug223 -0.03 fixedbugs/bug224 -0.03 fixedbugs/bug225 -0.03 fixedbugs/bug227 -0.03 fixedbugs/bug228 -0.03 fixedbugs/bug229 -0.03 fixedbugs/bug230 -0.02 fixedbugs/bug231 -0.00 fixedbugs/bug232 -0.01 fixedbugs/bug233 -0.04 fixedbugs/bug234 -0.00 fixedbugs/bug235 -0.04 fixedbugs/bug236 -0.15 fixedbugs/bug237 -0.03 fixedbugs/bug238 -0.00 fixedbugs/bug239 -0.03 fixedbugs/bug240 -0.03 fixedbugs/bug241 -0.04 fixedbugs/bug242 -0.04 fixedbugs/bug243 -0.03 fixedbugs/bug244 -0.00 fixedbugs/bug245 -0.03 fixedbugs/bug246 -0.03 fixedbugs/bug247 -0.11 fixedbugs/bug248 -0.03 fixedbugs/bug249 -0.00 fixedbugs/bug250 -0.03 fixedbugs/bug251 -0.03 fixedbugs/bug252 -0.03 fixedbugs/bug253 -0.03 fixedbugs/bug254 -0.03 fixedbugs/bug255 -0.03 fixedbugs/bug256 -0.47 fixedbugs/bug257 -0.14 fixedbugs/bug258 -0.16 fixedbugs/bug259 -0.16 fixedbugs/bug260 -0.03 fixedbugs/bug261 -0.10 fixedbugs/bug262 -0.03 fixedbugs/bug263 -0.03 fixedbugs/bug264 -0.07 fixedbugs/bug265 -0.03 fixedbugs/bug266 -0.00 fixedbugs/bug267 -0.03 fixedbugs/bug269 -0.13 fixedbugs/bug271 -0.02 fixedbugs/bug272 -0.04 fixedbugs/bug273 -0.02 fixedbugs/bug274 -0.00 fixedbugs/bug275 -0.03 fixedbugs/bug276 -0.00 fixedbugs/bug277 -0.03 fixedbugs/bug278 -0.04 fixedbugs/bug279 -0.02 fixedbugs/bug280 -0.04 fixedbugs/bug281 -0.00 fixedbugs/bug282 -0.00 fixedbugs/bug283 -0.03 fixedbugs/bug284 -0.05 fixedbugs/bug285 -0.04 fixedbugs/bug286 -0.02 fixedbugs/bug287 -0.00 fixedbugs/bug288 -0.02 fixedbugs/bug289 -0.04 fixedbugs/bug290 -0.04 fixedbugs/bug291 -0.03 fixedbugs/bug292 -0.04 fixedbugs/bug293 -0.03 fixedbugs/bug294 -0.16 fixedbugs/bug295 -0.04 fixedbugs/bug296 -0.03 fixedbugs/bug297 -0.03 fixedbugs/bug298 -0.03 fixedbugs/bug299 -0.03 fixedbugs/bug300 -0.00 fixedbugs/bug301 -0.04 fixedbugs/bug302 -0.05 fixedbugs/bug303 -0.00 fixedbugs/bug304 -0.03 fixedbugs/bug305 -0.01 fixedbugs/bug306 -0.00 fixedbugs/bug307 -0.01 fixedbugs/bug308 -0.00 fixedbugs/bug309 -0.04 fixedbugs/bug311 -0.03 fixedbugs/bug312 -0.04 fixedbugs/bug313 -0.04 fixedbugs/bug314 -0.00 fixedbugs/bug315 -0.00 fixedbugs/bug316 -0.03 fixedbugs/bug317 -0.03 fixedbugs/bug318 -0.00 fixedbugs/bug319 -0.03 fixedbugs/bug320 -0.14 fixedbugs/bug321 -0.04 fixedbugs/bug322 -0.03 fixedbugs/bug323 -0.04 fixedbugs/bug324 -0.03 fixedbugs/bug325 -0.02 fixedbugs/bug326 -0.04 fixedbugs/bug327 -0.03 fixedbugs/bug328 -0.04 fixedbugs/bug329 -0.02 fixedbugs/bug330 -0.04 fixedbugs/bug331 -0.02 fixedbugs/bug332 -0.03 fixedbugs/bug333 -0.01 fixedbugs/bug334 -0.01 fixedbugs/bug335 -0.04 fixedbugs/bug336 -0.03 fixedbugs/bug337 -0.00 fixedbugs/bug338 -0.03 fixedbugs/bug339 -0.02 fixedbugs/bug340 -0.03 fixedbugs/bug341 -0.02 fixedbugs/bug342 -0.04 fixedbugs/bug343 -0.02 fixedbugs/bug344 -0.03 fixedbugs/bug345 -0.08 fixedbugs/bug346 -0.04 fixedbugs/bug347 -0.06 fixedbugs/bug348 -0.03 fixedbugs/bug349 -0.03 fixedbugs/bug350 -0.02 fixedbugs/bug351 -0.03 fixedbugs/bug352 -0.03 fixedbugs/bug353 -0.00 fixedbugs/bug354 -0.03 fixedbugs/bug355 -0.03 fixedbugs/bug356 -0.02 fixedbugs/bug357 -0.04 fixedbugs/bug358 -0.00 fixedbugs/bug361 -0.03 fixedbugs/bug362 -0.03 fixedbugs/bug363 -0.15 fixedbugs/bug364 -0.02 fixedbugs/bug365 -0.03 fixedbugs/bug366 -0.03 fixedbugs/bug367 -0.03 fixedbugs/bug368 -0.51 fixedbugs/bug369 -0.03 fixedbugs/bug370 -0.02 fixedbugs/bug371 -0.03 fixedbugs/bug372 -0.03 fixedbugs/bug373 -0.03 fixedbugs/bug374 -0.03 fixedbugs/bug375 -0.03 fixedbugs/bug376 -0.01 fixedbugs/bug377 -0.03 fixedbugs/bug378 -0.02 fixedbugs/bug379 -0.00 fixedbugs/bug380 -0.03 fixedbugs/bug381 -0.01 fixedbugs/bug382 -0.03 fixedbugs/bug383 -0.03 fixedbugs/bug384 -0.00 fixedbugs/bug385_32 -0.03 fixedbugs/bug385_64 -0.03 fixedbugs/bug386 -0.01 fixedbugs/bug387 -0.02 fixedbugs/bug388 -0.03 fixedbugs/bug389 -0.03 fixedbugs/bug390 -0.00 fixedbugs/bug391 -0.01 fixedbugs/bug392 -0.00 fixedbugs/bug393 -0.03 fixedbugs/bug394 -0.00 fixedbugs/bug395 -0.01 fixedbugs/bug396 diff --git a/gcc/testsuite/go.test/test/turing.go b/gcc/testsuite/go.test/test/turing.go index 366982e67f1..acbe85b646c 100644 --- a/gcc/testsuite/go.test/test/turing.go +++ b/gcc/testsuite/go.test/test/turing.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simulating a Turing machine, sort of. + package main // brainfuck diff --git a/gcc/testsuite/go.test/test/typeswitch.go b/gcc/testsuite/go.test/test/typeswitch.go index aa911f9b621..30a4b4975fb 100644 --- a/gcc/testsuite/go.test/test/typeswitch.go +++ b/gcc/testsuite/go.test/test/typeswitch.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple type switches, including chans, maps etc. + package main import "os" diff --git a/gcc/testsuite/go.test/test/typeswitch1.go b/gcc/testsuite/go.test/test/typeswitch1.go index 9613b166f18..a980ce4c070 100644 --- a/gcc/testsuite/go.test/test/typeswitch1.go +++ b/gcc/testsuite/go.test/test/typeswitch1.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test simple type switches on basic types. + package main import "fmt" diff --git a/gcc/testsuite/go.test/test/typeswitch2.go b/gcc/testsuite/go.test/test/typeswitch2.go index 3e3acdae377..6c703076a6f 100644 --- a/gcc/testsuite/go.test/test/typeswitch2.go +++ b/gcc/testsuite/go.test/test/typeswitch2.go @@ -1,9 +1,12 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that various erroneous type switches are caught be the compiler. +// Does not compile. + package main import "io" diff --git a/gcc/testsuite/go.test/test/typeswitch3.go b/gcc/testsuite/go.test/test/typeswitch3.go index 99d08a20f77..287e32e71e1 100644 --- a/gcc/testsuite/go.test/test/typeswitch3.go +++ b/gcc/testsuite/go.test/test/typeswitch3.go @@ -1,20 +1,43 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that erroneous type switches are caught be the compiler. +// Issue 2700, among other things. +// Does not compile. + package main +import ( + "io" +) type I interface { - M() + M() } func main(){ - var x I - switch x.(type) { - case string: // ERROR "impossible" - println("FAIL") - } + var x I + switch x.(type) { + case string: // ERROR "impossible" + println("FAIL") + } + + // Issue 2700: if the case type is an interface, nothing is impossible + + var r io.Reader + + _, _ = r.(io.Writer) + + switch r.(type) { + case io.Writer: + } + + // Issue 2827. + switch _ := r.(type) { // ERROR "invalid variable name _|no new variables" + } } + + diff --git a/gcc/testsuite/go.test/test/undef.go b/gcc/testsuite/go.test/test/undef.go index 7ef07882aa2..0a77e59370b 100644 --- a/gcc/testsuite/go.test/test/undef.go +++ b/gcc/testsuite/go.test/test/undef.go @@ -1,10 +1,11 @@ -// errchk $G -e $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Check line numbers in error messages. +// Test line numbers in error messages. +// Does not compile. package main diff --git a/gcc/testsuite/go.test/test/utf.go b/gcc/testsuite/go.test/test/utf.go index 9fba58156b3..3ac79447e63 100644 --- a/gcc/testsuite/go.test/test/utf.go +++ b/gcc/testsuite/go.test/test/utf.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test UTF-8 in strings and character constants. + package main import "unicode/utf8" diff --git a/gcc/testsuite/go.test/test/varerr.go b/gcc/testsuite/go.test/test/varerr.go index ddd718f5b8a..22aa9324f98 100644 --- a/gcc/testsuite/go.test/test/varerr.go +++ b/gcc/testsuite/go.test/test/varerr.go @@ -1,9 +1,12 @@ -// errchk $G $D/$F.go +// errorcheck // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Verify that a couple of illegal variable declarations are caught by the compiler. +// Does not compile. + package main func main() { diff --git a/gcc/testsuite/go.test/test/varinit.go b/gcc/testsuite/go.test/test/varinit.go index c768777932a..84a4a1aa55c 100644 --- a/gcc/testsuite/go.test/test/varinit.go +++ b/gcc/testsuite/go.test/test/varinit.go @@ -1,9 +1,11 @@ -// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result +// run // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test var x = x + 1 works. + package main func main() { diff --git a/gcc/testsuite/go.test/test/zerodivide.go b/gcc/testsuite/go.test/test/zerodivide.go index 3b08e774cc1..673d1d18d81 100644 --- a/gcc/testsuite/go.test/test/zerodivide.go +++ b/gcc/testsuite/go.test/test/zerodivide.go @@ -1,9 +1,11 @@ -// $G $F.go && $L $F.$A && ./$A.out +// run // Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Test that zero division causes a panic. + package main import (