Update to current Go testsuite.
* go.test/go-test.exp (filecmp): New procedure. (errchk): Handle quoted square brackets. (go-gc-tests): Set go_compile_args. Handle various new test lines. Skip a few new tests. * lib/go-torture.exp (go-torture-execute): Use go_compile_args. From-SVN: r183502
This commit is contained in:
parent
d1cab3a615
commit
efcf639fab
|
@ -1,3 +1,11 @@
|
|||
2012-01-24 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
* go.test/go-test.exp (filecmp): New procedure.
|
||||
(errchk): Handle quoted square brackets.
|
||||
(go-gc-tests): Set go_compile_args. Handle various new test
|
||||
lines. Skip a few new tests.
|
||||
* lib/go-torture.exp (go-torture-execute): Use go_compile_args.
|
||||
|
||||
2012-01-24 Richard Sandiford <rdsandiford@googlemail.com>
|
||||
|
||||
* lib/target-supports.exp (proc check_effective_target_vect_perm)
|
||||
|
|
|
@ -34,6 +34,38 @@
|
|||
load_lib go-dg.exp
|
||||
load_lib go-torture.exp
|
||||
|
||||
# Compare two files
|
||||
proc filecmp { file1 file2 testname } {
|
||||
set f1 [open $file1 r]
|
||||
set f2 [open $file2 r]
|
||||
set ok 1
|
||||
while { [gets $f1 line1] >= 0 } {
|
||||
if { [gets $f2 line2] < 0 } {
|
||||
verbose -log "output mismatch: $file2 shorter than $file1"
|
||||
set ok 0
|
||||
break
|
||||
}
|
||||
if { $line1 != $line2 } {
|
||||
verbose -log "output mismatch comparing $file1 and $file2"
|
||||
verbose -log "expected \"$line1\""
|
||||
verbose -log "got \"$line2\""
|
||||
set ok 0
|
||||
break
|
||||
}
|
||||
}
|
||||
if { [gets $f2 line2] >= 0 } {
|
||||
verbose -log "output mismatch: $file1 shorter than $file2"
|
||||
set ok 0
|
||||
}
|
||||
close $f1
|
||||
close $f2
|
||||
if { ! $ok } {
|
||||
fail $testname
|
||||
} else {
|
||||
pass $testname
|
||||
}
|
||||
}
|
||||
|
||||
# Implement errchk
|
||||
proc errchk { test opts } {
|
||||
global dg-do-what-default
|
||||
|
@ -56,6 +88,14 @@ proc errchk { test opts } {
|
|||
continue
|
||||
}
|
||||
regsub "// \(GCCGO_\)?ERROR \"\(\[^\"\]*\)\".*$" $copy_line "// \{ dg-error \"\\2\" \}" out_line
|
||||
if [string match "*dg-error*\\\[*" $out_line] {
|
||||
set index [string first "dg-error" $out_line]
|
||||
regsub -start $index -all "\\\\\\\[" $out_line "\\\\\\\\\\\[" out_line
|
||||
}
|
||||
if [string match "*dg-error*\\\]*" $out_line] {
|
||||
set index [string first "dg-error" $out_line]
|
||||
regsub -start $index -all "\\\\\\\]" $out_line "\\\\\\\\\\\]" out_line
|
||||
}
|
||||
if [string match "*dg-error*.\**" $out_line] {
|
||||
# I worked out the right number of backslashes by
|
||||
# experimentation, not analysis.
|
||||
|
@ -199,6 +239,7 @@ proc go-gc-tests { } {
|
|||
global TOOL_OPTIONS
|
||||
global TORTURE_OPTIONS
|
||||
global dg-do-what-default
|
||||
global go_compile_args
|
||||
global go_execute_args
|
||||
global target_triplet
|
||||
|
||||
|
@ -230,13 +271,10 @@ proc go-gc-tests { } {
|
|||
continue
|
||||
}
|
||||
|
||||
# Skip the files in bench and garbage; they are not tests.
|
||||
# Skip the files in bench; they are not tests.
|
||||
if [string match "*go.test/test/bench/*" $test] {
|
||||
continue
|
||||
}
|
||||
if [string match "*go.test/test/garbage/*" $test] {
|
||||
continue
|
||||
}
|
||||
|
||||
# Skip files in sub-subdirectories: they are components of
|
||||
# other tests.
|
||||
|
@ -274,6 +312,20 @@ proc go-gc-tests { } {
|
|||
continue
|
||||
}
|
||||
|
||||
if { [file tail $test] == "init1.go" } {
|
||||
# This tests whether GC runs during init, which for gccgo
|
||||
# it currently does not.
|
||||
untested $name
|
||||
continue
|
||||
}
|
||||
|
||||
if { [file tail $test] == "closure.go" } {
|
||||
# This tests whether function closures do any memory
|
||||
# allocation, which for gccgo they currently do.
|
||||
untested $name
|
||||
continue
|
||||
}
|
||||
|
||||
set fd [open $test r]
|
||||
|
||||
set lines_ok 1
|
||||
|
@ -290,7 +342,8 @@ proc go-gc-tests { } {
|
|||
if { [ string match "*nacl*exit 0*" $test_line ] \
|
||||
|| [ string match "*exit 0*nacl*" $test_line ] \
|
||||
|| [ string match "*Android*exit 0*" $test_line ] \
|
||||
|| [ string match "*exit 0*Android*" $test_line ] } {
|
||||
|| [ string match "*exit 0*Android*" $test_line ] \
|
||||
|| [ string match "*\"\$GOOS\" == windows*" $test_line ] } {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -320,8 +373,9 @@ proc go-gc-tests { } {
|
|||
|
||||
close $fd
|
||||
|
||||
set go_compile_args ""
|
||||
set go_execute_args ""
|
||||
if { [regexp ".*\\\$A.out (\[^|&>\].*)\$" $test_line match progargs] } {
|
||||
if { [regexp ".*\\\$A.out (\[^|&>2\].*)\$" $test_line match progargs] } {
|
||||
set go_execute_args $progargs
|
||||
verbose -log "$test: go_execute_args is $go_execute_args"
|
||||
set index [string last " $progargs" $test_line]
|
||||
|
@ -393,6 +447,33 @@ proc go-gc-tests { } {
|
|||
# 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 \$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
|
||||
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] {
|
||||
verbose -log "$output_file >$base.p 2>&1"
|
||||
if { [catch "exec $output_file 2>$base.p" catcherr] != 0 } {
|
||||
verbose -log $catcherr
|
||||
fail "$name execution"
|
||||
untested "$name compare"
|
||||
} else {
|
||||
pass "$name execution"
|
||||
regsub "\\.go$" $test ".out" expect
|
||||
filecmp $expect $base.p "$name compare"
|
||||
}
|
||||
#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] \
|
||||
|
@ -405,6 +486,10 @@ proc go-gc-tests { } {
|
|||
} 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*" \
|
||||
|
@ -452,13 +537,27 @@ proc go-gc-tests { } {
|
|||
errchk $test ""
|
||||
} elseif { [string match \
|
||||
"// \$G \$D/\$F.dir/bug0.go && \$G \$D/\$F.dir/bug1.go || echo BUG*" \
|
||||
$test_line] } {
|
||||
$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"
|
||||
}
|
||||
set hold_runtests $runtests
|
||||
set runtests "go-test.exp"
|
||||
set dg-do-what-default "assemble"
|
||||
regsub "\\.go$" $test ".dir/bug0.go" file1
|
||||
regsub "\\.go$" $test ".dir/$name1" file1
|
||||
dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
|
||||
regsub "\\.go$" $test ".dir/bug1.go" file2
|
||||
regsub "\\.go$" $test ".dir/$name2" file2
|
||||
dg-test $file2 "-O" "-w $DEFAULT_GOCFLAGS"
|
||||
file delete "[file rootname [file tail $file1]].o"
|
||||
set runtests $hold_runtests
|
||||
|
@ -650,14 +749,28 @@ proc go-gc-tests { } {
|
|||
set runtests $hold_runtests
|
||||
} elseif { [string match \
|
||||
"// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
|
||||
$test_line ] } {
|
||||
$test_line ] || \
|
||||
[string match \
|
||||
"// \$G \$D/\$F.dir/p.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
|
||||
$test_line ] } {
|
||||
if { [string match \
|
||||
"// \$G \$D/\$F.dir/lib.go && \$G \$D/\$F.dir/main.go && \$L main.\$A && ./\$A.out || echo BUG*" \
|
||||
$test_line ] } {
|
||||
set name1 "lib.go"
|
||||
set name2 "main.go"
|
||||
} 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 name1 "p.go"
|
||||
set name2 "main.go"
|
||||
}
|
||||
set hold_runtests $runtests
|
||||
set runtests "go-test.exp"
|
||||
set dg-do-what-default "assemble"
|
||||
regsub "\\.go$" $test ".dir/lib.go" file1
|
||||
regsub "\\.go$" $test ".dir/$name1" 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
|
||||
regsub "\\.go$" $test ".dir/$name2" file2
|
||||
dg-test -keep-output $file2 "-O" "-w $DEFAULT_GOCFLAGS"
|
||||
set ofile2 "[file rootname [file tail $file2]].o"
|
||||
set dg-do-what-default "link"
|
||||
|
@ -705,7 +818,7 @@ proc go-gc-tests { } {
|
|||
errchk $file2 ""
|
||||
file delete "[file rootname [file tail $file1]].o"
|
||||
set runtests $hold_runtests
|
||||
} elseif { [string match "// true*" $test_line] } {
|
||||
} 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 &&" \
|
||||
|
@ -886,7 +999,7 @@ proc go-gc-tests { } {
|
|||
file delete $base-out.x
|
||||
go-torture-execute "./$base-out.go"
|
||||
}
|
||||
# file delete $base-out.go
|
||||
file delete $base-out.go
|
||||
}
|
||||
file delete $output_file
|
||||
set runtests $hold_runtests
|
||||
|
@ -894,23 +1007,96 @@ proc go-gc-tests { } {
|
|||
regsub "\\.go$" $test ".dir/a.go" file1
|
||||
regsub "\\.go$" $test ".dir/b.go" file2
|
||||
errchk "$file1" "$file2"
|
||||
} elseif { $test_line == "// \$G \$D/\$F.go \$D/z*.go && \$L \$F.\$A && ./\$A.out" } {
|
||||
set dir [file dirname $test]
|
||||
set go_compile_args [glob $dir/z*.go]
|
||||
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" } {
|
||||
set hold_runtests $runtests
|
||||
set runtests "go-test.exp"
|
||||
set dg-do-what-default "assemble"
|
||||
regsub "\\.go$" $test ".dir/pkg.go" file1
|
||||
dg-test -keep-output $file1 "" "-fgo-prefix=slow -w $DEFAULT_GOCFLAGS"
|
||||
set ofile1 "[file rootname [file tail $file1]].o"
|
||||
file rename -force $ofile1 slow.o
|
||||
dg-test -keep-output $file1 "-O2" "-fgo-prefix=fast -w $DEFAULT_GOCFLAGS"
|
||||
file rename -force $ofile1 fast.o
|
||||
set ofile2 "[file rootname [file tail $test]].o"
|
||||
dg-test -keep-output $test "-O" "-w $DEFAULT_GOCFLAGS"
|
||||
set output_file "./[file rootname [file tail $test]].exe"
|
||||
set comp_output [go_target_compile "$ofile2 slow.o fast.o" \
|
||||
$output_file "executable" "$options"]
|
||||
set comp_output [go-dg-prune $target_triplet $comp_output]
|
||||
if [string match "" $comp_output] {
|
||||
set result [go_load "$output_file" "" ""]
|
||||
set status [lindex $result 0]
|
||||
$status $name
|
||||
} else {
|
||||
verbose -log $comp_output
|
||||
fail $name
|
||||
}
|
||||
file delete slow.o fast.o $ofile2 $output_file
|
||||
set runtests $hold_runtests
|
||||
} elseif { [string match \
|
||||
"// \$G \$D/\$F.dir/pkg.go && \$G \$D/\$F.go || echo *" \
|
||||
$test_line ] } {
|
||||
set hold_runtests $runtests
|
||||
set runtests "go-test.exp"
|
||||
set dg-do-what-default "assemble"
|
||||
regsub "\\.go$" $test ".dir/pkg.go" file1
|
||||
dg-test -keep-output $file1 "-O" "-w $DEFAULT_GOCFLAGS"
|
||||
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 ""
|
||||
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 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" \
|
||||
|| $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.
|
||||
} elseif { $test_line == "// \$G -S \$D/\$F.go | egrep initdone >/dev/null && echo FAIL || true" } {
|
||||
} elseif { $test_line == "// \$G -S \$D/\$F.go | egrep initdone >/dev/null && echo BUG sinit || true" } {
|
||||
# This tests whether initializers are written out
|
||||
# statically. gccgo does not provide a way to test that,
|
||||
# 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" } {
|
||||
# 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" } {
|
||||
# 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.
|
||||
} else {
|
||||
clone_output "$name: unrecognized test line: $test_line"
|
||||
unsupported $name
|
||||
}
|
||||
|
||||
set go_compile_args ""
|
||||
set go_execute_args ""
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
// errchk $G -e $D/$F.go
|
||||
|
||||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
// Test that error messages say what the source file says
|
||||
// (uint8 vs byte, int32 vs. rune).
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
func f(byte) {}
|
||||
func g(uint8) {}
|
||||
|
||||
func main() {
|
||||
var x float64
|
||||
f(x) // ERROR "byte"
|
||||
g(x) // ERROR "uint8"
|
||||
|
||||
// Test across imports.
|
||||
|
||||
var ff fmt.Formatter
|
||||
var fs fmt.State
|
||||
ff.Format(fs, x) // ERROR "rune"
|
||||
|
||||
utf8.RuneStart(x) // ERROR "byte"
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
// $G $D/$F.go && $L $F.$A && ./$A.out
|
||||
|
||||
// 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.
|
||||
|
||||
func main() {
|
||||
var x interface{}
|
||||
|
||||
x = byte(1)
|
||||
switch x.(type) {
|
||||
case uint8:
|
||||
// ok
|
||||
default:
|
||||
println("byte != uint8")
|
||||
}
|
||||
|
||||
x = uint8(2)
|
||||
switch x.(type) {
|
||||
case byte:
|
||||
// ok
|
||||
default:
|
||||
println("uint8 != byte")
|
||||
}
|
||||
|
||||
rune32 := false
|
||||
x = rune(3)
|
||||
switch x.(type) {
|
||||
case int:
|
||||
// ok
|
||||
case int32:
|
||||
// must be new code
|
||||
rune32 = true
|
||||
default:
|
||||
println("rune != int and rune != int32")
|
||||
}
|
||||
|
||||
if rune32 {
|
||||
x = int32(4)
|
||||
} else {
|
||||
x = int(5)
|
||||
}
|
||||
switch x.(type) {
|
||||
case rune:
|
||||
// ok
|
||||
default:
|
||||
println("int (or int32) != rune")
|
||||
}
|
||||
}
|
|
@ -63,6 +63,11 @@ var tests = []struct {
|
|||
{"byte i", append([]byte{0, 1, 2}, []byte{3}...), []byte{0, 1, 2, 3}},
|
||||
{"byte j", append([]byte{0, 1, 2}, []byte{3, 4, 5}...), []byte{0, 1, 2, 3, 4, 5}},
|
||||
|
||||
{"bytestr a", append([]byte{}, "0"...), []byte("0")},
|
||||
{"bytestr b", append([]byte{}, "0123"...), []byte("0123")},
|
||||
|
||||
{"bytestr c", append([]byte("012"), "3"...), []byte("0123")},
|
||||
{"bytestr d", append([]byte("012"), "345"...), []byte("012345")},
|
||||
|
||||
{"int16 a", append([]int16{}), []int16{}},
|
||||
{"int16 b", append([]int16{}, 0), []int16{0}},
|
||||
|
|
|
@ -2,23 +2,24 @@
|
|||
# Use of this source code is governed by a BSD-style
|
||||
# license that can be found in the LICENSE file.
|
||||
|
||||
include ../../src/Make.inc
|
||||
include ../../../src/Make.inc
|
||||
|
||||
ALL=\
|
||||
parser\
|
||||
peano\
|
||||
tree\
|
||||
tree2\
|
||||
|
||||
all: $(addsuffix .out, $(ALL))
|
||||
|
||||
%.$O: %.go stats.go
|
||||
$(GC) $*.go stats.go
|
||||
$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go
|
||||
|
||||
%.out: %.$O
|
||||
$(LD) -o $@ $*.$O
|
||||
|
||||
%.bench: %.out
|
||||
./$*.out
|
||||
time ./$*.out
|
||||
|
||||
bench: $(addsuffix .bench, $(ALL))
|
||||
|
|
@ -12,27 +12,27 @@ import (
|
|||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
"http"
|
||||
_ "http/pprof"
|
||||
"log"
|
||||
)
|
||||
|
||||
var serve = flag.String("serve", "", "serve http on this address at end")
|
||||
|
||||
func isGoFile(dir *os.FileInfo) bool {
|
||||
return dir.IsRegular() &&
|
||||
!strings.HasPrefix(dir.Name, ".") && // ignore .files
|
||||
path.Ext(dir.Name) == ".go"
|
||||
func isGoFile(dir os.FileInfo) bool {
|
||||
return !dir.IsDir() &&
|
||||
!strings.HasPrefix(dir.Name(), ".") && // ignore .files
|
||||
path.Ext(dir.Name()) == ".go"
|
||||
}
|
||||
|
||||
func isPkgFile(dir *os.FileInfo) bool {
|
||||
func isPkgFile(dir os.FileInfo) bool {
|
||||
return isGoFile(dir) &&
|
||||
!strings.HasSuffix(dir.Name, "_test.go") // ignore test files
|
||||
!strings.HasSuffix(dir.Name(), "_test.go") // ignore test files
|
||||
}
|
||||
|
||||
func pkgName(filename string) string {
|
||||
|
@ -49,7 +49,7 @@ func parseDir(dirpath string) map[string]*ast.Package {
|
|||
_, pkgname := path.Split(dirpath)
|
||||
|
||||
// filter function to select the desired .go files
|
||||
filter := func(d *os.FileInfo) bool {
|
||||
filter := func(d os.FileInfo) bool {
|
||||
if isPkgFile(d) {
|
||||
// Some directories contain main packages: Only accept
|
||||
// files that belong to the expected package so that
|
||||
|
@ -57,7 +57,7 @@ func parseDir(dirpath string) map[string]*ast.Package {
|
|||
// found" errors.
|
||||
// Additionally, accept the special package name
|
||||
// fakePkgName if we are looking at cmd documentation.
|
||||
name := pkgName(dirpath + "/" + d.Name)
|
||||
name := pkgName(dirpath + "/" + d.Name())
|
||||
return name == pkgname
|
||||
}
|
||||
return false
|
||||
|
@ -66,17 +66,13 @@ func parseDir(dirpath string) map[string]*ast.Package {
|
|||
// get package AST
|
||||
pkgs, err := parser.ParseDir(token.NewFileSet(), dirpath, filter, parser.ParseComments)
|
||||
if err != nil {
|
||||
println("parse", dirpath, err.String())
|
||||
println("parse", dirpath, err.Error())
|
||||
panic("fail")
|
||||
}
|
||||
return pkgs
|
||||
}
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(4)
|
||||
go func() {}()
|
||||
go func() {}()
|
||||
go func() {}()
|
||||
st := &runtime.MemStats
|
||||
packages = append(packages, packages...)
|
||||
packages = append(packages, packages...)
|
||||
|
@ -86,7 +82,7 @@ func main() {
|
|||
flag.Parse()
|
||||
|
||||
var lastParsed []map[string]*ast.Package
|
||||
var t0 int64
|
||||
var t0 time.Time
|
||||
pkgroot := runtime.GOROOT() + "/src/pkg/"
|
||||
for pass := 0; pass < 2; pass++ {
|
||||
// Once the heap is grown to full size, reset counters.
|
||||
|
@ -95,7 +91,7 @@ func main() {
|
|||
// the average look much better than it actually is.
|
||||
st.NumGC = 0
|
||||
st.PauseTotalNs = 0
|
||||
t0 = time.Nanoseconds()
|
||||
t0 = time.Now()
|
||||
|
||||
for i := 0; i < *n; i++ {
|
||||
parsed := make([]map[string]*ast.Package, *p)
|
||||
|
@ -109,7 +105,7 @@ func main() {
|
|||
runtime.GC()
|
||||
runtime.GC()
|
||||
}
|
||||
t1 := time.Nanoseconds()
|
||||
t1 := time.Now()
|
||||
|
||||
fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
|
||||
st.Alloc, st.TotalAlloc,
|
||||
|
@ -124,7 +120,7 @@ func main() {
|
|||
}
|
||||
*/
|
||||
// Standard gotest benchmark output, collected by build dashboard.
|
||||
gcstats("BenchmarkParser", *n, t1-t0)
|
||||
gcstats("BenchmarkParser", *n, t1.Sub(t0))
|
||||
|
||||
if *serve != "" {
|
||||
log.Fatal(http.ListenAndServe(*serve, nil))
|
||||
|
@ -132,23 +128,20 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
var packages = []string{
|
||||
"archive/tar",
|
||||
"asn1",
|
||||
"big",
|
||||
"encoding/asn1",
|
||||
"math/big",
|
||||
"bufio",
|
||||
"bytes",
|
||||
"cmath",
|
||||
"math/cmplx",
|
||||
"compress/flate",
|
||||
"compress/gzip",
|
||||
"compress/zlib",
|
||||
"container/heap",
|
||||
"container/list",
|
||||
"container/ring",
|
||||
"container/vector",
|
||||
"crypto/aes",
|
||||
"crypto/block",
|
||||
"crypto/blowfish",
|
||||
"crypto/hmac",
|
||||
"crypto/md4",
|
||||
|
@ -167,20 +160,14 @@ var packages = []string{
|
|||
"debug/macho",
|
||||
"debug/elf",
|
||||
"debug/gosym",
|
||||
"debug/proc",
|
||||
"ebnf",
|
||||
"exp/ebnf",
|
||||
"encoding/ascii85",
|
||||
"encoding/base64",
|
||||
"encoding/binary",
|
||||
"encoding/git85",
|
||||
"encoding/hex",
|
||||
"encoding/pem",
|
||||
"exec",
|
||||
"exp/datafmt",
|
||||
"exp/draw",
|
||||
"exp/eval",
|
||||
"exp/iterable",
|
||||
"expvar",
|
||||
"os/exec",
|
||||
"flag",
|
||||
"fmt",
|
||||
"go/ast",
|
||||
|
@ -189,18 +176,18 @@ var packages = []string{
|
|||
"go/printer",
|
||||
"go/scanner",
|
||||
"go/token",
|
||||
"gob",
|
||||
"encoding/gob",
|
||||
"hash",
|
||||
"hash/adler32",
|
||||
"hash/crc32",
|
||||
"hash/crc64",
|
||||
"http",
|
||||
"net/http",
|
||||
"image",
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"io",
|
||||
"io/ioutil",
|
||||
"json",
|
||||
"encoding/json",
|
||||
"log",
|
||||
"math",
|
||||
"mime",
|
||||
|
@ -209,29 +196,29 @@ var packages = []string{
|
|||
"os/signal",
|
||||
"patch",
|
||||
"path",
|
||||
"rand",
|
||||
"math/rand",
|
||||
"reflect",
|
||||
"regexp",
|
||||
"rpc",
|
||||
"net/rpc",
|
||||
"runtime",
|
||||
"scanner",
|
||||
"text/scanner",
|
||||
"sort",
|
||||
"smtp",
|
||||
"net/smtp",
|
||||
"strconv",
|
||||
"strings",
|
||||
"sync",
|
||||
"syscall",
|
||||
"syslog",
|
||||
"tabwriter",
|
||||
"template",
|
||||
"log/syslog",
|
||||
"text/tabwriter",
|
||||
"text/template",
|
||||
"testing",
|
||||
"testing/iotest",
|
||||
"testing/quick",
|
||||
"testing/script",
|
||||
"time",
|
||||
"unicode",
|
||||
"utf8",
|
||||
"utf16",
|
||||
"unicode/utf8",
|
||||
"unicode/utf16",
|
||||
"websocket",
|
||||
"xml",
|
||||
"encoding/xml",
|
||||
}
|
|
@ -12,31 +12,25 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
|
||||
type Number struct {
|
||||
next *Number
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Peano primitives
|
||||
|
||||
func zero() *Number { return nil }
|
||||
|
||||
|
||||
func is_zero(x *Number) bool { return x == nil }
|
||||
|
||||
|
||||
func add1(x *Number) *Number {
|
||||
e := new(Number)
|
||||
e.next = x
|
||||
return e
|
||||
}
|
||||
|
||||
|
||||
func sub1(x *Number) *Number { return x.next }
|
||||
|
||||
|
||||
func add(x, y *Number) *Number {
|
||||
if is_zero(y) {
|
||||
return x
|
||||
|
@ -45,7 +39,6 @@ func add(x, y *Number) *Number {
|
|||
return add(add1(x), sub1(y))
|
||||
}
|
||||
|
||||
|
||||
func mul(x, y *Number) *Number {
|
||||
if is_zero(x) || is_zero(y) {
|
||||
return zero()
|
||||
|
@ -54,7 +47,6 @@ func mul(x, y *Number) *Number {
|
|||
return add(mul(x, sub1(y)), x)
|
||||
}
|
||||
|
||||
|
||||
func fact(n *Number) *Number {
|
||||
if is_zero(n) {
|
||||
return add1(zero())
|
||||
|
@ -63,7 +55,6 @@ func fact(n *Number) *Number {
|
|||
return mul(fact(sub1(n)), n)
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Helpers to generate/count Peano integers
|
||||
|
||||
|
@ -75,7 +66,6 @@ func gen(n int) *Number {
|
|||
return zero()
|
||||
}
|
||||
|
||||
|
||||
func count(x *Number) int {
|
||||
if is_zero(x) {
|
||||
return 0
|
||||
|
@ -84,7 +74,6 @@ func count(x *Number) int {
|
|||
return count(sub1(x)) + 1
|
||||
}
|
||||
|
||||
|
||||
func check(x *Number, expected int) {
|
||||
var c = count(x)
|
||||
if c != expected {
|
||||
|
@ -92,7 +81,6 @@ func check(x *Number, expected int) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Test basic functionality
|
||||
|
||||
|
@ -117,19 +105,17 @@ func verify() {
|
|||
check(fact(gen(5)), 120)
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Factorial
|
||||
|
||||
|
||||
func main() {
|
||||
t0 := time.Nanoseconds()
|
||||
t0 := time.Now()
|
||||
verify()
|
||||
for i := 0; i <= 9; i++ {
|
||||
print(i, "! = ", count(fact(gen(i))), "\n")
|
||||
}
|
||||
runtime.GC()
|
||||
t1 := time.Nanoseconds()
|
||||
t1 := time.Now()
|
||||
|
||||
gcstats("BenchmarkPeano", 1, t1-t0)
|
||||
gcstats("BenchmarkPeano", 1, t1.Sub(t0))
|
||||
}
|
|
@ -8,12 +8,13 @@ import (
|
|||
"fmt"
|
||||
"runtime"
|
||||
"sort"
|
||||
"time"
|
||||
)
|
||||
|
||||
func gcstats(name string, n int, t int64) {
|
||||
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/int64(n))
|
||||
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))
|
||||
nn := int(st.NumGC)
|
||||
|
@ -22,13 +23,14 @@ func gcstats(name string, n int, t int64) {
|
|||
}
|
||||
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.%sScan: %v\n", name, st.ScanDist)
|
||||
|
||||
// fmt.Printf("garbage.%sScan: %v\n", name, st.ScanDist)
|
||||
}
|
||||
|
||||
type T []uint64
|
||||
func (t T) Len() int { return len(t) }
|
||||
func (t T) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
|
||||
|
||||
func (t T) Len() int { return len(t) }
|
||||
func (t T) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
|
||||
func (t T) Less(i, j int) bool { return t[i] < t[j] }
|
||||
|
||||
func tukey5(raw []uint64) (lo, q1, q2, q3, hi uint64) {
|
|
@ -68,7 +68,7 @@ const minDepth = 4
|
|||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
t0 := time.Nanoseconds()
|
||||
t0 := time.Now()
|
||||
|
||||
maxDepth := *n
|
||||
if minDepth+2 > *n {
|
||||
|
@ -93,8 +93,8 @@ func main() {
|
|||
}
|
||||
fmt.Printf("long lived tree of depth %d\t check: %d\n", maxDepth, longLivedTree.itemCheck())
|
||||
|
||||
t1 := time.Nanoseconds()
|
||||
t1 := time.Now()
|
||||
|
||||
// Standard gotest benchmark output, collected by build dashboard.
|
||||
gcstats("BenchmarkTree", *n, t1-t0)
|
||||
gcstats("BenchmarkTree", *n, t1.Sub(t0))
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
// Copyright 2012 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const BranchingFactor = 4
|
||||
|
||||
type Object struct {
|
||||
child [BranchingFactor]*Object
|
||||
}
|
||||
|
||||
var (
|
||||
cpus = flag.Int("cpus", 1, "number of cpus to use")
|
||||
heapsize = flag.Int64("heapsize", 100*1024*1024, "size of the heap in bytes")
|
||||
cpuprofile = flag.String("cpuprofile", "", "write cpu profile to file")
|
||||
|
||||
lastPauseNs uint64 = 0
|
||||
lastFree uint64 = 0
|
||||
heap *Object
|
||||
calls [20]int
|
||||
numobjects int64
|
||||
)
|
||||
|
||||
func buildHeap() {
|
||||
objsize := int64(unsafe.Sizeof(Object{}))
|
||||
heap, _ = buildTree(float64(objsize), float64(*heapsize), 0)
|
||||
fmt.Printf("*** built heap: %.0f MB; (%d objects * %d bytes)\n",
|
||||
float64(*heapsize)/1048576, numobjects, objsize)
|
||||
}
|
||||
|
||||
func buildTree(objsize, size float64, depth int) (*Object, float64) {
|
||||
calls[depth]++
|
||||
x := &Object{}
|
||||
numobjects++
|
||||
subtreeSize := (size - objsize) / BranchingFactor
|
||||
alloc := objsize
|
||||
for i := 0; i < BranchingFactor && alloc < size; i++ {
|
||||
c, n := buildTree(objsize, subtreeSize, depth+1)
|
||||
x.child[i] = c
|
||||
alloc += n
|
||||
}
|
||||
return x, alloc
|
||||
}
|
||||
|
||||
func gc() {
|
||||
runtime.GC()
|
||||
runtime.UpdateMemStats()
|
||||
pause := runtime.MemStats.PauseTotalNs
|
||||
inuse := runtime.MemStats.Alloc
|
||||
free := runtime.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,
|
||||
float64(inuse)/1048576)
|
||||
lastPauseNs = pause
|
||||
lastFree = free
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
buildHeap()
|
||||
runtime.GOMAXPROCS(*cpus)
|
||||
runtime.UpdateMemStats()
|
||||
lastPauseNs = runtime.MemStats.PauseTotalNs
|
||||
lastFree = runtime.MemStats.TotalAlloc - runtime.MemStats.Alloc
|
||||
if *cpuprofile != "" {
|
||||
f, err := os.Create(*cpuprofile)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
pprof.StartCPUProfile(f)
|
||||
defer pprof.StopCPUProfile()
|
||||
}
|
||||
for i := 0; i < 10; i++ {
|
||||
gc()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
include $(GOROOT)/src/Make.inc
|
||||
|
||||
TARG=go1
|
||||
GOFILES=\
|
||||
dummy.go\
|
||||
|
||||
include $(GOROOT)/src/Make.pkg
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,261 @@
|
|||
go object linux amd64 weekly.2012-01-15 11312+ X:none
|
||||
exports automatically generated from
|
||||
_testmain.go in package "main"
|
||||
|
||||
$$ // exports
|
||||
package main
|
||||
import runtime "runtime"
|
||||
import go1 "go1"
|
||||
import testing "testing"
|
||||
import regexp "regexp"
|
||||
import time "time" // indirect
|
||||
type @"time".zone struct { @"time".name string; @"time".offset int; @"time".isDST bool }
|
||||
type @"time".zoneTrans struct { @"time".when int64; @"time".index uint8; @"time".isstd bool; @"time".isutc bool }
|
||||
type @"time".Location struct { @"time".name string; @"time".zone []@"time".zone; @"time".tx []@"time".zoneTrans; @"time".cacheStart int64; @"time".cacheEnd int64; @"time".cacheZone *@"time".zone }
|
||||
func (@"time".l *@"time".Location) String() (? string)
|
||||
func (@"time".l *@"time".Location) @"time".get() (? *@"time".Location)
|
||||
func (@"time".l *@"time".Location) @"time".lookup(@"time".sec int64) (@"time".name string, @"time".offset int, @"time".isDST bool, @"time".start int64, @"time".end int64)
|
||||
func (@"time".l *@"time".Location) @"time".lookupName(@"time".name string "noescape") (@"time".offset int, @"time".isDST bool, @"time".ok bool)
|
||||
func (@"time".l *@"time".Location) @"time".lookupOffset(@"time".offset int) (@"time".name string, @"time".isDST bool, @"time".ok bool)
|
||||
type @"time".Duration int64
|
||||
func (@"time".d @"time".Duration) Hours() (? float64)
|
||||
func (@"time".d @"time".Duration) Minutes() (? float64)
|
||||
func (@"time".d @"time".Duration) Nanoseconds() (? int64) { return int64(@"time".d) }
|
||||
func (@"time".d @"time".Duration) Seconds() (? float64)
|
||||
func (@"time".d @"time".Duration) String() (? string)
|
||||
type @"time".Month int
|
||||
func (@"time".m @"time".Month) String() (? string) { return @"time".months[@"time".m - @"time".Month(1)] }
|
||||
type @"time".Weekday int
|
||||
func (@"time".d @"time".Weekday) String() (? string) { return @"time".days[@"time".d] }
|
||||
type @"time".Time struct { @"time".sec int64; @"time".nsec int32; @"time".loc *@"time".Location }
|
||||
func (@"time".t @"time".Time) Add(@"time".d @"time".Duration) (? @"time".Time)
|
||||
func (@"time".t @"time".Time) AddDate(@"time".years int, @"time".months int, @"time".days int) (? @"time".Time)
|
||||
func (@"time".t @"time".Time "noescape") After(@"time".u @"time".Time "noescape") (? bool) { return @"time".t.@"time".sec > @"time".u.@"time".sec || @"time".t.@"time".sec == @"time".u.@"time".sec && @"time".t.@"time".nsec > @"time".u.@"time".nsec }
|
||||
func (@"time".t @"time".Time "noescape") Before(@"time".u @"time".Time "noescape") (? bool) { return @"time".t.@"time".sec < @"time".u.@"time".sec || @"time".t.@"time".sec == @"time".u.@"time".sec && @"time".t.@"time".nsec < @"time".u.@"time".nsec }
|
||||
func (@"time".t @"time".Time) Clock() (@"time".hour int, @"time".min int, @"time".sec int)
|
||||
func (@"time".t @"time".Time) Date() (@"time".year int, @"time".month @"time".Month, @"time".day int)
|
||||
func (@"time".t @"time".Time) Day() (? int)
|
||||
func (@"time".t @"time".Time "noescape") Equal(@"time".u @"time".Time "noescape") (? bool) { return @"time".t.@"time".sec == @"time".u.@"time".sec && @"time".t.@"time".nsec == @"time".u.@"time".nsec }
|
||||
func (@"time".t @"time".Time) Format(@"time".layout string) (? string)
|
||||
func (@"time".t *@"time".Time "noescape") GobDecode(@"time".buf []byte "noescape") (? error)
|
||||
func (@"time".t @"time".Time) GobEncode() (? []byte, ? error)
|
||||
func (@"time".t @"time".Time) Hour() (? int)
|
||||
func (@"time".t @"time".Time) ISOWeek() (@"time".year int, @"time".week int)
|
||||
func (@"time".t @"time".Time) In(@"time".loc *@"time".Location) (? @"time".Time)
|
||||
func (@"time".t @"time".Time "noescape") IsZero() (? bool) { return @"time".t.@"time".sec == 0 && @"time".t.@"time".nsec == 0 }
|
||||
func (@"time".t @"time".Time) Local() (? @"time".Time)
|
||||
func (@"time".t @"time".Time) Location() (? *@"time".Location)
|
||||
func (@"time".t @"time".Time) MarshalJSON() (? []byte, ? error)
|
||||
func (@"time".t @"time".Time) Minute() (? int)
|
||||
func (@"time".t @"time".Time) Month() (? @"time".Month)
|
||||
func (@"time".t @"time".Time "noescape") Nanosecond() (? int) { return int(@"time".t.@"time".nsec) }
|
||||
func (@"time".t @"time".Time) Second() (? int)
|
||||
func (@"time".t @"time".Time) String() (? string)
|
||||
func (@"time".t @"time".Time "noescape") Sub(@"time".u @"time".Time "noescape") (? @"time".Duration) { return @"time".Duration(@"time".t.@"time".sec - @"time".u.@"time".sec) * @"time".Duration(1000000000) + @"time".Duration(@"time".t.@"time".nsec - @"time".u.@"time".nsec) }
|
||||
func (@"time".t @"time".Time) UTC() (? @"time".Time)
|
||||
func (@"time".t @"time".Time "noescape") Unix() (? int64) { return @"time".t.@"time".sec + -62135596800 }
|
||||
func (@"time".t @"time".Time "noescape") UnixNano() (? int64) { return (@"time".t.@"time".sec + -62135596800) * 1000000000 + int64(@"time".t.@"time".nsec) }
|
||||
func (@"time".t *@"time".Time "noescape") UnmarshalJSON(@"time".data []byte "noescape") (@"time".err error)
|
||||
func (@"time".t @"time".Time) Weekday() (? @"time".Weekday)
|
||||
func (@"time".t @"time".Time) Year() (? int)
|
||||
func (@"time".t @"time".Time) Zone() (@"time".name string, @"time".offset int)
|
||||
func (@"time".t @"time".Time) @"time".abs() (? uint64)
|
||||
func (@"time".t @"time".Time) @"time".date(@"time".full bool) (@"time".year int, @"time".month @"time".Month, @"time".day int, @"time".yday int)
|
||||
type @"testing".common struct { @"testing".output []byte; @"testing".failed bool; @"testing".start @"time".Time; @"testing".duration @"time".Duration; @"testing".self interface {}; @"testing".signal chan interface {} }
|
||||
func (@"testing".c *@"testing".common "noescape") Error(@"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") Errorf(@"testing".format string "noescape", @"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") Fail() { @"testing".c.@"testing".failed = true }
|
||||
func (@"testing".c *@"testing".common "noescape") FailNow()
|
||||
func (@"testing".c *@"testing".common "noescape") Failed() (? bool) { return @"testing".c.@"testing".failed }
|
||||
func (@"testing".c *@"testing".common "noescape") Fatal(@"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") Fatalf(@"testing".format string "noescape", @"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") Log(@"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") Logf(@"testing".format string "noescape", @"testing".args ...interface {} "noescape")
|
||||
func (@"testing".c *@"testing".common "noescape") @"testing".log(@"testing".s string)
|
||||
type @"testing".T struct { ? @"testing".common; @"testing".name string; @"testing".startParallel chan bool }
|
||||
func (@"testing".t *@"testing".T "noescape") Parallel()
|
||||
func (@"testing".t *@"testing".T "noescape") @"testing".report()
|
||||
type @"testing".InternalTest struct { Name string; F func(? *@"testing".T) }
|
||||
var @"".tests []@"testing".InternalTest
|
||||
type @"testing".BenchmarkResult struct { N int; T @"time".Duration; Bytes int64 }
|
||||
func (@"testing".r @"testing".BenchmarkResult) NsPerOp() (? int64)
|
||||
func (@"testing".r @"testing".BenchmarkResult) String() (? string)
|
||||
func (@"testing".r @"testing".BenchmarkResult) @"testing".mbPerSec() (? float64)
|
||||
type @"testing".B struct { ? @"testing".common; N int; @"testing".benchmark @"testing".InternalBenchmark; @"testing".bytes int64; @"testing".timerOn bool; @"testing".result @"testing".BenchmarkResult }
|
||||
func (@"testing".b *@"testing".B "noescape") ResetTimer()
|
||||
func (@"testing".b *@"testing".B "noescape") SetBytes(@"testing".n int64) { @"testing".b.@"testing".bytes = @"testing".n }
|
||||
func (@"testing".b *@"testing".B "noescape") StartTimer()
|
||||
func (@"testing".b *@"testing".B "noescape") StopTimer()
|
||||
func (@"testing".b *@"testing".B) @"testing".launch()
|
||||
func (@"testing".b *@"testing".B "noescape") @"testing".nsPerOp() (? int64)
|
||||
func (@"testing".b *@"testing".B) @"testing".run() (? @"testing".BenchmarkResult)
|
||||
func (@"testing".b *@"testing".B) @"testing".runN(@"testing".n int)
|
||||
func (@"testing".b *@"testing".B "noescape") @"testing".trimOutput()
|
||||
type @"testing".InternalBenchmark struct { Name string; F func(@"testing".b *@"testing".B) }
|
||||
var @"".benchmarks []@"testing".InternalBenchmark
|
||||
type @"testing".InternalExample struct { Name string; F func(); Output string }
|
||||
var @"".examples []@"testing".InternalExample
|
||||
var @"".matchPat string
|
||||
import syntax "regexp/syntax" // indirect
|
||||
type @"regexp/syntax".InstOp uint8
|
||||
type @"regexp/syntax".Inst struct { Op @"regexp/syntax".InstOp; Out uint32; Arg uint32; Rune []rune }
|
||||
func (@"regexp/syntax".i *@"regexp/syntax".Inst "noescape") MatchEmptyWidth(@"regexp/syntax".before rune, @"regexp/syntax".after rune) (? bool)
|
||||
func (@"regexp/syntax".i *@"regexp/syntax".Inst "noescape") MatchRune(@"regexp/syntax".r rune) (? bool)
|
||||
func (@"regexp/syntax".i *@"regexp/syntax".Inst "noescape") String() (? string)
|
||||
func (@"regexp/syntax".i *@"regexp/syntax".Inst "noescape") @"regexp/syntax".op() (? @"regexp/syntax".InstOp)
|
||||
type @"regexp/syntax".EmptyOp uint8
|
||||
type @"regexp/syntax".Prog struct { Inst []@"regexp/syntax".Inst; Start int; NumCap int }
|
||||
func (@"regexp/syntax".p *@"regexp/syntax".Prog "noescape") Prefix() (@"regexp/syntax".prefix string, @"regexp/syntax".complete bool)
|
||||
func (@"regexp/syntax".p *@"regexp/syntax".Prog "noescape") StartCond() (? @"regexp/syntax".EmptyOp)
|
||||
func (@"regexp/syntax".p *@"regexp/syntax".Prog "noescape") String() (? string)
|
||||
func (@"regexp/syntax".p *@"regexp/syntax".Prog "noescape") @"regexp/syntax".skipNop(@"regexp/syntax".pc uint32) (? *@"regexp/syntax".Inst)
|
||||
import sync "sync" // indirect
|
||||
type @"sync".Mutex struct { @"sync".state int32; @"sync".sema uint32 }
|
||||
func (@"sync".m *@"sync".Mutex) Lock()
|
||||
func (@"sync".m *@"sync".Mutex) Unlock()
|
||||
type @"regexp".thread struct { @"regexp".inst *@"regexp/syntax".Inst; @"regexp".cap []int }
|
||||
type @"regexp".entry struct { @"regexp".pc uint32; @"regexp".t *@"regexp".thread }
|
||||
type @"regexp".queue struct { @"regexp".sparse []uint32; @"regexp".dense []@"regexp".entry }
|
||||
type @"regexp".inputBytes struct { @"regexp".str []byte }
|
||||
func (@"regexp".i *@"regexp".inputBytes "noescape") @"regexp".canCheckPrefix() (? bool) { return true }
|
||||
func (@"regexp".i *@"regexp".inputBytes "noescape") @"regexp".context(@"regexp".pos int) (? @"regexp/syntax".EmptyOp)
|
||||
func (@"regexp".i *@"regexp".inputBytes "noescape") @"regexp".hasPrefix(@"regexp".re *@"regexp".Regexp "noescape") (? bool)
|
||||
func (@"regexp".i *@"regexp".inputBytes "noescape") @"regexp".index(@"regexp".re *@"regexp".Regexp "noescape", @"regexp".pos int) (? int)
|
||||
func (@"regexp".i *@"regexp".inputBytes "noescape") @"regexp".step(@"regexp".pos int) (? rune, ? int)
|
||||
type @"regexp".inputString struct { @"regexp".str string }
|
||||
func (@"regexp".i *@"regexp".inputString "noescape") @"regexp".canCheckPrefix() (? bool) { return true }
|
||||
func (@"regexp".i *@"regexp".inputString "noescape") @"regexp".context(@"regexp".pos int) (? @"regexp/syntax".EmptyOp)
|
||||
func (@"regexp".i *@"regexp".inputString "noescape") @"regexp".hasPrefix(@"regexp".re *@"regexp".Regexp "noescape") (? bool)
|
||||
func (@"regexp".i *@"regexp".inputString "noescape") @"regexp".index(@"regexp".re *@"regexp".Regexp "noescape", @"regexp".pos int) (? int)
|
||||
func (@"regexp".i *@"regexp".inputString "noescape") @"regexp".step(@"regexp".pos int) (? rune, ? int)
|
||||
import io "io" // indirect
|
||||
type @"io".RuneReader interface { ReadRune() (@"io".r rune, @"io".size int, @"io".err error) }
|
||||
type @"regexp".inputReader struct { @"regexp".r @"io".RuneReader; @"regexp".atEOT bool; @"regexp".pos int }
|
||||
func (@"regexp".i *@"regexp".inputReader "noescape") @"regexp".canCheckPrefix() (? bool) { return false }
|
||||
func (@"regexp".i *@"regexp".inputReader "noescape") @"regexp".context(@"regexp".pos int) (? @"regexp/syntax".EmptyOp) { return @"regexp/syntax".EmptyOp(0) }
|
||||
func (@"regexp".i *@"regexp".inputReader "noescape") @"regexp".hasPrefix(@"regexp".re *@"regexp".Regexp "noescape") (? bool) { return false }
|
||||
func (@"regexp".i *@"regexp".inputReader "noescape") @"regexp".index(@"regexp".re *@"regexp".Regexp "noescape", @"regexp".pos int) (? int) { return -1 }
|
||||
func (@"regexp".i *@"regexp".inputReader "noescape") @"regexp".step(@"regexp".pos int) (? rune, ? int)
|
||||
type @"regexp".input interface { @"regexp".step(@"regexp".pos int) (@"regexp".r rune, @"regexp".width int); @"regexp".canCheckPrefix() (? bool); @"regexp".hasPrefix(@"regexp".re *@"regexp".Regexp) (? bool); @"regexp".index(@"regexp".re *@"regexp".Regexp, @"regexp".pos int) (? int); @"regexp".context(@"regexp".pos int) (? @"regexp/syntax".EmptyOp) }
|
||||
type @"regexp".machine struct { @"regexp".re *@"regexp".Regexp; @"regexp".p *@"regexp/syntax".Prog; @"regexp".q0 @"regexp".queue; @"regexp".q1 @"regexp".queue; @"regexp".pool []*@"regexp".thread; @"regexp".matched bool; @"regexp".matchcap []int; @"regexp".inputBytes @"regexp".inputBytes; @"regexp".inputString @"regexp".inputString; @"regexp".inputReader @"regexp".inputReader }
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".add(@"regexp".q *@"regexp".queue "noescape", @"regexp".pc uint32, @"regexp".pos int, @"regexp".cap []int "noescape", @"regexp".cond @"regexp/syntax".EmptyOp, @"regexp".t *@"regexp".thread) (? *@"regexp".thread)
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".alloc(@"regexp".i *@"regexp/syntax".Inst) (? *@"regexp".thread)
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".clear(@"regexp".q *@"regexp".queue "noescape")
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".free(@"regexp".t *@"regexp".thread)
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".init(@"regexp".ncap int)
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".match(@"regexp".i @"regexp".input, @"regexp".pos int) (? bool)
|
||||
func (@"regexp".m *@"regexp".machine) @"regexp".newInputBytes(@"regexp".b []byte) (? @"regexp".input)
|
||||
func (@"regexp".m *@"regexp".machine) @"regexp".newInputReader(@"regexp".r @"io".RuneReader) (? @"regexp".input)
|
||||
func (@"regexp".m *@"regexp".machine) @"regexp".newInputString(@"regexp".s string) (? @"regexp".input)
|
||||
func (@"regexp".m *@"regexp".machine "noescape") @"regexp".step(@"regexp".runq *@"regexp".queue "noescape", @"regexp".nextq *@"regexp".queue "noescape", @"regexp".pos int, @"regexp".nextPos int, @"regexp".c rune, @"regexp".nextCond @"regexp/syntax".EmptyOp)
|
||||
type @"regexp".Regexp struct { @"regexp".expr string; @"regexp".prog *@"regexp/syntax".Prog; @"regexp".prefix string; @"regexp".prefixBytes []byte; @"regexp".prefixComplete bool; @"regexp".prefixRune rune; @"regexp".cond @"regexp/syntax".EmptyOp; @"regexp".numSubexp int; @"regexp".longest bool; @"regexp".mu @"sync".Mutex; @"regexp".machine []*@"regexp".machine }
|
||||
func (@"regexp".re *@"regexp".Regexp) Find(@"regexp".b []byte) (? []byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAll(@"regexp".b []byte, @"regexp".n int) (? [][]byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllIndex(@"regexp".b []byte, @"regexp".n int) (? [][]int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllString(@"regexp".s string, @"regexp".n int) (? []string)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllStringIndex(@"regexp".s string, @"regexp".n int) (? [][]int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllStringSubmatch(@"regexp".s string, @"regexp".n int) (? [][]string)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllStringSubmatchIndex(@"regexp".s string, @"regexp".n int) (? [][]int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllSubmatch(@"regexp".b []byte, @"regexp".n int) (? [][][]byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindAllSubmatchIndex(@"regexp".b []byte, @"regexp".n int) (? [][]int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindIndex(@"regexp".b []byte) (@"regexp".loc []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindReaderIndex(@"regexp".r @"io".RuneReader) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindReaderSubmatchIndex(@"regexp".r @"io".RuneReader) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindString(@"regexp".s string) (? string)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindStringIndex(@"regexp".s string) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindStringSubmatch(@"regexp".s string) (? []string)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindStringSubmatchIndex(@"regexp".s string) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindSubmatch(@"regexp".b []byte) (? [][]byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) FindSubmatchIndex(@"regexp".b []byte) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp "noescape") LiteralPrefix() (@"regexp".prefix string, @"regexp".complete bool) { return @"regexp".re.@"regexp".prefix, @"regexp".re.@"regexp".prefixComplete }
|
||||
func (@"regexp".re *@"regexp".Regexp) Match(@"regexp".b []byte) (? bool)
|
||||
func (@"regexp".re *@"regexp".Regexp) MatchReader(@"regexp".r @"io".RuneReader) (? bool)
|
||||
func (@"regexp".re *@"regexp".Regexp) MatchString(@"regexp".s string) (? bool)
|
||||
func (@"regexp".re *@"regexp".Regexp "noescape") NumSubexp() (? int) { return @"regexp".re.@"regexp".numSubexp }
|
||||
func (@"regexp".re *@"regexp".Regexp) ReplaceAll(@"regexp".src []byte, @"regexp".repl []byte "noescape") (? []byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) ReplaceAllFunc(@"regexp".src []byte, @"regexp".repl func(? []byte) (? []byte) "noescape") (? []byte)
|
||||
func (@"regexp".re *@"regexp".Regexp) ReplaceAllString(@"regexp".src string, @"regexp".repl string "noescape") (? string)
|
||||
func (@"regexp".re *@"regexp".Regexp) ReplaceAllStringFunc(@"regexp".src string, @"regexp".repl func(? string) (? string) "noescape") (? string)
|
||||
func (@"regexp".re *@"regexp".Regexp "noescape") String() (? string) { return @"regexp".re.@"regexp".expr }
|
||||
func (@"regexp".re *@"regexp".Regexp) @"regexp".allMatches(@"regexp".s string, @"regexp".b []byte, @"regexp".n int, @"regexp".deliver func(? []int) "noescape")
|
||||
func (@"regexp".re *@"regexp".Regexp) @"regexp".doExecute(@"regexp".r @"io".RuneReader, @"regexp".b []byte, @"regexp".s string, @"regexp".pos int, @"regexp".ncap int) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) @"regexp".get() (? *@"regexp".machine)
|
||||
func (@"regexp".re *@"regexp".Regexp "noescape") @"regexp".pad(@"regexp".a []int) (? []int)
|
||||
func (@"regexp".re *@"regexp".Regexp) @"regexp".put(@"regexp".z *@"regexp".machine)
|
||||
var @"".matchRe *@"regexp".Regexp
|
||||
func @"".matchString(@"".pat string, @"".str string) (@"".result bool, @"".err error)
|
||||
func @"".main()
|
||||
var @"".statictmp_0001 [0]@"testing".InternalTest
|
||||
var @"".statictmp_0002 [10]@"testing".InternalBenchmark
|
||||
var @"".statictmp_0003 [0]@"testing".InternalExample
|
||||
var @"".initdone· uint8
|
||||
func @"".init()
|
||||
var @"time".months [12]string
|
||||
var @"time".days [7]string
|
||||
|
||||
$$ // local types
|
||||
|
||||
$$
|
||||
|
||||
!
|
||||
„ |