summaryrefslogtreecommitdiff
path: root/test/const1.go
Commit message (Collapse)AuthorAgeFilesLines
* test: match gccgo error messagesIan Lance Taylor2013-12-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | const1.go:33: error: integer constant overflow <similar errors omitted> const1.go:64: error: division by zero const1.go:67: error: floating point constant overflow const1.go:68: error: floating point constant overflow const1.go:69: error: floating point constant overflow const1.go:70: error: division by zero const1.go:71: error: expected integer type const1.go:77: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:78: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:79: error: argument 1 has incompatible type (cannot use type uint8 as type int) const1.go:81: error: argument 1 has incompatible type (cannot use type float32 as type int) const1.go:82: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:83: error: floating point constant truncated to integer const1.go:85: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:86: error: argument 1 has incompatible type (cannot use type string as type int) const1.go:87: error: argument 1 has incompatible type (cannot use type bool as type int) const1.go:90: error: const initializer cannot be nil const1.go:91: error: expression is not constant const1.go:92: error: expression is not constant const1.go:93: error: invalid constant type const1.go:94: error: invalid constant type fixedbugs/bug462.go:17: error: unknown field 'os.File' in 'T' fixedbugs/issue3705.go:9: error: cannot declare init - must be func fixedbugs/issue4251.go:12: error: inverted slice range fixedbugs/issue4251.go:16: error: inverted slice range fixedbugs/issue4251.go:20: error: inverted slice range fixedbugs/issue4405.go:11: error: invalid character 0x7 in identifier fixedbugs/issue4405.go:12: error: invalid character 0x8 in identifier fixedbugs/issue4405.go:13: error: invalid character 0xb in identifier fixedbugs/issue4405.go:14: error: invalid character 0xc in identifier fixedbugs/issue4429.go:15: error: expected pointer fixedbugs/issue4517d.go:9: error: cannot import package as init fixedbugs/issue4545.go:17: error: invalid context-determined non-integer type for left operand of shift fixedbugs/issue4545.go:16: error: incompatible types in binary expression fixedbugs/issue4610.go:15: error: expected ';' or '}' or newline fixedbugs/issue4610.go:16: error: expected declaration fixedbugs/issue4654.go:15: error: value computed is not used <similar errors omitted> fixedbugs/issue4776.go:9: error: program must start with package clause fixedbugs/issue4776.go:9: error: expected ';' or newline after package clause fixedbugs/issue4813.go:31: error: index must be integer <similar errors omitted> fixedbugs/issue4847.go:22: error: initialization expression for 'matchAny' depends upon itself fixedbugs/issue5089.go:13: error: redefinition of 'bufio.Buffered': receiver name changed fixedbugs/issue5089.go:11: note: previous definition of 'bufio.Buffered' was here fixedbugs/issue5172.go:17: error: reference to undefined field or method 'bar' fixedbugs/issue5172.go:18: error: reference to undefined field or method 'bar' fixedbugs/issue5172.go:12: error: use of undefined type 'bar' fixedbugs/issue5358.go:16: error: argument 2 has incompatible type fixedbugs/issue5581.go:29: error: use of undefined type 'Blah' funcdup.go:10: error: redefinition of 'i' funcdup.go:10: note: previous definition of 'i' was here <similar errors omitted> funcdup2.go:10: error: redefinition of 'i' funcdup2.go:10: note: previous definition of 'i' was here <similar errors omitted> slice3err.go:20: error: middle index required in 3-index slice <similar errors omitted> slice3err.go:20: error: final index required in 3-index slice <similar errors omitted> slice3err.go:21: error: final index required in 3-index slice slice3err.go:46: error: invalid 3-index slice of string <similar errors omitted> slice3err.go:57: error: inverted slice range <similar errors omitted> slice3err.go:62: error: invalid slice index: capacity less than length slice3err.go:64: error: invalid slice index: capacity less than start slice3err.go:65: error: invalid slice index: capacity less than start slice3err.go:66: error: invalid slice index: capacity less than start slice3err.go:68: error: invalid slice index: capacity less than length slice3err.go:70: error: invalid slice index: capacity less than start slice3err.go:80: error: invalid slice index: capacity less than length slice3err.go:82: error: invalid slice index: capacity less than start slice3err.go:83: error: invalid slice index: capacity less than start slice3err.go:84: error: invalid slice index: capacity less than start slice3err.go:86: error: invalid slice index: capacity less than length slice3err.go:88: error: invalid slice index: capacity less than start slice3err.go:99: error: array index out of bounds <similar errors omitted> slice3err.go:106: error: invalid slice index: capacity less than length slice3err.go:107: error: invalid slice index: capacity less than start slice3err.go:118: error: invalid slice index: capacity less than length slice3err.go:119: error: invalid slice index: capacity less than start syntax/semi1.go:10: error: missing '{' after if clause syntax/semi1.go:10: error: reference to undefined name 'x' syntax/semi1.go:10: error: reference to undefined name 'y' syntax/semi1.go:12: error: reference to undefined name 'z' syntax/semi2.go:10: error: missing '{' after switch clause syntax/semi2.go:10: error: reference to undefined name 'x' syntax/semi3.go:10: error: missing '{' after for clause syntax/semi3.go:10: error: reference to undefined name 'x' syntax/semi3.go:10: error: reference to undefined name 'y' syntax/semi3.go:10: error: reference to undefined name 'z' syntax/semi3.go:12: error: reference to undefined name 'z' syntax/semi4.go:11: error: missing '{' after for clause syntax/semi4.go:10: error: reference to undefined name 'x' syntax/semi4.go:12: error: reference to undefined name 'z' typecheck.go:12: error: reference to undefined name 'b' typecheck.go:17: error: reference to undefined name 'c' typecheck.go:11: error: use of undefined type 'b' typecheck.go:16: error: not enough arguments typecheck.go:17: error: not enough arguments R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/41520044
* cmd/gc: reject non-Go constantsRuss Cox2013-02-011-0/+6
| | | | | | | | | | | | | Expressions involving nil, even if they can be evaluated at compile time, do not count as Go constants and cannot be used in const initializers. Fixes issue 4673. Fixes issue 4680. R=ken2 CC=golang-dev https://codereview.appspot.com/7278043
* test: match gccgo error messagesIan Lance Taylor2012-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | const1.go:31:12: error: integer constant overflow const1.go:31:12: error: integer constant overflow const1.go:33:12: error: integer constant overflow const1.go:33:12: error: integer constant overflow const1.go:34:14: error: integer constant overflow const1.go:35:17: error: integer constant overflow const1.go:35:17: error: integer constant overflow const1.go:35:17: error: integer constant overflow const1.go:35:17: error: integer constant overflow const1.go:35:17: error: integer constant overflow const1.go:36:19: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:37:24: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:37:24: error: integer constant overflow const1.go:37:15: error: integer constant overflow const1.go:38:12: error: integer constant overflow const1.go:38:12: error: integer constant overflow const1.go:38:12: error: integer constant overflow const1.go:38:12: error: integer constant overflow const1.go:41:20: error: integer constant overflow const1.go:41:20: error: integer constant overflow const1.go:42:20: error: integer constant overflow const1.go:42:20: error: integer constant overflow const1.go:44:28: error: integer constant overflow const1.go:44:28: error: integer constant overflow const1.go:45:14: error: integer constant overflow const1.go:49:14: error: integer constant overflow const1.go:50:14: error: integer constant overflow const1.go:51:14: error: integer constant overflow const1.go:54:23: error: integer constant overflow const1.go:54:23: error: integer constant overflow const1.go:54:23: error: integer constant overflow const1.go:54:23: error: integer constant overflow const1.go:56:14: error: integer constant overflow const1.go:57:24: error: integer constant overflow const1.go:57:24: error: integer constant overflow const1.go:58:24: error: integer constant overflow const1.go:58:24: error: integer constant overflow const1.go:59:22: error: integer constant overflow const1.go:59:22: error: integer constant overflow const1.go:61:24: error: integer constant overflow const1.go:62:20: error: division by zero const1.go:65:19: error: floating point constant overflow const1.go:65:19: error: floating point constant overflow const1.go:66:28: error: floating point constant overflow const1.go:66:28: error: floating point constant overflow const1.go:67:19: error: floating point constant overflow const1.go:67:19: error: floating point constant overflow const1.go:68:19: error: division by zero const1.go:33:14: error: integer constant overflow const1.go:35:19: error: integer constant overflow const1.go:42:22: error: integer constant overflow const1.go:53:17: error: integer constant overflow const1.go:55:14: error: integer constant overflow const1.go:59:24: error: integer constant overflow const1.go:69:20: error: expected integer type const1.go:75:4: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:76:4: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:77:4: error: argument 1 has incompatible type (cannot use type uint8 as type int) const1.go:79:4: error: argument 1 has incompatible type (cannot use type float32 as type int) const1.go:80:4: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:81:4: error: floating point constant truncated to integer const1.go:83:4: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:84:4: error: argument 1 has incompatible type (cannot use type string as type int) const1.go:85:4: error: argument 1 has incompatible type (cannot use type bool as type int) const1.go:88:7: error: const initializer cannot be nil const2.go:14:8: error: expected ?=? const5.go:27:7: error: expression is not constant const5.go:28:7: error: expression is not constant const5.go:30:7: error: expression is not constant const5.go:31:7: error: expression is not constant ddd1.go:57:23: error: invalid use of ?...? in type conversion ddd1.go:59:6: error: invalid use of ?...? in type conversion ddd1.go:60:12: error: use of ?[...]? outside of array literal ddd1.go:21:15: error: argument 1 has incompatible type ddd1.go:22:10: error: argument 1 has incompatible type ddd1.go:30:6: error: invalid use of ?...? with non-slice ddd1.go:30:6: error: invalid use of ?...? with non-slice ddd1.go:46:2: error: invalid use of %<...%> with builtin function ddd1.go:47:2: error: invalid use of %<...%> with builtin function ddd1.go:49:2: error: invalid use of %<...%> with builtin function ddd1.go:50:6: error: invalid use of %<...%> with builtin function ddd1.go:51:6: error: invalid use of %<...%> with builtin function ddd1.go:53:6: error: invalid use of %<...%> with builtin function ddd1.go:58:13: error: invalid use of %<...%> with builtin function ddd1.go:20:10: error: floating point constant truncated to integer ddd1.go:32:6: error: invalid use of ?...? calling non-variadic function declbad.go:20:3: error: variables redeclared but no variable is new declbad.go:38:3: error: variables redeclared but no variable is new declbad.go:44:3: error: variables redeclared but no variable is new declbad.go:51:3: error: variables redeclared but no variable is new declbad.go:57:3: error: variables redeclared but no variable is new declbad.go:63:3: error: variables redeclared but no variable is new declbad.go:26:3: error: incompatible types in assignment (cannot use type float32 as type int) declbad.go:32:3: error: incompatible types in assignment (cannot use type int as type float32) declbad.go:44:3: error: incompatible types in assignment (different number of results) fixedbugs/bug223.go:21:5: error: initialization expression for ?m? depends upon itself fixedbugs/bug412.go:10:2: error: duplicate field name ?x? fixedbugs/bug413.go:11:5: error: initialization expression for ?i? depends upon itself fixedbugs/bug416.go:13:1: error: method ?X? redeclares struct field name fixedbugs/bug435.go:15:49: error: missing ?)? fixedbugs/bug435.go:15:2: error: reference to undefined name ?bar? fixedbugs/bug451.go:9:9: error: expected package typeswitch3.go:39:9: error: no new variables on left side of ?:=? typeswitch3.go:24:2: error: impossible type switch case (type has no methods) R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/6560063
* test: add a couple of cases to const1.go that crashed gccgoIan Lance Taylor2012-02-291-0/+2
| | | | | | R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5713045
* gc: fix error for floating-point constant %Russ Cox2012-02-191-27/+28
| | | | | | R=ken2 CC=golang-dev http://codereview.appspot.com/5674108
* 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 http://codereview.appspot.com/5656100
* 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
* delete float, complex - code changesRuss Cox2011-01-191-55/+56
| | | | | | | | | | | also: cmplx -> complex float64(1.0) -> 1.0 float64(1) -> 1.0 R=gri, r, gri1, r2 CC=golang-dev http://codereview.appspot.com/3991043
* gc: const nil bugRuss Cox2010-09-111-0/+2
| | | | | | | | Fixes issue 1073. R=ken2 CC=golang-dev http://codereview.appspot.com/2169043
* test: remove semiocolons.Rob Pike2010-09-041-56/+56
| | | | | | | | The ken directory is untouched so we have some examples with explicit semis. R=gri CC=golang-dev http://codereview.appspot.com/2157041
* Cleaned up gccgo error messages require minor adjustment toIan Lance Taylor2009-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test. const1.go:27: error: integer constant overflow const1.go:29: error: integer constant overflow const1.go:30: error: integer constant overflow const1.go:31: error: integer constant overflow const1.go:32: error: integer constant overflow const1.go:33: error: integer constant overflow const1.go:33: error: integer constant overflow const1.go:34: error: integer constant overflow const1.go:37: error: integer constant overflow const1.go:38: error: integer constant overflow const1.go:40: error: integer constant overflow const1.go:41: error: integer constant overflow const1.go:43: error: integer constant overflow const1.go:44: error: integer constant overflow const1.go:45: error: integer constant overflow const1.go:48: error: integer constant overflow const1.go:50: error: integer constant overflow const1.go:51: error: integer constant overflow const1.go:52: error: integer constant overflow const1.go:53: error: integer constant overflow const1.go:55: error: integer constant overflow const1.go:56: error: division by zero const1.go:59: error: floating point constant overflow const1.go:61: error: floating point constant overflow const1.go:62: error: division by zero const1.go:47: error: integer constant overflow const1.go:49: error: integer constant overflow const1.go:60: error: floating point constant overflow const1.go:68: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:69: error: argument 1 has incompatible type (cannot use type int8 as type int) const1.go:70: error: argument 1 has incompatible type (cannot use type uint8 as type int) const1.go:72: error: argument 1 has incompatible type (cannot use type float32 as type int) const1.go:73: error: argument 1 has incompatible type (cannot use type float as type int) const1.go:74: error: floating point constant truncated to integer const1.go:76: error: argument 1 has incompatible type (cannot use type float64 as type int) const1.go:77: error: argument 1 has incompatible type const1.go:78: error: argument 1 has incompatible type R=rsc http://go/go-review/1022001
* more 6g reorg; checkpoint.Russ Cox2009-08-031-8/+8
| | | | | | | | | typecheck.c is now responsible for all type checking except for assignment and function argument "..." R=ken OCL=32661 CL=32667
* ^ type(const) now inverts "enough" bitsKen Thompson2009-03-241-1/+1
| | | | | | | | | ^ signed(const) becomes illegal ^ unsigned(const) becomes legal R=r OCL=26697 CL=26697
* Modify error regexps to match gccgo error messages.Ian Lance Taylor2009-03-191-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | const1.go:23:13: error: integer constant overflow const1.go:25:13: error: integer constant overflow const1.go:26:14: error: integer constant overflow const1.go:27:18: error: integer constant overflow const1.go:28:19: error: integer constant overflow const1.go:29:16: error: integer constant overflow const1.go:29:25: error: integer constant overflow const1.go:30:13: error: integer constant overflow const1.go:33:14: error: integer constant overflow const1.go:34:14: error: integer constant overflow const1.go:36:22: error: integer constant overflow const1.go:37:7: error: integer constant overflow const1.go:38:8: error: integer constant overflow const1.go:39:7: error: integer constant overflow const1.go:40:7: error: integer constant overflow const1.go:41:8: error: integer constant overflow const1.go:44:23: error: integer constant overflow const1.go:46:13: error: integer constant overflow const1.go:47:24: error: integer constant overflow const1.go:48:24: error: integer constant overflow const1.go:49:22: error: integer constant overflow const1.go:51:23: error: integer constant overflow const1.go:52:19: error: division by zero const1.go:58:11: error: division by zero const1.go:43:17: error: integer constant overflow const1.go:45:13: error: integer constant overflow const1.go:55:19: error: floating point overflow const1.go:56:28: error: floating point overflow const1.go:57:11: error: floating point overflow const1.go:64:2: error: argument 0 has wrong type const1.go:65:2: error: argument 0 has wrong type const1.go:66:2: error: argument 0 has wrong type const1.go:68:2: error: argument 0 has wrong type const1.go:69:2: error: argument 0 has wrong type const1.go:70:4: error: floating point constant truncated to integer const1.go:72:2: error: argument 0 has wrong type const1.go:73:2: error: argument 0 has wrong type const1.go:74:2: error: argument 0 has wrong type R=rsc DELTA=34 (0 added, 0 deleted, 34 changed) OCL=26560 CL=26560
* make 6g constants behave as ken proposes. (i hope.)Russ Cox2009-03-121-0/+79
various bug fixes and tests involving constants. test/const1.go is the major new test case. R=ken OCL=26216 CL=26224