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

494 Commits

Author SHA1 Message Date
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
Russ Cox
d47d888ba6 convert *[] to [].
R=r
OCL=21563
CL=21571
2008-12-18 22:37:22 -08:00
Ken Thompson
4026500d18 arrays
R=r
OCL=21564
CL=21564
2008-12-18 20:06:28 -08:00
Russ Cox
83348f956e host and port name lookup
R=r,presotto
DELTA=1239  (935 added, 281 deleted, 23 changed)
OCL=21041
CL=21539
2008-12-18 15:42:39 -08:00
Russ Cox
e29ce175ed malloc in runtime (not used by default)
R=r
DELTA=1551  (1550 added, 0 deleted, 1 changed)
OCL=21404
CL=21538
2008-12-18 15:42:28 -08:00
Russ Cox
e53d5ad620 fix type/name thing, again
R=r
DELTA=8  (7 added, 0 deleted, 1 changed)
OCL=21379
CL=21379
2008-12-16 17:45:28 -08:00
Rob Pike
0816debdfc update tests - 119 is fixed
R=gri
DELTA=62  (28 added, 34 deleted, 0 changed)
OCL=21269
CL=21271
2008-12-16 10:31:08 -08:00
Ken Thompson
ae5a475e20 range clause must have = or :=
:= illegal in for-increment

R=r
OCL=21204
CL=21204
2008-12-15 13:44:27 -08:00
Rob Pike
58a320f926 test update
R=rsc
DELTA=16  (5 added, 10 deleted, 1 changed)
OCL=21085
CL=21087
2008-12-12 13:29:25 -08:00
Russ Cox
889d9b6ffd bug129
package foo
import "syscall"
func f() {
	syscall := 1
}

R=ken
OCL=21036
CL=21036
2008-12-11 18:19:07 -08:00
Rob Pike
77fbc310e4 another bug cleanup.
R=rsc
DELTA=117  (54 added, 62 deleted, 1 changed)
OCL=20924
CL=20927
2008-12-10 14:59:43 -08:00
Rob Pike
fbfc9dddb2 update tests: nil is no longer integer-compatible
R=rsc
DELTA=56  (17 added, 32 deleted, 7 changed)
OCL=20876
CL=20916
2008-12-10 13:55:47 -08:00
Russ Cox
3935610e35 chans and maps of interfaces
R=r
DELTA=746  (729 added, 1 deleted, 16 changed)
OCL=20858
CL=20858
2008-12-09 16:16:07 -08:00
Ian Lance Taylor
48e5110151 Tweak comments so that this test passes with gccgo.
bug126.go:7:7: error: redefinition of 'none'
bug126.go:6:7: note: previous definition of 'none' was here

R=gri
DELTA=3  (1 added, 0 deleted, 2 changed)
OCL=20563
CL=20723
2008-12-08 11:31:55 -08:00
Ken Thompson
26b357ca5b range statement
R=r
OCL=20667
CL=20667
2008-12-05 18:24:05 -08:00
Rob Pike
2fe97c336d test pairwise iota assignment
R=rsc
DELTA=13  (13 added, 0 deleted, 0 changed)
OCL=20638
CL=20641
2008-12-05 15:37:09 -08:00
Ian Lance Taylor
cc352e5c1c The DejaGNU testsuite harness used by the gccgo testsuite is
broken if you give it something which matches everything--the
.* swallows all the error messages.  Recognize some reasonable
error text directly.

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=20564
CL=20595
2008-12-05 10:20:34 -08:00
Rob Pike
94a66489ed bug128 is fixed
R=rsc
DELTA=43  (19 added, 24 deleted, 0 changed)
OCL=20551
CL=20551
2008-12-04 20:51:47 -08:00
Russ Cox
dfa5893d4f preparation for exec.
* syscall:
	add syscall.RawSyscall, which doesn't use sys.entersyscall/sys.exitsyscall
	add syscall.dup2
	add syscall.BytePtrPtr
	add syscall.Rusage, RusagePtr
	add syscall.F_GETFD, F_SETFD, FD_CLOEXEC

* runtime:
	clean up, correct signal handling.
	can now survive (continue running after) a signal.

R=r
DELTA=394  (286 added, 51 deleted, 57 changed)
OCL=20351
CL=20369
2008-12-03 14:21:28 -08:00
Russ Cox
98431dbfff golden.out drift
TBR=r
OCL=20352
CL=20355
2008-12-03 13:05:56 -08:00
Robert Griesemer
4d76e8e142 - bug: empty switches don't compile
R=rsc
DELTA=32  (28 added, 3 deleted, 1 changed)
OCL=20301
CL=20340
2008-12-03 10:41:43 -08:00
Russ Cox
1e1a3c5054 6g gives no error on "0 != nil"
R=ken
OCL=20289
CL=20289
2008-12-02 16:35:00 -08:00
Robert Griesemer
b0192ea1a5 bug: constants should not be redeclarable
R=rsc
DELTA=9  (9 added, 0 deleted, 0 changed)
OCL=20187
CL=20187
2008-12-01 17:27:57 -08:00
Russ Cox
efc86a74e4 change meaning of $GOMAXPROCS to number of cpus to use,
not number of threads.  can still starve all the other threads,
but only by looping, not by waiting in a system call.

fix darwin syscall.Syscall6 bug.

fix chanclient bug.

delete $GOMAXPROCS from network tests.

add stripped down printf, sys.printhex to runtime.

R=r
DELTA=355  (217 added, 36 deleted, 102 changed)
OCL=20017
CL=20019
2008-11-25 16:48:10 -08:00
Rob Pike
3489fe958e compiler catches out of bounds; work around
R=ken
OCL=19943
CL=19943
2008-11-24 16:23:49 -08:00
Russ Cox
0f83fa3a0c convert tests.
refine gotest's test selection criteria.

R=r
DELTA=1590  (745 added, 844 deleted, 1 changed)
OCL=19903
CL=19936
2008-11-24 15:17:47 -08:00
Russ Cox
387df5e176 replay CL 19916 and CL 19913 now that the build can handle them
TBR=r
OCL=19924
CL=19934
2008-11-24 14:51:33 -08:00
Russ Cox
85fea81d70 Automated g4 rollback of changelist 19916.
*** Reason for rollback ***

broke build

*** Original change description ***

utf8: add InString routines for decoding in strings
reflect: add InterfaceValue.Get(), remove Empty
strconv: add Quote, CanBackquote
fmt:
	* %q go-quoted " string
	* %#q go-quoted ` string if possible, " string otherwise
	* %x hexadecimal string
	* anywhere a string is okay, *[]byte is okay
	* flags # 0 - + space
	* print value inside interface, not interface itself
	* tests

TBR=r
OCL=19920
CL=19920
2008-11-24 13:24:15 -08:00
Russ Cox
b65a930453 utf8: add InString routines for decoding in strings
reflect: add InterfaceValue.Get(), remove Empty
strconv: add Quote, CanBackquote
fmt:
	* %q go-quoted " string
	* %#q go-quoted ` string if possible, " string otherwise
	* %x hexadecimal string
	* anywhere a string is okay, *[]byte is okay
	* flags # 0 - + space
	* print value inside interface, not interface itself
	* tests

R=r
DELTA=756  (597 added, 121 deleted, 38 changed)
OCL=19888
CL=19916
2008-11-24 13:04:27 -08:00
Russ Cox
0432a34383 make bignum_test a test
R=gri
DELTA=967  (468 added, 499 deleted, 0 changed)
OCL=19906
CL=19912
2008-11-24 12:32:31 -08:00
Rob Pike
375b1e2a0e output of fmt has changed for %g
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=19909
CL=19909
2008-11-24 11:59:23 -08:00
Rob Pike
60db3d6d3f don't print (incorrect anyway) line numbers in panic.
R=rsc
DELTA=4  (0 added, 2 deleted, 2 changed)
OCL=19757
CL=19763
2008-11-20 23:16:31 -08:00
Russ Cox
88daac7862 gotestify & gostylify math.
R=r
DELTA=682  (275 added, 301 deleted, 106 changed)
OCL=19638
CL=19642
2008-11-19 16:14:31 -08:00
Robert Griesemer
bef9b1713a - removed uses of vector in favor of array in a few places
- fixed make.bash

R=r
DELTA=21  (1 added, 3 deleted, 17 changed)
OCL=19624
CL=19629
2008-11-19 15:16:20 -08:00
Robert Griesemer
165d78717d - adjust sort.go to use new naming conventions
R=rsc
DELTA=31  (0 added, 0 deleted, 31 changed)
OCL=19618
CL=19620
2008-11-19 14:32:15 -08:00
Russ Cox
6cc001c312 return *os.Error instead of bool from strconv.ato*
R=r
DELTA=137  (56 added, 4 deleted, 77 changed)
OCL=19505
CL=19522
2008-11-18 17:12:07 -08:00
Ian Lance Taylor
d12c1b99c7 Add ERROR comment for errmsg to look for.
R=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=19460
CL=19500
2008-11-18 15:58:43 -08:00
Robert Griesemer
6c5fc055c8 import syntax incorrect
R=r
OCL=19457
CL=19457
2008-11-18 09:39:34 -08:00
Russ Cox
c78005f648 update golden.out
R=r
OCL=19455
CL=19455
2008-11-18 09:35:42 -08:00
Ian Lance Taylor
d8ecead73d The compiler should reject calling a const as though it were a
function.  Also update golden.out.

R=r
DELTA=18  (18 added, 0 deleted, 0 changed)
OCL=19433
CL=19448
2008-11-18 06:25:21 -08:00
Ian Lance Taylor
1945cc4c3c The compiler should reject comparisons between ints and nil.
R=gri
DELTA=8  (8 added, 0 deleted, 0 changed)
OCL=19434
CL=19436
2008-11-17 21:44:05 -08:00
Robert Griesemer
7692a93173 - new() accepts too many arguments
R=r
OCL=19413
CL=19413
2008-11-17 16:46:56 -08:00
Robert Griesemer
d58cd7626e - interface methods must have full function type
R=r
OCL=19410
CL=19410
2008-11-17 16:37:13 -08:00
Russ Cox
a1585b676b fix the easy parts of bug120
R=r,ken
DELTA=66  (52 added, 3 deleted, 11 changed)
OCL=19386
CL=19389
2008-11-17 13:58:45 -08:00
Russ Cox
869c3f4cd0 update golden.out.
fix bug in run that was missing output.
make run warn about tests in bugs/ that succeed with no output
	(should be moved to fixedbugs/).

R=r
DELTA=21  (18 added, 0 deleted, 3 changed)
OCL=19381
CL=19381
2008-11-17 12:44:22 -08:00
Russ Cox
079c00a475 correctly rounded floating-point conversions
in new package strconv.

move atoi etc to strconv too.

update fmt, etc to use strconv.

R=r
DELTA=2232  (1691 added, 424 deleted, 117 changed)
OCL=19286
CL=19380
2008-11-17 12:34:03 -08:00
Russ Cox
f333f4685c floating point constant errors in 6g
R=r
OCL=19379
CL=19379
2008-11-17 12:33:49 -08:00
Ian Lance Taylor
b1e8b5f5b7 The scope rules have been clarified to indicate that a
variable may only be named after the complete declaration,
including the initialization statements.

R=gri
DELTA=61  (16 added, 45 deleted, 0 changed)
OCL=19343
CL=19376
2008-11-17 12:19:02 -08:00
Russ Cox
5aa7dc5daf adopt suggestions from Bentley and McIlroy (SP&E Nov 1993)
to make qsort more robust:

	* use "ninther" to choose pivot.
	* use three-way partition to avoid quadratic
 	  behavior on all-one-value arrays.

also add tests suggested in that paper.

the immediate cause of the slowness we observed was
in fact none of these: the recursive call was sorting
data[0:m] instead of data[a:m].

also rename package to "sort" to match convention.

R=r,gri
DELTA=358  (255 added, 21 deleted, 82 changed)
OCL=19341
CL=19373
2008-11-17 11:51:34 -08:00
Ian Lance Taylor
7dee51f491 The compilers should and do permit interface types to list
multiple method names with a single type.

R=r,gri
DELTA=10  (0 added, 10 deleted, 0 changed)
OCL=19292
CL=19298
2008-11-14 17:28:17 -08:00
Russ Cox
c5f21c0dc2 * 6l:
if an object in an archive tries to refer
	to a file in its original source directory,
	ignore it.

* 6ar:
	fix bug if archive is empty.

* gobuild:
	build archive in current directory.

* math:
	use new gobuild Makefile.

* test/math.go:
	rename to mathest.go, add // run line, make it run.

R=r
DELTA=494  (277 added, 203 deleted, 14 changed)
OCL=19090
CL=19171
2008-11-13 13:42:26 -08:00
Ian Lance Taylor
c4d8dc0b83 This bug has been fixed; moving it from bugs to fixedbugs.
R=gri
DELTA=36  (18 added, 18 deleted, 0 changed)
OCL=19059
CL=19133
2008-11-12 21:59:43 -08:00
Robert Griesemer
20b9bfb136 wrong code for array access
R=r
OCL=19107
CL=19109
2008-11-12 14:57:23 -08:00
Ian Lance Taylor
9c9cc2c9d8 Recognize gccgo error messages. This uses GCCGO_ERROR, which
is recognized by the gccgo testsuite but is ignored by the
errchk script used with 6g.

method1.go:7:1: error: redefinition of 'M': parameter types changed
method1.go:6:1: note: previous definition of 'M' was here
method1.go:10:1: error: redefinition of 'f': parameter types changed
method1.go:9:1: note: previous definition of 'f' was here
method1.go:13:1: error: redefinition of 'g': parameter names changed
method1.go:12:1: note: previous definition of 'g' was here

R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=18962
CL=19058
2008-11-11 18:18:34 -08:00
Ian Lance Taylor
a957ceec35 The scope rules have been changed to say that labels live in a
separate per-function namespace.

R=gri
DELTA=24  (8 added, 16 deleted, 0 changed)
OCL=19006
CL=19057
2008-11-11 18:17:54 -08:00
Ian Lance Taylor
07c54425c0 Remove useless "Trace/breakpoint trap" lines using the format
that is generated on Goobuntu.

R=r,rsc
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=18973
CL=18976
2008-11-11 10:01:51 -08:00
Rob Pike
203a17c6ec update tests
R=gri
DELTA=28  (12 added, 14 deleted, 2 changed)
OCL=18923
CL=18923
2008-11-10 14:59:15 -08:00
Ian Lance Taylor
f8d7f5bd81 Don't use a type guard with a type which is not an interface.
R=r,gri
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=18781
CL=18785
2008-11-07 11:44:15 -08:00
Ian Lance Taylor
d5ba668edd Test case for evaluation order of select statement.
R=r
DELTA=47  (47 added, 0 deleted, 0 changed)
OCL=18581
CL=18748
2008-11-06 22:27:32 -08:00
Ian Lance Taylor
9c7374d71b Erroneous test case. The break statement should break out of
a select clause.

R=ken
DELTA=20  (0 added, 20 deleted, 0 changed)
OCL=18731
CL=18739
2008-11-06 17:39:48 -08:00
Rob Pike
175dd773e6 simpleminded ascii to floating point conversion
R=rsc
DELTA=111  (107 added, 0 deleted, 4 changed)
OCL=18720
CL=18725
2008-11-06 16:32:28 -08:00
Ian Lance Taylor
ce15158502 Test that a break statement inside a select statement breaks
out of the enclosing loop.

R=ken
DELTA=20  (20 added, 0 deleted, 0 changed)
OCL=18686
CL=18714
2008-11-06 15:24:10 -08:00
Robert Griesemer
ce164403da A recreational programming exercise:
Multiplication of a Hilbert matrix with its inverse using
Bignum.Rationals as a test case for rational arithmetic.

R=r
OCL=18706
CL=18706
2008-11-06 14:23:49 -08:00
Robert Griesemer
66c6b13b03 - implemented String() and Format functionality in Bignum
- added a test

R=r
OCL=18687
CL=18687
2008-11-06 12:13:52 -08:00
Ian Lance Taylor
48d111f0b9 6g dumps core on this input file.
R=ken,rsc
DELTA=14  (14 added, 0 deleted, 0 changed)
OCL=18555
CL=18598
2008-11-05 15:27:40 -08:00
Ian Lance Taylor
7fe34ea002 Fix powser1.go to compile with the current 6g, which doesn't
recognize methods for a variable whose type is a named type
which is a pointer type.  Add bug117 to test this case.

R=r
DELTA=24  (22 added, 0 deleted, 2 changed)
OCL=18547
CL=18554
2008-11-05 12:06:48 -08:00
Ian Lance Taylor
6cd74b03f3 Don't use a named pointer type as a receiver type. The
current spec forbids it:
    The type specified by the type name is called ``receiver
    base type''.  The receiver base type must be a type
    declared in the current file, and it must not be a pointer
    type.

R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=18527
CL=18541
2008-11-05 11:25:30 -08:00
Rob Pike
02f718339b update golden.out
R=rsc
OCL=18482
CL=18484
2008-11-04 14:33:47 -08:00
Robert Griesemer
e2eccf3bd0 install bignum as library
R=r
DELTA=3501  (1752 added, 1749 deleted, 0 changed)
OCL=18460
CL=18471
2008-11-04 13:55:18 -08:00
Russ Cox
d289e6344f move invalid method uses to new test
R=iant
DELTA=24  (13 added, 10 deleted, 1 changed)
OCL=18424
CL=18439
2008-11-04 09:45:27 -08:00
Russ Cox
56a7895386 fixed tests
R=r
DELTA=124  (62 added, 62 deleted, 0 changed)
OCL=18389
CL=18394
2008-11-03 15:52:34 -08:00
Russ Cox
c249a8de32 rename various magic names.
sigi and sigt:
	sys·sigi_inter -> sigi·inter
	sys·sigt_int -> sigt·int
	Package·sigt_Type -> sigt·Package.Type

	local type T in file x.go T_x -> T·x
	second one T_x_1 -> T·x·1

	method names M on T  T_M -> T·M

correctly handle local embedded types

init functions are the only place left that use underscores

R=ken
OCL=18377
CL=18377
2008-11-03 15:36:08 -08:00
Ian Lance Taylor
2eb17d7894 Recognize gccgo error message:
interface1.go:29:6: error: incompatible type in initialization (missing method Next)

R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=18183
CL=18271
2008-10-31 14:55:57 -07:00
Rob Pike
c1198b9b87 update tests
R=rsc
DELTA=159  (65 added, 84 deleted, 10 changed)
OCL=18149
CL=18151
2008-10-30 13:26:57 -07:00
Russ Cox
eb5a316fa6 make sure errchk only prints BUG once.
using a variable is not sufficient, because
sometimes bug() is called from a subshell.

R=iant
DELTA=7  (2 added, 1 deleted, 4 changed)
OCL=18092
CL=18145
2008-10-30 12:43:32 -07:00
Russ Cox
9639bd0dd7 apply change suggested in CL 16658 review
R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=18091
CL=18094
2008-10-29 19:59:36 -07:00
Russ Cox
cf9e46fec6 bugs from old gri mail
R=gri
OCL=18093
CL=18093
2008-10-29 19:34:47 -07:00
Ian Lance Taylor
e76e9cfc33 Call the right function for int32 values.
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=18073
CL=18073
2008-10-29 15:48:34 -07:00
Russ Cox
cc5a382802 update Fmt interface: d=int, ud=uint, d32=int32, d64=int64, etc.
R=r
DELTA=202  (60 added, 24 deleted, 118 changed)
OCL=18029
CL=18038
2008-10-29 14:28:19 -07:00
Russ Cox
123bd8f24b more simple test fixes
R=r
OCL=18035
CL=18035
2008-10-29 14:09:48 -07:00
Ken Thompson
9eebfe6c3b types
R=r
OCL=18034
CL=18034
2008-10-29 14:09:32 -07:00
Russ Cox
915e809f86 update golden.out with new type names
R=r
OCL=18033
CL=18033
2008-10-29 14:05:00 -07:00
Russ Cox
9cdb8bd502 minor int/float fixes
R=ken
OCL=18032
CL=18032
2008-10-29 13:58:12 -07:00
Russ Cox
11a978adf5 shift bug in constant evaluator
R=ken
OCL=18031
CL=18031
2008-10-29 13:46:55 -07:00
Rob Pike
5fcb035bca update golden.out
R=ken
OCL=17900
CL=17900
2008-10-27 11:08:01 -07:00
Ken Thompson
24eb30b5d6 test
R=r
OCL=17855
CL=17855
2008-10-25 15:26:35 -07:00
Ian Lance Taylor
22a6747999 Per discussion earlier today with r and gri: when an interface
object has a value of type "int", it should not automatically
convert to type "int32".  That is, the type alias "int" should
be regarded as having been defined as though "type int int32"
appeared outside of the package, and as therefore being a
different type from "int32".

R=ken
DELTA=21  (20 added, 0 deleted, 1 changed)
OCL=17587
CL=17842
2008-10-24 22:40:32 -07:00
Russ Cox
689b28fd96 fix method function type compare bug (again)
R=ken
OCL=17819
CL=17819
2008-10-24 14:56:54 -07:00
Russ Cox
8d3a3dd904 update golden.out
R=iant
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=17680
CL=17711
2008-10-23 11:44:01 -07:00
Ian Lance Taylor
7dbee69b58 Match gccgo error messages.
convlit.go:17: error: incompatible type in initialization
convlit.go:18: error: incompatible types in binary expression
convlit.go:19: error: incompatible types in binary expression
convlit.go:20: error: incompatible types in binary expression
convlit.go:21: error: incompatible types in binary expression
convlit.go:23: error: cannot convert non-integer constant
convlit.go:24: error: integer type overflow
convlit.go:25: error: floating point overflow

R=rsc
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=17649
CL=17661
2008-10-22 16:09:24 -07:00
Russ Cox
dbabeb1d7a reject new of function type
R=ken
OCL=17598
CL=17598
2008-10-21 18:03:25 -07:00
Russ Cox
beee6915f8 rewrite &Point{1, 2} as allocation
R=ken
OCL=17592
CL=17592
2008-10-21 16:53:54 -07:00
Russ Cox
44b0ecc5ca 6g: use full type in sigt[0].name
sys: add sys.reflect
runtime: add canfail flag for later

R=ken
OCL=17583
CL=17583
2008-10-21 15:38:26 -07:00
Russ Cox
aacfbb461b 6g:
* print int as int, not P.int
	* write type info for non-exported types
	   in its own new section.

ar:
	skip over rest of line after $$

R=ken
OCL=17568
CL=17568
2008-10-21 14:34:45 -07:00
Ian Lance Taylor
6ae1df9b99 Match error messages generated by gccgo:
convlit1.go:6:15: error: composite literal requires array, map, or struct type
convlit1.go:5:16: error: incompatible type for element 0 in composite literal
convlit1.go:10:15: error: incompatible types in binary expression

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=17506
CL=17509
2008-10-20 17:10:03 -07:00
Rob Pike
03a9872fe3 add primitive ftoa, dtoa to strings library.
R=rsc
DELTA=72  (69 added, 0 deleted, 3 changed)
OCL=17478
CL=17480
2008-10-20 13:53:20 -07:00
Russ Cox
5fe4cd83a8 do not set t->recur on basic types.
the comment talked about printing, but now
t->recur is only used for typehash.
in typehash it is important to compute different
hashes for the different basic types.

add test that makes sure an interface { X() int8 }
cannot be used as interface { X() int64 }

R=ken
OCL=17396
CL=17396
2008-10-17 17:51:29 -07:00
Rob Pike
4bcfffb761 update fixed bugs (and delete an irrelevant one)
R=rsc
DELTA=328  (158 added, 170 deleted, 0 changed)
OCL=17353
CL=17359
2008-10-17 11:48:51 -07:00