Update to current version of Go testsuite.
* go.test/go-test.exp: Update for latest version of Go testsuite. From-SVN: r191858
This commit is contained in:
parent
4e57a5c302
commit
b64ca2cebd
749 changed files with 7107 additions and 2283 deletions
|
@ -1,3 +1,7 @@
|
|||
2012-09-29 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* go.test/go-test.exp: Update for latest version of Go testsuite.
|
||||
|
||||
2012-09-29 Thomas König <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/52724
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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{}
|
||||
|
||||
|
|
|
@ -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})
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=go1
|
||||
GOFILES=\
|
||||
dummy.go\
|
||||
|
||||
include $(GOROOT)/src/Make.pkg
|
|
@ -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)
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
package go1
|
||||
|
||||
// Nothing to see here: everything is in the _test files.
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
41
gcc/testsuite/go.test/test/bench/go1/mandel_test.go
Normal file
41
gcc/testsuite/go.test/test/bench/go1/mandel_test.go
Normal file
|
@ -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)
|
||||
}
|
||||
}
|
43
gcc/testsuite/go.test/test/bench/go1/parser_test.go
Normal file
43
gcc/testsuite/go.test/test/bench/go1/parser_test.go
Normal file
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
245
gcc/testsuite/go.test/test/bench/go1/parserdata_test.go
Normal file
245
gcc/testsuite/go.test/test/bench/go1/parserdata_test.go
Normal file
|
@ -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" +
|
||||
"+X86q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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+GHCZbC2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1mcnW7JmCri2y1MbKmcokR2TAXipUQkC6CwwQ12Gjnm44X1tVZUp3wlIdJOO5m" +
|
||||
"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" +
|
||||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YL90" +
|
||||
"xYSQhlD1QLJLQI0He9BzCEnVUSqicw+8My4R9hISYkJGYIxj8ruAhMajQwXdcJGBSBFRYiEzLDQs" +
|
||||
"CajBMxmCr9tr+pNttLXxe3r5N7djRszWjJLEZs1mapMmmTJTQTNpSqUZsNU0JRlqNljWTbV+p7df" +
|
||||
"Lo0rUkVjdV+CKMDKORHjOxLhIwk9G21jFEYFD4XjWjw8wvyPogFPIeTDwiBloHASYHMk8xALgXwl" +
|
||||
"ATRqLTEQYWQsVkWQUKaMBwo7AQKQfAF3fSVyBBLobqUc9N30Yhd9lPGGxI9LQNomLwZp5ZZsMZkl" +
|
||||
"oF2Byvel2w26lwkZCYQKHFs8KDgeFO2+29nFIKMOG7yWYijLbKDKNtLaksQtZVRtZBGNkVAxCiCA" +
|
||||
"Y0LYLJWyyolpYoiIlGrAkS1LLY5k3YQxlKvO3TdNkNSU2Rdd21cyEIcUog9BsnPOQYJDHgyjFjMY" +
|
||||
"rbgvBfJuwtEhGMMokttuSiYYRmQzSrobTNZGFRBRJ0D9I/mJERaCCLCgGiqRrIBlFPnSl5lPE51v" +
|
||||
"mPyjjESFnwAxWlkO96k1MjkQjxldSypErtlBcLC2xJa5YIMOc9hTxTkPSHujC48AnAicrbndNoPO" +
|
||||
"N74pxoN1p5k0VDQyShtPkmhEPSBIBwWmSBAhFI4ntAwUbinCB4hQIFQWEEWCWrvE3qfzQrTTT7si" +
|
||||
"6zQ8MvTyensgBuMEix6adydCOBCBUjFYG+R5YCfYgcfe3KBA528A6ViECYJgPJNB3nSTyDyPKUoB" +
|
||||
"/mQIKxFDYbNYIYrQNbnFO2rWmvkt5vFGebcxXGlIkCiBwVLS2QolREpXmBd2Q8XDpAVtaSkE0BTO" +
|
||||
"nujaCkO9awitnCKKcMnFFHh6fqiPxztdZntuRCeDzyIgwh826nhMzIM2TOwEXW01STLWw5saZe6L" +
|
||||
"ZJoHfoIya3HY79edGjjYfToLT9W+yIpw8X2hhlKhzNjppSbn3t5mBXny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YUgOEQMeLhWFF1FeiKoHKwXDHI4GF4EzoogSYlFYVPFwyzgyUiM/HtTQzSwY3/935P/pVS" +
|
||||
"I5ztPxjuSv4UbQOH7cbKdMD1cq9uVWjVUZovZM7cZLxSrw2eWrDGsDgVWAPhYSdXl3xfH0oaTwfb" +
|
||||
"21zqsFhC8NIHdIQSGZveMwM7oSy4ZzP7nD3WnjXGmq73mP93ldP8PvgOpMwbfV1RvR+V/DOnF9rK" +
|
||||
"v9hdyRThQkN3QmOE"
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]
|
|
@ -36,7 +36,6 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
icc -O3 -ip -unroll -static binary-trees.c -lm
|
||||
*/
|
||||
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -34,6 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
* contributed by Premysl Hruby
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 <x
|
||||
if [ $mode = run ]; then
|
||||
run "gcc -O2 k-nucleotide.c $(pkg-config glib-2.0 --cflags --libs)" a.out <x
|
||||
fi
|
||||
run 'gccgo -O2 k-nucleotide.go' a.out <x
|
||||
run 'gccgo -O2 k-nucleotide-parallel.go' a.out <x
|
||||
run 'gc k-nucleotide' $O.out <x
|
||||
|
|
|
@ -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 internal "algorithms" for objects larger than a word: hashing, equality etc.
|
||||
|
||||
package main
|
||||
|
||||
type T struct {
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
// $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.
|
||||
|
||||
// Internally a map holds elements in up to 255 bytes of key+value.
|
||||
// When key or value or both are too large, it uses pointers to key+value
|
||||
// instead. Test all the combinations.
|
||||
|
||||
package main
|
||||
|
||||
func seq(x, y int) [1000]byte {
|
||||
|
@ -31,4 +35,105 @@ func main() {
|
|||
cmp(m[1], seq(11, 13))
|
||||
cmp(m[2], seq(2, 9))
|
||||
cmp(m[3], seq(3, 17))
|
||||
|
||||
|
||||
{
|
||||
type T [1]byte
|
||||
type V [1]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [100]byte
|
||||
type V [1]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [1]byte
|
||||
type V [100]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [1000]byte
|
||||
type V [1]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [1]byte
|
||||
type V [1000]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [1000]byte
|
||||
type V [1000]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [200]byte
|
||||
type V [1]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [1]byte
|
||||
type V [200]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
{
|
||||
type T [200]byte
|
||||
type V [200]byte
|
||||
m := make(map[T]V)
|
||||
m[T{}] = V{1}
|
||||
m[T{1}] = V{2}
|
||||
if x, y := m[T{}][0], m[T{1}][0]; x != 1 || y != 2 {
|
||||
println(x, y)
|
||||
panic("bad map")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 behavior of the blank identifier (_).
|
||||
|
||||
package main
|
||||
|
||||
import _ "fmt"
|
||||
|
@ -111,7 +113,7 @@ type I interface {
|
|||
|
||||
type TI struct{}
|
||||
|
||||
func (TI) M(x int, y int) {
|
||||
func (_ TI) M(x int, y int) {
|
||||
if x != y {
|
||||
println("invalid M call:", x, y)
|
||||
panic("bad M")
|
||||
|
|
|
@ -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.
|
||||
|
||||
// Test that incorrect uses of the blank identifer are caught.
|
||||
// Does not compile.
|
||||
|
||||
package _ // ERROR "invalid package name _"
|
||||
|
||||
func main() {
|
||||
|
|
26
gcc/testsuite/go.test/test/bom.go
Normal file
26
gcc/testsuite/go.test/test/bom.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
// 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.
|
||||
|
||||
// Test source file beginning with a byte order mark.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
prog = strings.Replace(prog, "BOM", "\uFEFF", -1)
|
||||
fmt.Print(prog)
|
||||
}
|
||||
|
||||
var prog = `BOM
|
||||
package main
|
||||
|
||||
func main() {
|
||||
}
|
||||
`
|
18
gcc/testsuite/go.test/test/bombad.go
Normal file
18
gcc/testsuite/go.test/test/bombad.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
// 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.
|
||||
|
||||
// Here for reference, but hard to test automatically
|
||||
// because the BOM muddles the
|
||||
// processing done by ../run.
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
// There's a bom here. // ERROR "BOM"
|
||||
// And here. // ERROR "BOM"
|
||||
/* And here.*/ // ERROR "BOM"
|
||||
println("hi there") // and here // ERROR "BOM"
|
||||
}
|
270
gcc/testsuite/go.test/test/bounds.go
Normal file
270
gcc/testsuite/go.test/test/bounds.go
Normal file
|
@ -0,0 +1,270 @@
|
|||
// errorcheck -0 -m -l
|
||||
|
||||
// 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 compiler diagnostic flags, that bounds check elimination
|
||||
// is eliminating the correct checks.
|
||||
|
||||
package foo
|
||||
|
||||
var (
|
||||
s []int
|
||||
|
||||
a1 [1]int
|
||||
a1k [1000]int
|
||||
a100k [100000]int
|
||||
|
||||
p1 *[1]int
|
||||
p1k *[1000]int
|
||||
p100k *[100000]int
|
||||
|
||||
i int
|
||||
ui uint
|
||||
i8 int8
|
||||
ui8 uint8
|
||||
i16 int16
|
||||
ui16 uint16
|
||||
i32 int32
|
||||
ui32 uint32
|
||||
i64 int64
|
||||
ui64 uint64
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Most things need checks.
|
||||
use(s[i])
|
||||
use(a1[i])
|
||||
use(a1k[i])
|
||||
use(a100k[i])
|
||||
use(p1[i])
|
||||
use(p1k[i])
|
||||
use(p100k[i])
|
||||
|
||||
use(s[ui])
|
||||
use(a1[ui])
|
||||
use(a1k[ui])
|
||||
use(a100k[ui])
|
||||
use(p1[ui])
|
||||
use(p1k[ui])
|
||||
use(p100k[ui])
|
||||
|
||||
use(s[i8])
|
||||
use(a1[i8])
|
||||
use(a1k[i8])
|
||||
use(a100k[i8])
|
||||
use(p1[i8])
|
||||
use(p1k[i8])
|
||||
use(p100k[i8])
|
||||
|
||||
// Unsigned 8-bit numbers don't need checks for len >= 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
|
||||
}
|
|
@ -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.
|
||||
|
|
28
gcc/testsuite/go.test/test/bugs/bug434.dir/one.go
Normal file
28
gcc/testsuite/go.test/test/bugs/bug434.dir/one.go
Normal file
|
@ -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) }
|
||||
|
||||
|
||||
|
22
gcc/testsuite/go.test/test/bugs/bug434.dir/two.go
Normal file
22
gcc/testsuite/go.test/test/bugs/bug434.dir/two.go
Normal file
|
@ -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()
|
||||
}
|
10
gcc/testsuite/go.test/test/bugs/bug434.go
Normal file
10
gcc/testsuite/go.test/test/bugs/bug434.go
Normal file
|
@ -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
|
|
@ -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 (
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 <http://blog.onideas.ws/eratosthenes.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
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// skip
|
||||
// # generated by cmplxdivide.c
|
||||
|
||||
package main
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
77
gcc/testsuite/go.test/test/const4.go
Normal file
77
gcc/testsuite/go.test/test/const4.go
Normal file
|
@ -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")
|
||||
}
|
||||
}
|
33
gcc/testsuite/go.test/test/const5.go
Normal file
33
gcc/testsuite/go.test/test/const5.go
Normal file
|
@ -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"
|
||||
)
|
||||
|
195
gcc/testsuite/go.test/test/convT2X.go
Normal file
195
gcc/testsuite/go.test/test/convT2X.go
Normal file
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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: ")
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue