summaryrefslogtreecommitdiff
path: root/test/cmp6.go
Commit message (Collapse)AuthorAgeFilesLines
* [dev.typeparams] test: add scaffolding to run.go to check compiler with -G flagRobert Griesemer2020-12-011-5/+5
| | | | | | | | | | | | | | | | | | | Added a new flag -G to run. Setting -G (as in: go run run.go -G) will run tests marked with "errorcheck" (and no other flags) also with the compiler using the new typechecker. Many tests don't pass yet (due to discrepancies in error messages). The top-level tests in the test directory which don't pass yet have been explicitly excluded, permitting to see the current status. Future CLs will bring error messages in sync and eventually all tests should pass. Change-Id: I7caf5eff413e173f68d092af4bbe458434718d74 Reviewed-on: https://go-review.googlesource.com/c/go/+/274313 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/gc: do not consider length zero arrays as comparable.Rémy Oudompheng2014-01-311-1/+12
| | | | | | | | | | | | Array values are comparable if values of the array element type are comparable. Fixes #6526. LGTM=khr R=rsc, bradfitz, khr CC=golang-codereviews https://golang.org/cl/58580043
* 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 #5698. R=rsc, golang-dev, daniel.morsing, bradfitz, gri, r CC=golang-dev https://golang.org/cl/10271046
* test: [a-c]: add introductory comments to testsRob Pike2012-02-191-0/+3
| | | | | | | | | | | | 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
* cmd/gc: fix comparison of struct with _ fieldRuss Cox2012-02-171-0/+5
| | | | | | | | Fixes #2989. R=ken2 CC=golang-dev https://golang.org/cl/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 https://golang.org/cl/5656082
* gc: implement == on structs and arraysRuss Cox2011-12-121-1/+11
| | | | | | | | | | | | | | | | | | | | | | 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 https://golang.org/cl/5451105
* gc: remove func, map compareRuss Cox2011-11-131-10/+18
| | | | | | R=ken, ken CC=golang-dev https://golang.org/cl/5373079
* test: match gccgo error messages for cmp6.goIan Lance Taylor2011-03-251-5/+5
| | | | | | | | | | | | cmp6.go:28:9: error: incompatible types in binary expression cmp6.go:29:9: error: incompatible types in binary expression cmp6.go:40:9: error: incompatible types in binary expression cmp6.go:41:9: error: incompatible types in binary expression cmp6.go:48:9: error: expected integer, floating, complex, string, pointer, boolean, interface, slice, map, channel, or function type R=rsc, r2 CC=golang-dev https://golang.org/cl/4281071
* gc: clearer error for struct == structRuss Cox2011-01-211-0/+7
| | | | | | | | | | cmp6.go:48: invalid operation: t3 == t3 (operator == not defined on struct) Fixes #1438. R=ken2 CC=golang-dev https://golang.org/cl/4003045
* gc: implement new comparison ruleRuss Cox2010-09-131-0/+42
The new comparison rule was added to the spec by changeset: 5605:33abb649cb63 user: Robert Griesemer <gri@golang.org> date: Thu Jun 03 16:55:50 2010 -0700 files: doc/go_spec.html description: go spec: Base comparison compatibility on assignment compatibility. Specifically: - Simplified definition of comparison compatibility and folded into section on comparison operators since it's only used there. This is a small language change/cleanup. As a consequence: - An interface value may now be compared against a non-interface value. - Channels with opposite directions cannot be compared directly anymore (per discussion with rsc). R=rsc, r, iant, ken2 CC=golang-dev https://golang.org/cl/1462041 but never implemented. Fixes #1070. R=ken2 CC=golang-dev https://golang.org/cl/2116047