1
0
mirror of https://github.com/golang/go synced 2024-10-01 06:28:35 -06:00
Commit Graph

491 Commits

Author SHA1 Message Date
Rob Pike
72d867660d bug142 is fixed
R=rsc
OCL=27331
CL=27331
2009-04-10 17:58:10 -07:00
Russ Cox
78edbfdcf4 test for new string bug
TBR=r
OCL=27306
CL=27306
2009-04-10 06:22:41 -07:00
Rob Pike
7d6c0018fb messages changed; updated golden.out for bug037
R=rsc
OCL=27248
CL=27248
2009-04-08 23:34:44 -07:00
Russ Cox
b8035ab5a5 bug142
R=ken
OCL=27202
CL=27202
2009-04-07 23:30:59 -07:00
Russ Cox
3067781ab9 func f() (int, int);
x := f();

used to give
	fatal error: dowidth fn struct struct { int; int }

now gives
	assignment count mismatch: 1 = 2

R=ken
OCL=27198
CL=27201
2009-04-07 22:20:37 -07:00
Rob Pike
a888d4d233 not a bug by current understanding, so delete this file.
6g says: bug138.go:8: constant -1 overflows uint
gccgo says: bug138.go:8:16: error: integer constant overflow

R=rsc
DELTA=19  (0 added, 19 deleted, 0 changed)
OCL=27099
CL=27149
2009-04-07 00:15:49 -07:00
Russ Cox
4b536c1e07 test for and fix bug involving reflect v.Interface() and ==.
R=r
DELTA=156  (149 added, 2 deleted, 5 changed)
OCL=26973
CL=26973
2009-03-31 17:33:04 -07:00
Russ Cox
a99a7f60c3 tests changed - throw calls panic directly now
instead of dereferencing nil, so no more SIGSEGVs.

R=r
DELTA=28  (0 added, 14 deleted, 14 changed)
OCL=26881
CL=26881
2009-03-30 00:28:08 -07:00
Ken Thompson
a805e54a38 golden
R=r
OCL=26699
CL=26699
2009-03-24 16:47:33 -07:00
Ken Thompson
b8be809c10 ^ type(const) now inverts "enough" bits
^ signed(const) becomes illegal
^ unsigned(const) becomes legal

R=r
OCL=26697
CL=26697
2009-03-24 16:40:38 -07:00
Russ Cox
13584f4a23 add test for close/closed, fix a few implementation bugs.
R=ken
OCL=26664
CL=26664
2009-03-23 18:50:35 -07:00
Russ Cox
86145611b0 allow range on nil maps
R=ken
OCL=26663
CL=26663
2009-03-23 18:32:37 -07:00
Rob Pike
7525e085d2 bug141 is fixed
R=ken
DELTA=56  (26 added, 30 deleted, 0 changed)
OCL=26628
CL=26628
2009-03-22 21:02:17 -07:00
Ian Lance Taylor
90943c8ee4 Test that interfaces work in type switches.
R=ken,rsc
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=26599
CL=26604
2009-03-20 16:30:54 -07:00
Russ Cox
54aa835b44 range over channels.
also fix multiple-evaluation bug in range over arrays.

R=ken
OCL=26576
CL=26576
2009-03-20 11:32:58 -07:00
Ian Lance Taylor
386845b23f Match gccgo error messages.
bug090.go:41:6: error: floating point constant truncated to integer
bug090.go:32:6: error: floating point constant truncated to integer
bug090.go:34:14: error: floating point constant truncated to integer
bug090.go:37:5: error: incompatible types in assignment
bug090.go:40:5: error: incompatible types in assignment

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=26564
CL=26574
2009-03-20 10:34:46 -07:00
Ian Lance Taylor
8b3df525a2 Modify error regexps to match gccgo error messages.
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
2009-03-19 17:33:28 -07:00
Rob Pike
08eeb2535d simplify test to eliminate now-deprecated forms of switch.
R=rsc
DELTA=76  (0 added, 63 deleted, 13 changed)
OCL=26439
CL=26490
2009-03-18 14:05:05 -07:00
Ken Thompson
1cdcfda140 remove assignment cases from switch
R=r
OCL=26480
CL=26480
2009-03-18 12:13:42 -07:00
Rob Pike
bd3c478f93 add value checks to the other switch - should have done this in prior round
R=rsc
OCL=26438
CL=26438
2009-03-17 20:57:54 -07:00
Rob Pike
bcb464d221 add test for type switches
R=rsc
DELTA=169  (169 added, 0 deleted, 0 changed)
OCL=26433
CL=26437
2009-03-17 20:55:42 -07:00
Ian Lance Taylor
bd64e81041 Recognize gccgo error message.
const2.go:7:9: error: expected '='

Uses '.' to recognize the quotation marks, as the actual
characters printed depend on the user's locale.

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=26360
CL=26373
2009-03-16 21:48:07 -07:00
Ian Lance Taylor
1e39143966 Don't try to define the same label twice, as that produces a
label redefinition error.

R=gri
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=26357
CL=26372
2009-03-16 21:47:38 -07:00
Robert Griesemer
5a27079801 spec and implementation disagree with respect to label declarations
R=rsc
DELTA=19  (19 added, 0 deleted, 0 changed)
OCL=26284
CL=26336
2009-03-16 11:21:58 -07:00
Robert Griesemer
b260916a55 internal compiler error
R=rsc
DELTA=18  (18 added, 0 deleted, 0 changed)
OCL=26266
CL=26266
2009-03-13 14:14:50 -07:00
Russ Cox
5fbadf0bc3 warn -> yyerror in mparith.
close two more bugs.

R=ken
OCL=26226
CL=26226
2009-03-12 19:57:30 -07:00
Russ Cox
8f194bf5ff make 6g constants behave as ken proposes. (i hope.)
various bug fixes and tests involving constants.

test/const1.go is the major new test case.

R=ken
OCL=26216
CL=26224
2009-03-12 19:04:38 -07:00
Ken Thompson
767845b6fa bug 125
R=r
OCL=26146
CL=26146
2009-03-11 17:37:04 -07:00
Ken Thompson
48f6b516e2 bug 137
R=r
OCL=26142
CL=26142
2009-03-11 16:25:45 -07:00
Russ Cox
4eb7ceba58 complain when trying to put T into an interface
if T has pointer methods.  this is just a heuristic
but it catches the problem robert ran into and
lets me put the larger interface issues aside for
now.  found one bug in pretty.

R=ken
OCL=26141
CL=26141
2009-03-11 16:06:17 -07:00
Ken Thompson
d27e9f528d bug086
R=r
OCL=26090
CL=26090
2009-03-10 19:16:31 -07:00
Robert Griesemer
b2e91a9a29 constant conversion of int (non-ideal) constant doesn't work
R=rsc
DELTA=20  (20 added, 0 deleted, 0 changed)
OCL=26054
CL=26062
2009-03-10 16:39:23 -07:00
Rob Pike
99d00eae3c delete vestigial references to package syscall
R=rsc
DELTA=8  (0 added, 5 deleted, 3 changed)
OCL=25857
CL=25861
2009-03-06 16:03:59 -08:00
Russ Cox
63985b489b bug085 bug129
R=ken
OCL=25787
CL=25791
2009-03-05 15:57:03 -08:00
Rob Pike
5ef8e1d47e update missed test case to {}
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25648
CL=25654
2009-03-03 16:09:12 -08:00
Russ Cox
be2edb5761 Automated g4 rollback of changelist 25024,
plus significant hand editing.

Back to T{x} for composite literals.

R=r
OCL=25612
CL=25632
2009-03-03 08:39:12 -08:00
Rob Pike
88b1f8594a bug130 is fixed
R=ken
OCL=25448
CL=25448
2009-02-25 16:31:42 -08:00
Russ Cox
ebc10db3e1 allow parens to disambiguate types.
examples:

	chan <- (chan int)
	chan (<- chan int)
	(map[string]func())("a": main)

R=ken
OCL=25151
CL=25151
2009-02-18 10:07:46 -08:00
Russ Cox
d3d0c256be bug123
R=ken
OCL=25075
CL=25075
2009-02-16 17:44:05 -08:00
Robert Griesemer
127526649f - vector package (identical to array except for names)
- updated some file (but not all - left array package in place for now)

R=rsc
DELTA=530  (483 added, 0 deleted, 47 changed)
OCL=25025
CL=25025
2009-02-13 15:07:56 -08:00
Russ Cox
9f8f2e6130 convert composite literals from { } to ( ).
only non-trivial changes are in
	convlit1.go
	golden.out

R=gri
OCL=25019
CL=25024
2009-02-13 14:48:32 -08:00
Robert Griesemer
920ab67b4c label declarations not handled properly
R=rsc
DELTA=27  (27 added, 0 deleted, 0 changed)
OCL=25015
CL=25015
2009-02-13 13:42:43 -08:00
Russ Cox
49e2087848 insert type assertions when narrowing.
R=r
OCL=24349
CL=24913
2009-02-11 17:55:16 -08:00
Robert Griesemer
a85e06f302 bug: empty statement not properly recognized in conjunction w/ labels
R=r
DELTA=14  (14 added, 0 deleted, 0 changed)
OCL=24610
CL=24610
2009-02-06 16:45:37 -08:00
Ian Lance Taylor
1103d78c84 Recognize gccgo error messages:
func4.go:8:11: error: invalid operand for unary '&'
func4.go:9:8: error: invalid left hand side of assignment

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=24294
CL=24603
2009-02-06 15:57:02 -08:00
Rob Pike
ee9b5a15a1 powser cleanup.
- don't need *struct
- don't need item/rat both
- closures make the inner slaves easier
- delete some old BUG comments

powser2 is left mostly alone, for variety.

R=rsc
DELTA=134  (2 added, 20 deleted, 112 changed)
OCL=24579
CL=24581
2009-02-06 15:03:14 -08:00
Russ Cox
0f4f2a6183 closures - runtime and debugger support, test case
R=r
DELTA=257  (250 added, 1 deleted, 6 changed)
OCL=24509
CL=24565
2009-02-06 13:46:56 -08:00
Russ Cox
b0009bef20 bug064
make f(g()) work when g returns multiple
args with names different than f expects.

func swap(a, b int) (c, d int) {
	return b, a
}

swap(swap(1,2))

R=ken
OCL=24474
CL=24476
2009-02-05 15:22:49 -08:00
Ian Lance Taylor
58c277955a Rename function to avoid function redefinition error. Remove
.* from regexp since it confuses DejaGNU which runs gcc's
testsuite.

R=rsc
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=24435
CL=24438
2009-02-05 12:54:15 -08:00
Rob Pike
f9cc900ae8 bugs cleanup, including deleting one near-identical duplicate bug
R=rsc
DELTA=52  (15 added, 37 deleted, 0 changed)
OCL=24274
CL=24274
2009-02-03 16:59:26 -08:00
Russ Cox
4cf7711568 update go code tree to new func rules.
R=r
DELTA=367  (111 added, 59 deleted, 197 changed)
OCL=23957
CL=23960
2009-01-30 14:39:31 -08:00
Russ Cox
391425ae55 if take address of local, move to heap.
heuristic to not print bogus strings.
fix one error message format.

R=ken
OCL=23849
CL=23851
2009-01-29 17:38:58 -08:00
Russ Cox
6ee6d6ec55 add stack test
R=r
DELTA=48  (48 added, 0 deleted, 0 changed)
OCL=23715
CL=23732
2009-01-28 16:58:48 -08:00
Robert Griesemer
cb659ece0e additions to array container:
- added Slice, Cut, InsertArray, AppendArray
- renamed Remove -> Delete (so we have: Insert, Delete, Cut)
- more factoring of code
- extra tests (could use some more)

R=r,rsc
DELTA=179  (127 added, 22 deleted, 30 changed)
OCL=23648
CL=23685
2009-01-28 13:32:31 -08:00
Rob Pike
712522a6d8 bug135 is fixed
TBR=ken
OCL=23650
CL=23650
2009-01-27 19:30:44 -08:00
Rob Pike
c8476472d9 test for defer
R=rsc
DELTA=48  (48 added, 0 deleted, 0 changed)
OCL=23624
CL=23626
2009-01-27 15:08:08 -08:00
Rob Pike
fa615a3b30 f, ok := i.(Foo) does not compile if i already is equivalent to Foo
R=rsc
DELTA=18  (18 added, 0 deleted, 0 changed)
OCL=23544
CL=23547
2009-01-26 18:35:18 -08:00
Russ Cox
1ce17918e3 gc #0. mark and sweep collector.
R=r,gri
DELTA=472  (423 added, 2 deleted, 47 changed)
OCL=23522
CL=23541
2009-01-26 17:37:05 -08:00
Russ Cox
f1fe21a08f bug134
R=ken
OCL=23532
CL=23532
2009-01-26 17:06:20 -08:00
Russ Cox
4efad58d0a bug133
R=ken
OCL=23528
CL=23528
2009-01-26 16:57:24 -08:00
Russ Cox
9b6d385cb5 interface speedups and fixes.
more caching, better hash functions, proper locking.
fixed a bug in interface comparison too.

R=ken
DELTA=177  (124 added, 10 deleted, 43 changed)
OCL=23491
CL=23493
2009-01-26 12:36:21 -08:00
Ken Thompson
7859ae8a2f removed a:b in range syntax
added another channel test

R=r
OCL=23488
CL=23488
2009-01-26 11:34:38 -08:00
Ian Lance Taylor
2a4f4dd842 Add a test for a case where 6g thinks that a field is visible
when it should not be.  I couldn't get this any simpler; the
error seems to have to do with the order of the imports in
bug2.go.

R=rsc
DELTA=26  (26 added, 0 deleted, 0 changed)
OCL=23450
CL=23482
2009-01-26 09:59:59 -08:00
Russ Cox
a7f6d4066e implement new restrictions on what
can be compared/hashed.

R=r
DELTA=351  (201 added, 80 deleted, 70 changed)
OCL=23423
CL=23481
2009-01-26 09:56:42 -08:00
Russ Cox
d2117ad438 make test/chan/nonblock work even with real os threads
R=ken
OCL=23422
CL=23422
2009-01-23 17:04:56 -08:00
Robert Griesemer
e1e158a90c - added comment with various viewpoints so we have whole story
once we close this

R=r
OCL=23239
CL=23239
2009-01-21 14:57:47 -08:00
Russ Cox
61590c4c44 disallow P.t for lowercase t and not our package P.
implement hiding lowercase methods m in
signatures by adding in a hash of the package name
to the type hash code.

remove remaining checks for internally-generated _ names:
they are all gone.

R=ken
OCL=23236
CL=23238
2009-01-21 14:51:57 -08:00
Robert Griesemer
41644d7138 - duplicate struct field not diagnosed
R=rsc
DELTA=16  (16 added, 0 deleted, 0 changed)
OCL=23224
CL=23229
2009-01-21 14:11:54 -08:00
Ian Lance Taylor
793a97fbf6 Get this bug back to the intended state: bug1.go is making a
reference to a type which should not be visible.  The test
currently fails with 6g.

R=rsc
DELTA=7  (4 added, 0 deleted, 3 changed)
OCL=23222
CL=23225
2009-01-21 12:52:22 -08:00
Ian Lance Taylor
87b1f05dbe sys.readfile has been removed. Remove the test case for it.
It was disabled last week anyhow.

R=r,rsc
DELTA=24  (0 added, 24 deleted, 0 changed)
OCL=23205
CL=23220
2009-01-21 11:56:47 -08:00
Ian Lance Taylor
8e79b0a2a8 With the removal of export, this bug no longer tests anything
interesting.  It was disabled last week anyhow.  Let's just
delete it.

R=r,rsc
DELTA=12  (0 added, 12 deleted, 0 changed)
OCL=23204
CL=23219
2009-01-21 11:56:28 -08:00
Russ Cox
839a68469b delete export
TBR=r
OCL=23121
CL=23127
2009-01-20 14:40:40 -08:00
Russ Cox
f48cbfdf56 convert tests; nothing interesting.
R=r
OCL=23012
CL=23014
2009-01-16 16:12:14 -08:00
Ian Lance Taylor
03c40f5122 Change malloc.Lookup to return the size as uintptr rather than
uint64.  This changes the Go code to be consistent with the C
code.

R=rsc
DELTA=6  (0 added, 0 deleted, 6 changed)
OCL=22983
CL=22987
2009-01-16 15:03:22 -08:00
Russ Cox
360962420c casify, cleanup sys
R=r
OCL=22978
CL=22984
2009-01-16 14:58:14 -08:00
Russ Cox
8a7cbadbbe convert strconv
R=r
DELTA=568  (0 added, 9 deleted, 559 changed)
OCL=22898
CL=22901
2009-01-15 17:22:17 -08:00
Rob Pike
61f3302044 printf->Printf etc.
the raw fmt routines will be another, smaller but subtler pass.

R=rsc
DELTA=157  (0 added, 0 deleted, 157 changed)
OCL=22851
CL=22851
2009-01-15 13:48:11 -08:00
Ian Lance Taylor
c0f6144f1b Test that a const with an explicit type is not treated as
having an abstract type.

R=gri
DELTA=11  (11 added, 0 deleted, 0 changed)
OCL=22829
CL=22832
2009-01-15 11:23:35 -08:00
Ian Lance Taylor
9414681972 Test that interfaces are correctly handled by pointer and by
value for large and small objects.  Currently one case fails
with 6g.

R=rsc
DELTA=150  (150 added, 0 deleted, 0 changed)
OCL=22823
CL=22827
2009-01-15 10:15:34 -08:00
Ian Lance Taylor
87af75ff74 Recognize gccgo error messages:
interface5.go:15:5: error: incompatible types in assignment
interface5.go:16:5: error: incompatible types in assignment

(Yes, these could be better).

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=22821
CL=22826
2009-01-15 10:15:23 -08:00
Russ Cox
cbd08ed261 test of automatic indirect
R=r
DELTA=93  (93 added, 0 deleted, 0 changed)
OCL=22458
CL=22461
2009-01-09 15:38:01 -08:00
Rob Pike
c45d2a767c simplify flag interface. no more BVal etc. you just get a pointer.
fixed everything except the tutorial.

R=rsc
DELTA=404  (94 added, 139 deleted, 171 changed)
OCL=22414
CL=22422
2009-01-09 13:42:46 -08:00
Russ Cox
51c3ac7e3f bug046 and bug080 are fixed
R=r
DELTA=72  (30 added, 42 deleted, 0 changed)
OCL=22373
CL=22378
2009-01-08 20:06:37 -08:00
Russ Cox
e512481b17 second pass on interface fixes and tests.
R=ken
OCL=22370
CL=22372
2009-01-08 18:06:06 -08:00
Rob Pike
a577ea3176 uncomment a BUG that is now fixed
R=rsc
DELTA=3  (1 added, 0 deleted, 2 changed)
OCL=22195
CL=22207
2009-01-07 10:35:43 -08:00
Rob Pike
4d194b9056 18 tests are behaving incorrectly
no more surprises - all caught up

R=rsc
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=22194
CL=22194
2009-01-06 20:17:58 -08:00
Ken Thompson
476e3cd7fd fixed and added more tests
R=r
OCL=22187
CL=22187
2009-01-06 17:44:59 -08:00
Russ Cox
84953bdaa8 fix newfn
R=ken
OCL=22173
CL=22173
2009-01-06 15:39:28 -08:00
Russ Cox
5564504507 new new & make
R=r
OCL=22166
CL=22166
2009-01-06 15:19:02 -08:00
Rob Pike
315033368e bug020 is fixed
R=rsc
DELTA=40  (18 added, 22 deleted, 0 changed)
OCL=22134
CL=22139
2009-01-06 13:44:44 -08:00
Rob Pike
25444d079f clean up some tests
R=rsc
DELTA=10  (1 added, 2 deleted, 7 changed)
OCL=22033
CL=22033
2009-01-05 13:09:34 -08:00
Ian Lance Taylor
3f69acfb0c Test for a go statement which calls a method on an interface.
R=ken
DELTA=20  (20 added, 0 deleted, 0 changed)
OCL=21889
CL=21929
2008-12-30 15:03:46 -08:00
Ken Thompson
b2dfd787d7 allow slices (open arrays) to be
receivers in methods.
put back original code for hilbert/bignum

R=r
OCL=21910
CL=21920
2008-12-30 14:02:20 -08:00
Rob Pike
eb32228627 hilbert now runs.
it's 25% faster and runs with 40% less memory allocation than before

R=rsc
DELTA=20  (15 added, 0 deleted, 5 changed)
OCL=21690
CL=21690
2008-12-20 18:15:34 -08:00
Rob Pike
62b06fa506 update map test.
convert to printf.
increase count to 1000 - maps are faster now.
add cases for structure values as key and maps.

R=rsc
DELTA=197  (66 added, 18 deleted, 113 changed)
OCL=21683
CL=21686
2008-12-20 16:07:43 -08:00
Rob Pike
61a7e44002 fix some tests. only 3 remain broken (complit, hilbert, initcomma).
leaving golden.out alone for now.

R=ken
DELTA=13  (0 added, 0 deleted, 13 changed)
OCL=21682
CL=21682
2008-12-20 13:38:29 -08:00
Russ Cox
c3077f7606 [] and struct in interfaces.
other [] cleanup.

convert() is gone.

R=r
DELTA=352  (144 added, 68 deleted, 140 changed)
OCL=21660
CL=21662
2008-12-19 17:11:54 -08:00
Russ Cox
eee50ae1ac chan and map of [] and struct
R=r
DELTA=192  (145 added, 8 deleted, 39 changed)
OCL=21609
CL=21614
2008-12-19 12:05:22 -08:00
Russ Cox
da0a7d7b8f malloc bug fixes.
use malloc by default.
free stacks.

R=r
DELTA=424  (333 added, 29 deleted, 62 changed)
OCL=21553
CL=21584
2008-12-19 03:13:39 -08:00
Russ Cox
08ca30bbfa change *map to map; *chan to chan; new(T) to new(*T)
fix bugs left over from *[] to [] conversion.

TBR=r
OCL=21576
CL=21581
2008-12-19 03:05:37 -08:00