Commit Graph

1476 Commits

Author SHA1 Message Date
Rob Pike
eb37b5b744 test: document ken/*.go
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694065
2012-02-24 16:24:24 +11:00
Russ Cox
075eef4018 gc: fix escape analysis + inlining + closure bug
R=ken2
CC=golang-dev, lvd
https://golang.org/cl/5693056
2012-02-23 23:09:53 -05:00
Rob Pike
d45ee4cb5f test: fix the fix of the rename tests.
Now they actually test again instead of just setting iota to zero.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5700058
2012-02-24 15:06:32 +11:00
Brad Fitzpatrick
e014cf0e54 test: add cmpout to testlib
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5699060
2012-02-24 13:17:26 +11:00
Brad Fitzpatrick
a55a5c8df3 test: add temporary show_skips flag.
To find test files with legacy headers.

We can remove this flag once everything is converted.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694060
2012-02-24 12:52:15 +11:00
Rob Pike
80a9783f84 test/[n-z]*.go: add documentation
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5700056
2012-02-24 11:48:19 +11:00
Rob Pike
19bab1dc78 test/[n-r]*.go: add documentation
The rename ones needed redoing.

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5698054
2012-02-24 10:30:39 +11:00
Rob Pike
501f0b578f test: commentary for [h-m]*.go
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5674112
2012-02-23 18:47:26 +11:00
Russ Cox
e29d3dfc49 gc: new, less strict bool rules
R=ken2
CC=golang-dev
https://golang.org/cl/5688064
2012-02-22 00:29:37 -05:00
Russ Cox
a457fa500d gc: return of ideal bool
This is a manual undo of CL 5674098.
It does not implement the even less strict spec
that we just agreed on, but it gets us back where
we were at the last weekly.

R=ken2
CC=golang-dev
https://golang.org/cl/5683069
2012-02-21 22:54:07 -05:00
Rémy Oudompheng
fc3797a491 test: use testlib in a few more cases.
R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5688057
2012-02-22 00:19:59 +01:00
Rémy Oudompheng
9666a959cf test: fix bug423.go to actually fail with older releases.
The supposedly overflowing variable was registerized.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5687061
2012-02-21 07:50:10 +01:00
Rob Pike
b888671f4c test: fix broken test
TBR=bradfitz

R=golang-dev
CC=golang-dev
https://golang.org/cl/5684050
2012-02-21 16:47:42 +11:00
Rémy Oudompheng
f2ad374ae6 cmd/gc: don't believe that variables mentioned 256 times are unused.
Such variables would be put at 0(SP), leading to serious
corruptions at zero initialization.
Fixes #3084.

R=golang-dev, r
CC=golang-dev, remy
https://golang.org/cl/5683052
2012-02-21 16:38:01 +11:00
Brad Fitzpatrick
ce837b308f test: rewrite test/run shell script + errchk (perl) in Go
This doesn't run all ~750 of the tests, but most.

Progress on issue 2833

R=golang-dev, ality, rsc, r, r
CC=golang-dev
https://golang.org/cl/5625044
2012-02-21 14:28:49 +11:00
Rob Pike
f03a5796e3 test/initsyscall.go: delete
It's testing an old property of the language and is no longer relevant.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5676104
2012-02-20 07:44:41 +11:00
Rob Pike
c9b36a87eb test/initcomma.go: restore what it's supposed to be testing
which is trailing commas in literals. They were gofmted away at some point.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5673103
2012-02-20 07:44:24 +11:00
Rob Pike
f5ff5b4fcb test/hashmap.go: delete
It's in an odd style and it's unclear what true purpose it serves as
a test other than to be another Go program.

R=gri
CC=golang-dev
https://golang.org/cl/5674111
2012-02-20 07:43:16 +11:00
Rob Pike
3fb5f329b9 test/chan: document tests
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5677094
2012-02-19 17:44:02 +11:00
Rob Pike
13514d4e0b test/interface: document tests
Most already had comments (yay); adjusted for consistency.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5676102
2012-02-19 17:33:41 +11:00
Brad Fitzpatrick
efacb2a1b4 os: remove Getenverror
Fixes #3065

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5675094
2012-02-18 21:18:13 -08:00
Russ Cox
83feedf7bf gc: fix error for floating-point constant %
R=ken2
CC=golang-dev
https://golang.org/cl/5674108
2012-02-19 00:12:31 -05:00
Russ Cox
03f2289f7e runtime: API
Delete Alloc, Free, Lookup, Semacquire, Semrelease

Fixes #2955.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5675093
2012-02-19 00:11:44 -05:00
Rob Pike
83976e3ac8 test: explanatory comments [c-g]*
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656103
2012-02-19 14:28:53 +11:00
Rob Pike
fc0dc04095 test: [a-c]: add introductory comments to tests
Very few of the compiler regression tests include a comment
saying waht they do. Many are obvious, some are anything but.
I've started with a-c in the top directory. More will follow once
we agree on the approach, correctness, and thoroughness here.
zerodivide.go sneaked in too.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5656100
2012-02-19 13:19:43 +11:00
Russ Cox
126d475a43 gc: drop ideal bool
R=golang-dev, ken2
CC=golang-dev
https://golang.org/cl/5674098
2012-02-18 21:07:08 -05:00
Rémy Oudompheng
2ece2f58ee test: use testlib (another bunch).
Apply sed with:

1s,^// $G $D/$F.go && $L $F.$A && ./$A.out || echo.*,// run,
1s,^// $G $D/$F.go || echo.*,// compile,

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5656099
2012-02-18 22:15:42 +01:00
Shenghou Ma
6154f146af test/run: honor $TMPDIR
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5676094
2012-02-18 16:15:12 -05:00
Ian Lance Taylor
292bd04a43 test: change bug040 to use errorcheck
Because bug040.go was ignoring all error messages, the fact
that it got an error about fuction main was being ignored.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5675085
2012-02-17 20:35:40 -08:00
Ian Lance Taylor
f228ed1a90 test: remove a couple of bad tests that duplicate declbad.go
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5673089
2012-02-17 20:35:18 -08:00
Ian Lance Taylor
7737e19b15 test: add some tests that gccgo failed to handle correctly
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5671090
2012-02-17 17:52:05 -08:00
Russ Cox
c4c92ebeb6 cmd/gc: fix comparison of struct with _ field
Fixes #2989.

R=ken2
CC=golang-dev
https://golang.org/cl/5674091
2012-02-17 14:45:29 -05:00
Russ Cox
57eb06fe93 test: use testlib (final 61)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5671080
2012-02-16 23:51:04 -05:00
Russ Cox
d2cc988429 test: use testlib (fourth 100)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5673079
2012-02-16 23:50:37 -05:00
Russ Cox
8080384a68 test: use testlib (third 100)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656083
2012-02-16 23:49:59 -05:00
Russ Cox
2b1c9b4be2 test: use testlib (second 100)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev
CC=golang-dev
https://golang.org/cl/5673078
2012-02-16 23:49:30 -05:00
Russ Cox
0b477ef17e test: use testlib (first 100)
X ,s;^// \$G (\$D/)?\$F\.go *$;// compile;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A *$;// build;g
X ,s;^// \$G (\$D/)?\$F\.go && \$L \$F\.\$A && \./\$A\.out *$;// run;g
X ,s;^// errchk \$G( -e)? (\$D/)?\$F\.go *$;// errorcheck;g

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656082
2012-02-16 23:48:57 -05:00
Russ Cox
a0c13b9d49 test: add testlib
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5676077
2012-02-16 23:48:24 -05:00
Rob Pike
56069f0333 os: delete os.EINVAL and so on
The set of errors forwarded by the os package varied with system and
was therefore non-portable.
Three helpers added for portable error checking: IsExist, IsNotExist, and IsPermission.
One or two more may need to come, but let's keep the set very small to discourage
thinking about errors that way.

R=mikioh.mikioh, gustavo, r, rsc
CC=golang-dev
https://golang.org/cl/5672047
2012-02-17 10:04:29 +11:00
Rémy Oudompheng
1d3ca9236e cmd/gc: correctly typecheck expression lists in returns.
Invalid return statements were accidentally compiling or
triggering internal errors.
Fixes #3044.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5673074
2012-02-16 23:42:19 +01:00
Rob Pike
21be71a419 all: errors caught by go vet
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5674069
2012-02-16 17:21:21 +11:00
Rémy Oudompheng
79db6ada48 cmd/gc: error on constant shift overflows.
Fixes #3019.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5674044
2012-02-16 00:19:42 +01:00
Ian Lance Taylor
aef23cc49e test: add new test of indirect type references
Similar to bug190, but without recursive reference.  Crashed
gccgo.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5672053
2012-02-15 07:39:46 -08:00
Russ Cox
7b848c6964 cmd/dist: cross-compiling fixes
This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.

As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target.  pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.

Fixes #2920.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645093
2012-02-13 22:31:51 -05:00
Russ Cox
7dd90621f8 gc: diagnose field+method of same name
Fixes #2828.

R=ken2
CC=golang-dev
https://golang.org/cl/5653065
2012-02-11 01:21:12 -05:00
Russ Cox
337547d1c9 gc: make constant arith errors a little more friendly
Fixes #2804.

R=ken2
CC=golang-dev
https://golang.org/cl/5652067
2012-02-11 00:50:56 -05:00
Russ Cox
77aaa3555d gc: fix import of struct type in struct literal
Fixes #2716.

R=ken2
CC=golang-dev
https://golang.org/cl/5652065
2012-02-11 00:34:01 -05:00
Russ Cox
12fab9d122 gc: add test case for issue 1743
Fixes #1743.
(Actually was fixed earlier, but now we have proof.)

R=ken2
CC=golang-dev
https://golang.org/cl/5649064
2012-02-10 23:20:00 -05:00
Russ Cox
896f0c61c8 gc: diagnose init loop involving func
Fixes #2295.

R=ken2
CC=golang-dev
https://golang.org/cl/5655057
2012-02-10 23:10:45 -05:00
Russ Cox
7ae1fe420e gc: eliminate duplicate ambiguous selector message
Also show actual expression in message when possible.

Fixes #2599.

R=ken2
CC=golang-dev
https://golang.org/cl/5654059
2012-02-10 22:46:56 -05:00