summaryrefslogtreecommitdiff
path: root/test/cmp.go
Commit message (Collapse)AuthorAgeFilesLines
* cmd/gc: do not nop-convert equivalent but different interface types.R?my Oudompheng2014-02-271-0/+42
| | | | | | | | | | | | | | | | The cached computed interface tables are indexed by the interface types, not by the unnamed underlying interfaces To preserve the invariants expected by interface comparison, an itab generated for an interface type must not be used for a value of a different interface type even if the representation is identical. Fixes issue 7207. LGTM=rsc R=rsc, iant, khr CC=golang-codereviews https://codereview.appspot.com/69210044
* cmd/gc: fix walkcompare bugs.R?my Oudompheng2014-02-241-0/+17
| | | | | | | | | | | | | | | | | Revision c0e0467635ec (cmd/gc: return canonical Node* from temp) exposed original nodes of temporaries, allowing callers to mutate their types. In walkcompare a temporary could be typed as ideal because of this. Additionnally, assignment of a comparison result to a custom boolean type was broken. Fixes issue 7366. LGTM=rsc R=rsc, iant, khr CC=golang-codereviews https://codereview.appspot.com/66930044
* test: invert incorrect condition.Alan Donovan2013-07-161-2/+2
| | | | | | R=gri CC=golang-dev https://codereview.appspot.com/11359043
* cmd/gc: fix computation of equality class of types.R?my Oudompheng2013-07-021-1/+1
| | | | | | | | | | | | | | A struct with a single field was considered as equivalent to the field type, which is incorrect is the field is blank. Fields with padding could make the compiler think some types are comparable when they are not. Fixes issue 5698. R=rsc, golang-dev, daniel.morsing, bradfitz, gri, r CC=golang-dev https://codereview.appspot.com/10271046
* exp/ssa/interp: (#6 of 5): test interpretation of SSA form of $GOROOT/test/*.go.Alan Donovan2013-02-211-5/+13
| | | | | | | | | | | | | | | | | | | | The interpreter's os.Exit now triggers a special panic rather than kill the test process. (It's semantically dubious, since it will run deferred routines.) Interpret now returns its exit code rather than calling os.Exit. Also: - disabled parts of a few $GOROOT/tests via os.Getenv("GOSSAINTERP"). - remove unnecessary 'slots' param to external functions; they are never closures. Most of the tests are disabled until go/types supports shifts. They can be reenabled if you patch this workaround: https://codereview.appspot.com/7312068 R=iant, bradfitz CC=golang-dev, gri https://codereview.appspot.com/7313062
* test: [a-c]: add introductory comments to testsRob Pike2012-02-191-0/+2
| | | | | | | | | | | | 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 http://codereview.appspot.com/5656100
* cmd/gc: fix comparison of struct with _ fieldRuss Cox2012-02-171-0/+19
| | | | | | | | Fixes issue 2989. R=ken2 CC=golang-dev http://codereview.appspot.com/5674091
* test: use testlib (first 100)Russ Cox2012-02-161-1/+1
| | | | | | | | | | | 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 http://codereview.appspot.com/5656082
* gc: inlining, allow empty bodies, fix _ arguments.Luuk van Dijk2011-12-151-1/+2
| | | | | | R=rsc CC=golang-dev http://codereview.appspot.com/5487077
* gc: implement == on structs and arraysRuss Cox2011-12-121-19/+248
| | | | | | | | | | | | | | | | | | | | | | To allow these types as map keys, we must fill in equal and hash functions in their algorithm tables. Structs or arrays that are "just memory", like [2]int, can and do continue to use the AMEM algorithm. Structs or arrays that contain special values like strings or interface values use generated functions for both equal and hash. The runtime helper func runtime.equal(t, x, y) bool handles the general equality case for x == y and calls out to the equal implementation in the algorithm table. For short values (<= 4 struct fields or array elements), the sequence of elementwise comparisons is inlined instead of calling runtime.equal. R=ken, mpimenov CC=golang-dev http://codereview.appspot.com/5451105
* test: silence/coalesce some testsRuss Cox2011-09-261-0/+170
Add copyright notice to nilptr.go. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5139048