Commit Graph

1117 Commits

Author SHA1 Message Date
Ian Lance Taylor
8d0265dd32 test: Match gccgo error messages.
The gccgo compiler does not always generate a "cannot use"
error message.  It only does so for named types.  Maybe that
should change, but in any case it is irrelevant for this test.

assign1.go:105:4: error: incompatible types in assignment (cannot use type A1 as type A)
assign1.go:107:5: error: incompatible types in assignment (cannot use type A as type A1)
assign1.go:112:4: error: incompatible types in assignment (cannot use type B1 as type B)
assign1.go:114:5: error: incompatible types in assignment (cannot use type B as type B1)
assign1.go:119:4: error: incompatible types in assignment (cannot use type C1 as type C)
assign1.go:121:5: error: incompatible types in assignment (cannot use type C as type C1)
assign1.go:126:4: error: incompatible types in assignment (cannot use type F1 as type F)
assign1.go:128:5: error: incompatible types in assignment (cannot use type F as type F1)
assign1.go:140:4: error: incompatible types in assignment (cannot use type M1 as type M)
assign1.go:142:5: error: incompatible types in assignment (cannot use type M as type M1)
assign1.go:147:4: error: incompatible types in assignment (cannot use type P1 as type P)
assign1.go:149:5: error: incompatible types in assignment (cannot use type P as type P1)
assign1.go:154:4: error: incompatible types in assignment (cannot use type S1 as type S)
assign1.go:156:5: error: incompatible types in assignment (cannot use type S as type S1)
assign1.go:158:6: error: incompatible types in assignment
assign1.go:159:6: error: incompatible types in assignment
assign1.go:160:5: error: incompatible types in assignment
assign1.go:161:5: error: incompatible types in assignment
assign1.go:162:6: error: incompatible types in assignment
assign1.go:163:6: error: incompatible types in assignment
assign1.go:165:6: error: incompatible types in assignment
assign1.go:166:6: error: incompatible types in assignment
assign1.go:167:5: error: incompatible types in assignment
assign1.go:168:5: error: incompatible types in assignment
assign1.go:169:6: error: incompatible types in assignment
assign1.go:170:6: error: incompatible types in assignment
assign1.go:172:6: error: incompatible types in assignment
assign1.go:173:6: error: incompatible types in assignment
assign1.go:174:5: error: incompatible types in assignment
assign1.go:175:5: error: incompatible types in assignment
assign1.go:176:6: error: incompatible types in assignment
assign1.go:177:6: error: incompatible types in assignment
assign1.go:179:6: error: incompatible types in assignment
assign1.go:180:6: error: incompatible types in assignment
assign1.go:181:5: error: incompatible types in assignment
assign1.go:182:5: error: incompatible types in assignment
assign1.go:183:6: error: incompatible types in assignment
assign1.go:184:6: error: incompatible types in assignment
assign1.go:186:6: error: incompatible types in assignment
assign1.go:187:6: error: incompatible types in assignment
assign1.go:188:5: error: incompatible types in assignment
assign1.go:189:5: error: incompatible types in assignment
assign1.go:190:6: error: incompatible types in assignment
assign1.go:191:6: error: incompatible types in assignment
assign1.go:193:6: error: incompatible types in assignment
assign1.go:194:6: error: incompatible types in assignment
assign1.go:195:5: error: incompatible types in assignment
assign1.go:196:5: error: incompatible types in assignment
assign1.go:197:6: error: incompatible types in assignment
assign1.go:198:6: error: incompatible types in assignment
assign1.go:200:6: error: incompatible types in assignment
assign1.go:201:6: error: incompatible types in assignment
assign1.go:202:5: error: incompatible types in assignment
assign1.go:203:5: error: incompatible types in assignment
assign1.go:204:6: error: incompatible types in assignment
assign1.go:205:6: error: incompatible types in assignment
assign1.go:207:6: error: incompatible types in assignment
assign1.go:208:6: error: incompatible types in assignment
assign1.go:209:5: error: incompatible types in assignment
assign1.go:210:5: error: incompatible types in assignment
assign1.go:211:6: error: incompatible types in assignment
assign1.go:212:6: error: incompatible types in assignment

R=rsc
CC=golang-dev
https://golang.org/cl/2163044
2010-09-10 19:12:10 -07:00
Ian Lance Taylor
9d93d57465 test: Run garbage collector before testing malloc numbers.
The gccgo library generates some garbage in the init routines
because it handles interfaces slightly differently.  Since the
test sets MemStats.Alloc to 0, the first time the garbage
collector runs it goes negative and the test fails.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2110044
2010-09-10 15:54:16 -07:00
Ian Lance Taylor
8e985dcda6 test: Reduce race conditions in chan/nonblock.go.
nonblock.go wants to test nonblocking operations on
synchronous channels, so it is inherently racy.  This
introduces loops to make the race conditions much more likely
to succeed when using gccgo.

R=r
CC=golang-dev
https://golang.org/cl/2161043
2010-09-10 15:37:20 -07:00
Ian Lance Taylor
dbc226d5a1 test: Match gccgo error messages.
gccgo does not handle 'new' specially here.

varerr.go:10:6: error: reference to undefined name ‘asdf’
varerr.go:12:6: error: invalid left hand side of assignment

R=rsc
CC=golang-dev
https://golang.org/cl/2139045
2010-09-10 12:45:46 -07:00
Ian Lance Taylor
d1b434b839 test: Match gccgo error messages.
undef.go:12:6: error: reference to undefined name ‘x’
undef.go:13:6: error: reference to undefined name ‘x’
undef.go:14:6: error: reference to undefined name ‘x’
undef.go:22:25: error: reference to undefined name ‘y’
undef.go:42:11: error: reference to undefined name ‘v’

R=rsc
CC=golang-dev
https://golang.org/cl/2152045
2010-09-10 12:44:37 -07:00
Ian Lance Taylor
b2d540acac test: Match gccgo error messages.
vareq.go:10:25: error: expected ';' or '}' or newline

vareq1.go:9:24: error: expected ';' or newline after top level declaration

R=rsc
CC=golang-dev
https://golang.org/cl/2132045
2010-09-10 12:44:07 -07:00
Ian Lance Taylor
c30b570468 test: Match gccgo error messages.
With the recursive descent parser that gccgo uses, I think
that it doesn't make sense to try to match a statement where a
statement is not expected.  If the construct is not a
statement, you will just get bizarre error messages.

topexpr.go:9:1: error: expected declaration
topexpr.go:14:1: error: expected declaration
topexpr.go:19:1: error: expected declaration

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2175041
2010-09-09 22:40:25 -07:00
Ian Lance Taylor
4427965ee4 test: Match gccgo error messages.
tmp.go:4:20: error: invalid NUL byte
tmp.go:6:24: error: invalid NUL byte
tmp.go:8:15: error: invalid NUL byte
tmp.go:10:21: error: invalid NUL byte
tmp.go:12:22: error: invalid NUL byte
tmp.go:14:21: error: invalid UTF-8 encoding
tmp.go:14:22: error: invalid UTF-8 encoding
tmp.go:16:25: error: invalid UTF-8 encoding
tmp.go:18:15: error: invalid UTF-8 encoding
tmp.go:18:16: error: invalid UTF-8 encoding
tmp.go:20:21: error: invalid UTF-8 encoding
tmp.go:20:22: error: invalid NUL byte
tmp.go:20:23: error: invalid NUL byte
tmp.go:23:6: error: invalid UTF-8 encoding
tmp.go:23:7: error: invalid UTF-8 encoding
tmp.go:25:22: error: invalid UTF-8 encoding

R=rsc
CC=golang-dev
https://golang.org/cl/2151046
2010-09-09 09:00:32 -07:00
Scott Lawrence
a0fc33a8ca test: remove slice syntax test
R=rsc
CC=golang-dev
https://golang.org/cl/2145043
2010-09-09 01:42:49 -04:00
Ian Lance Taylor
c23657e76e test: Match gccgo error messages.
named1.go:40:11: error: argument 1 has incompatible type (cannot use type bool as type Bool)
named1.go:41:11: error: argument 1 has incompatible type (cannot use type bool as type Bool)
named1.go:43:7: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:44:12: error: argument 4 has incompatible type (cannot use type Bool as type bool)
named1.go:46:4: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:48:11: error: argument 1 has incompatible type (cannot use type bool as type Bool)
named1.go:50:7: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:54:7: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:60:7: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:63:9: error: argument 1 has incompatible type (cannot use type bool as type Bool)
named1.go:64:4: error: incompatible types in assignment (cannot use type bool as type Bool)
named1.go:67:17: error: invalid type conversion (cannot use type Slice as type String)

R=rsc
CC=golang-dev
https://golang.org/cl/2146044
2010-09-08 21:03:51 -07:00
Ian Lance Taylor
2d8433a720 test: Match gccgo error messages.
explicit.go:36:4: error: incompatible types in assignment (need explicit conversion)
explicit.go:41:4: error: incompatible types in assignment (type has no methods)
explicit.go:42:4: error: incompatible types in assignment (need explicit conversion)
explicit.go:45:5: error: incompatible types in assignment (need explicit conversion; missing method ‘N’)
explicit.go:48:9: error: invalid type conversion (need explicit conversion; missing method ‘N’)
explicit.go:51:4: error: incompatible types in assignment
explicit.go:51:7: error: invalid type conversion (need explicit conversion)
explicit.go:57:10: error: impossible type assertion: type does not implement interface (type has no methods)
explicit.go:62:10: error: impossible type assertion: type does not implement interface (incompatible type for method ‘M’ (different number of parameters))
explicit.go:67:5: error: incompatible type in initialization (type has no methods)
explicit.go:68:5: error: incompatible type in initialization (incompatible type for method ‘M’ (different number of parameters))
explicit.go:70:11: error: invalid type conversion (type has no methods)
explicit.go:71:11: error: invalid type conversion (incompatible type for method ‘M’ (different number of parameters))

R=rsc
CC=golang-dev
https://golang.org/cl/2139044
2010-09-08 21:03:24 -07:00
Russ Cox
f4a5d733a5 test new slices
R=r
CC=golang-dev
https://golang.org/cl/2128047
2010-09-08 23:48:01 -04:00
Ian Lance Taylor
cc2157ed4f test: Recognize gccgo error messages.
bug299.go:16:2: error: expected field name
bug299.go:17:2: error: expected field name
bug299.go:18:3: error: expected field name
bug299.go:25:9: error: expected receiver name or type
bug299.go:26:10: error: expected receiver name or type
bug299.go:27:9: error: expected receiver name or type

R=rsc
CC=golang-dev
https://golang.org/cl/2150044
2010-09-08 13:58:09 -07:00
Ian Lance Taylor
2660161533 test: Match gccgo error messages.
bug298.go:10:2: error: expected declaration
bug298.go:10:25: error: expected ‘;’ or newline after top level declaration
bug298.go:10:25: error: expected declaration

R=rsc
CC=golang-dev
https://golang.org/cl/2156046
2010-09-08 13:57:12 -07:00
Ian Lance Taylor
ae2dc76335 test: Actually run bug296.
R=rsc
CC=golang-dev
https://golang.org/cl/2156045
2010-09-08 13:56:49 -07:00
Russ Cox
6f5f558c10 test/garbage/parser: sync with recent parser changes
R=gri
CC=golang-dev
https://golang.org/cl/2144042
2010-09-07 09:55:05 -04:00
Rob Pike
e430ee6cba test/turing: refactor
R=gri
CC=golang-dev
https://golang.org/cl/2116043
2010-09-04 10:40:00 +10:00
Rob Pike
4f61fc96b2 test: remove semiocolons.
The ken directory is untouched so we have some examples with explicit semis.

R=gri
CC=golang-dev
https://golang.org/cl/2157041
2010-09-04 10:36:13 +10:00
Robert Griesemer
e5cf760e8a solitaire: an exercise in backtracking and string conversions
Solves the (English) peg solitaire game. The board is represented
by a 1-dimensional array for easy representation of directions
with a single integer. The board's contents are chosen such that
it can be printed with a direct string() conversion.

R=r
CC=adg, golang-dev
https://golang.org/cl/2066042
2010-09-03 10:52:45 -07:00
Ian Lance Taylor
1331084c3d test: Match gccgo error messages.
bug284.go:33: error: invalid type conversion
bug284.go:36: error: invalid type conversion (cannot use type A2 as type A1)
bug284.go:37: error: invalid type conversion
bug284.go:38: error: invalid type conversion (cannot use type A1 as type A2)
bug284.go:56: error: invalid type conversion
bug284.go:59: error: invalid type conversion (cannot use type S2 as type S1)
bug284.go:60: error: invalid type conversion
bug284.go:61: error: invalid type conversion (cannot use type S1 as type S2)
bug284.go:71: error: invalid type conversion
bug284.go:74: error: invalid type conversion (cannot use type P2 as type P1)
bug284.go:75: error: invalid type conversion
bug284.go:76: error: invalid type conversion (cannot use type P1 as type P2)
bug284.go:96: error: invalid type conversion
bug284.go:99: error: invalid type conversion (cannot use type Q2 as type Q1)
bug284.go:101: error: invalid type conversion (cannot use type Q1 as type Q2)
bug284.go:111: error: invalid type conversion (different parameter types)
bug284.go:114: error: invalid type conversion (different parameter types)
bug284.go:115: error: invalid type conversion (different parameter types)
bug284.go:116: error: invalid type conversion (different parameter types)
bug284.go:134: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:137: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:138: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:139: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:149: error: invalid type conversion
bug284.go:152: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:153: error: invalid type conversion
bug284.go:154: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:164: error: invalid type conversion
bug284.go:167: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:168: error: invalid type conversion
bug284.go:169: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:179: error: invalid type conversion
bug284.go:182: error: invalid type conversion (cannot use type C2 as type C1)
bug284.go:183: error: invalid type conversion
bug284.go:184: error: invalid type conversion (cannot use type C1 as type C2)

R=rsc
CC=golang-dev
https://golang.org/cl/2136041
2010-09-01 21:05:31 -07:00
Ian Lance Taylor
c28525a137 test: Recognize gccgo error messages.
bug278.go:18: error: invalid left hand side of assignment
bug278.go:19: error: array is not addressable
bug278.go:21: error: invalid left hand side of assignment
bug278.go:22: error: invalid left hand side of assignment

R=rsc
CC=golang-dev
https://golang.org/cl/2122042
2010-09-01 21:04:57 -07:00
Ian Lance Taylor
426275d702 test: Use global variables to defeat gccgo optimizer.
The gccgo compiler is smart enough to not make something which
is not used.  Use global variables to defeat this
optimization.

R=rsc
CC=golang-dev
https://golang.org/cl/2129041
2010-09-01 13:40:20 -07:00
Ian Lance Taylor
9bd6b0afa4 test: Recognize gccgo error messages.
bug255.go:11: error: array bound truncated to integer
bug255.go:12: error: array bound is not numeric
bug255.go:13: error: array bound is not numeric
bug255.go:14: error: array bound is not constant
bug255.go:15: error: array bound overflows

R=rsc
CC=golang-dev
https://golang.org/cl/2091042
2010-08-31 17:38:11 -07:00
Ian Lance Taylor
7a05b0f235 test: Match gccgo error messages.
Another case where gccgo and gc report similar but not
identical errors for a recursive interface.

bug251.go:11: error: invalid recursive interface

R=rsc
CC=golang-dev
https://golang.org/cl/2094041
2010-08-31 15:48:04 -07:00
Ian Lance Taylor
09977734cd test: gccgo and gc print the error on different lines.
This introduces GC_ERROR to mark an error only issued by the
gc compiler.  GCCGO_ERROR already exists to mark errors only
issued by the gccgo compiler.  Obviously these should be used
sparingly.

bug195.go:9: error: interface contains embedded non-interface
bug195.go:12: error: interface contains embedded non-interface
bug195.go:15: error: interface contains embedded non-interface
bug195.go:18: error: invalid recursive interface
bug195.go:22: error: invalid recursive interface

R=rsc
CC=golang-dev
https://golang.org/cl/2040043
2010-08-31 14:12:23 -07:00
Ian Lance Taylor
472cd3af12 test: Match gccgo error messages.
gcc conventionally does not upper case in error messages.

char_lit1.go:13: error: invalid unicode code point 0xd800
char_lit1.go:14: error: invalid unicode code point 0xd999
char_lit1.go:15: error: invalid unicode code point 0xdc01
char_lit1.go:16: error: invalid unicode code point 0xdddd
char_lit1.go:17: error: invalid unicode code point 0xdfff
char_lit1.go:20: error: invalid unicode code point 0x110000
char_lit1.go:22: error: invalid unicode code point 0x110000
char_lit1.go:23: error: invalid unicode code point 0xffffffff

R=rsc
CC=golang-dev
https://golang.org/cl/2040042
2010-08-31 11:43:52 -07:00
Ian Lance Taylor
5309fae1a3 test: don't assign address of array to slice.
R=rsc
CC=golang-dev
https://golang.org/cl/2084042
2010-08-31 07:34:01 -07:00
Christian Himpel
5c603dbb75 build: remove unnecessary references to GOBIN and GOROOT
All scripts and makefiles assume that GOBIN is correctly set
in PATH.

R=rsc
CC=golang-dev
https://golang.org/cl/2043041
2010-08-30 15:40:56 -04:00
Ian Lance Taylor
58a25c6de7 test: Add testcase which crashes gccgo.
R=rsc
CC=golang-dev
https://golang.org/cl/1995050
2010-08-24 13:08:05 -07:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Russ Cox
735356ca9a test/garbage: do not try to parse package bignum, which is gone.
Fixes #1023.

R=gri
CC=golang-dev
https://golang.org/cl/1968043
2010-08-16 13:31:31 -07:00
Rob Pike
a621a7ef74 delete pkg/once
R=rsc
CC=golang-dev
https://golang.org/cl/1995041
2010-08-13 12:53:27 +10:00
Rob Pike
d31ee536e8 update the tree to use the new regexp methods
R=rsc
CC=golang-dev
https://golang.org/cl/1983043
2010-08-12 16:48:41 +10:00
Russ Cox
1d77ff5b6b 6g, 8g: handle slice by sub-word-sized index (uint8, int8, uint16, int16)
R=ken2
CC=golang-dev
https://golang.org/cl/1960042
2010-08-11 22:27:47 -07:00
Russ Cox
26dde76cee gopack: handle long lines in export data
Also, if the header is bad, exit with a non-zero status.

Other calls to Brdline in the tree, by category:

Reading symbol name from object file:
./cmd/5l/obj.c:486: 		name = Brdline(f, '\0');
./cmd/6l/obj.c:535: 		name = Brdline(f, '\0');
./cmd/8l/obj.c:564: 		name = Brdline(f, '\0');
./libmach/sym.c:292: 		cp = Brdline(bp, '\0');

Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: 	if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: 	if((p = Brdline(b, '\n')) == nil)

Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: 	line = Brdline(f, '\n');

Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: 	while((l = Brdline(b, '\n')) != nil){

Implementing Brdstr:
./libbio/brdstr.c:36: 		p = Brdline(bp, delim);

The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long.  This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.

R=r
CC=golang-dev
https://golang.org/cl/1982041
2010-08-11 22:17:20 -07:00
Russ Cox
a9a62eef6b gc: bug302
Fixed by http://code.google.com/p/go/source/detail?r=d1f41e20a90e
This just adds a test and checks the return value of Bprint.

R=ken2
CC=golang-dev
https://golang.org/cl/1949042
2010-08-10 17:39:38 -07:00
Kai Backman
df88fc6109 arm: bugfixes and syscall
- integer divide by zero raises panic
- float comparisons involving NaNs work
- syscall interface actually handles return
  values and errno correctly.

R=rsc, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/1847047
2010-08-06 16:57:49 -07:00
Robert Griesemer
1dd8840800 test/peano: use directly recursive type def
Test case for http://code.google.com/p/go/issues/detail?id=999

R=r
CC=golang-dev
https://golang.org/cl/1892050
2010-08-06 15:07:54 -07:00
Kai Backman
d0b913fe37 bikeshed: only output bug when we have a regression
R=rsc
CC=golang-dev
https://golang.org/cl/1897046
2010-08-03 13:09:16 -07:00
Russ Cox
d4af41f5bb test/run: diff old new
R=r, iant
CC=golang-dev
https://golang.org/cl/1907046
2010-08-03 13:01:28 -07:00
Russ Cox
3f19d8ae8d gc: empty select
R=ken2
CC=golang-dev
https://golang.org/cl/1871057
2010-08-03 01:07:57 -07:00
Russ Cox
585eae3bce gc: bug301
Fixes #990.

R=ken2
CC=golang-dev
https://golang.org/cl/1742055
2010-08-03 01:07:40 -07:00
Russ Cox
c6cb303a8a gc: bug299, bug300
R=ken2
CC=golang-dev
https://golang.org/cl/1731057
2010-08-03 00:53:32 -07:00
Russ Cox
9bac9d23d3 gc: index bounds tests and fixes
move constant index checking to front end
x[2:1] is a compile-time error now too

R=ken2
CC=golang-dev
https://golang.org/cl/1848056
2010-08-03 00:26:02 -07:00
Kai Backman
a0368180a7 arm: disable another flaky test.
these tests work fine on n1 and gumstix. it's unclear
why they keep failing on the godashboard build.

R=rsc
CC=golang-dev
https://golang.org/cl/1664056
2010-07-30 12:33:40 +03:00
Kai Backman
c44f95ff48 fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1913042
2010-07-30 10:53:26 +03:00
Kai Backman
8d76a15122 arm: bugfixes (stack clobbering, indices)
also changed zerodivide to output "BUG"

R=rsc
CC=golang-dev
https://golang.org/cl/1871055
2010-07-30 10:37:51 +03:00
Robert Griesemer
500425ac7b bug300: literal types must not be parenthesized
( This CL is dependent on acceptance of
https://golang.org/cl/1913041/show )

R=go-dev
CC=golang-dev
https://golang.org/cl/1860045
2010-07-29 18:14:49 -07:00
Robert Griesemer
07cc6440dc go_spec: don't allow parens around the literal type of composite literals
Background: The current spec is imprecise with respect to the parsing ambiguity
for composite literals: It says that the ambiguity arises when the TypeName form
of the LiteralType is used. The following code:

    if (B) {} ...

is not using the TypeName form (but the parenthesized TypeName form) and thus
could be interpreted as:

    if ((B){}) ...

instead of

    if B {} ...

Both compilers and gofmt choose the latter interpretation. One could fix the
spec by making the clause regarding the parsing ambiguity more precise ("...using
the _possibly parenthesized_ TypeName form of the LiteralType..."). The alternative
(chosen here) is to simply disallow parenthesized literal types. Except for a single
test case (test/parentype.go) there appears to be no Go code under $GOROOT containing
parenthesized literal types. Furthermore, parentheses are never needed around a
literal type for correct parsing.

R=golang-dev
CC=golang-dev
https://golang.org/cl/1913041
2010-07-29 18:13:41 -07:00
Robert Griesemer
7734ad5179 bug299: parenthesized receiver types/anonymous fields are illegal
R=r
CC=golang-dev
https://golang.org/cl/1846051
2010-07-29 10:54:03 -07:00
Vinu Rajashekhar
1ea5d15407 test/sigchld.go: use syscall.Kill instead of a combination
of syscall.Syscall and syscall.SYS_KILL.

In RTEMS, there is no syscall.Syscall support, but it does
support POSIX signals. So, if this testcase is changed to use
syscall.Kill, then it would run fine on RTEMS, when using gccgo.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/1863046
2010-07-28 18:26:29 -07:00
Kai Backman
c6e4697141 arm: fix build (dodgy floats)
R=rsc
CC=golang-dev
https://golang.org/cl/1907041
2010-07-28 16:33:52 +03:00
Kai Backman
fa4da33315 arm: minor bugfixes.
R=rsc
CC=golang-dev
https://golang.org/cl/1692057
2010-07-28 15:58:35 +03:00
Russ Cox
f20c2e1cf5 gc: more crash avoidance
Fixes #961.
Fixes #962.

R=ken2
CC=golang-dev
https://golang.org/cl/1903043
2010-07-26 17:34:17 -07:00
Russ Cox
607eaea456 gc: fix smaller-than-pointer-sized receivers in interfaces
Fixes #812.

R=ken2
CC=golang-dev
https://golang.org/cl/1904041
2010-07-26 15:25:10 -07:00
Russ Cox
7b240e8135 gc: import dot shadowing bug
R=ken2
CC=golang-dev
https://golang.org/cl/1873047
2010-07-26 14:21:39 -07:00
Russ Cox
0a9a3c128f test: fail is for bad exit status only
R=kaib
CC=golang-dev
https://golang.org/cl/1847043
2010-07-22 08:54:32 -07:00
Kai Backman
8975d36412 arm: fic build3, disable flaky 64 bit test
R=rsc
CC=golang-dev
https://golang.org/cl/1888041
2010-07-21 15:59:11 +03:00
Kai Backman
b7aa561473 arm: fix build2, tweak test/nul1.go arm exclusion
R=rsc
CC=golang-dev
https://golang.org/cl/1866044
2010-07-21 14:51:03 +03:00
Kai Backman
47b6400556 arm: fix build by disabling list copying optimization for 5g.
R=rsc
CC=golang-dev
https://golang.org/cl/1697053
2010-07-21 14:14:21 +03:00
Kai Backman
199e17ba1f fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1742048
2010-07-20 16:20:35 +03:00
Kai Backman
36057e721e more soft float support. passes several basic tests
but with less precision than hardware counterparts.

fixed a number of tests to output BUG when they failed.
changed the runner to distinghuish between output
and output containing ^BUG

R=rsc
CC=dho, golang-dev
https://golang.org/cl/1778041
2010-07-20 15:53:16 +03:00
Russ Cox
4c0de303ce gc: bug294
Fixes #800.

R=ken2
CC=golang-dev
https://golang.org/cl/1855043
2010-07-15 16:42:32 -07:00
Russ Cox
ece6a8c549 gc: bug293
Fixes #846.

R=ken2
CC=golang-dev
https://golang.org/cl/1862042
2010-07-15 16:14:06 -07:00
Russ Cox
cdb446feb5 gc: bug292
Fixes #843.

R=ken2
CC=golang-dev
https://golang.org/cl/1729051
2010-07-15 16:13:47 -07:00
Russ Cox
08a263a991 gc: bug291
Fixes #915.

R=ken2
CC=golang-dev
https://golang.org/cl/1856042
2010-07-15 15:17:42 -07:00
Russ Cox
691d765121 gc: bug274
R=ken2
CC=golang-dev
https://golang.org/cl/1742044
2010-07-15 15:05:56 -07:00
Russ Cox
17f90c68c6 gc: fix handling of types inside function bodies
Fixes #849.
Fixes #920.

R=ken2
CC=golang-dev
https://golang.org/cl/1841042
2010-07-15 14:25:50 -07:00
Robert Griesemer
47b835e4a8 channel tests: added a couple of tests with closed channels
R=rsc
CC=golang-dev
https://golang.org/cl/1774047
2010-07-14 13:18:57 -07:00
Robert Griesemer
d00b479888 select statement: initial set of test cases for corner cases
R=r, rsc
CC=golang-dev
https://golang.org/cl/1772043
2010-07-14 09:55:08 -07:00
Robert Griesemer
bebd22f8e0 fix build
R=rsc
CC=golang-dev
https://golang.org/cl/1815042
2010-07-12 14:53:28 -07:00
Vinu Rajashekhar
89192ce4fe test/fixedbugs/bug243.go: instead of closing stdout,
remove the print statements.

This change is because of the port of gccgo to RTEMS.
These tests use the GCC DejaGNU framework. In some cases,
the tests need to be run on qemu where the status code
cannot be sent back to DejaGNU, so it prints the exit status
by putting a wrapper around the exit and abort calls.

This testcase closes the stdout, and hence prohibits DejaGNU
from knowing the status in such cases, and causes this test
to be wrongly declared as a failure.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/1792042
2010-07-12 13:17:32 -07:00
Ian Lance Taylor
e03a50dd11 Test case that gccgo fails (crashes rather than printing error).
R=rsc
CC=Raj_, golang-dev
https://golang.org/cl/1740044
2010-07-12 06:34:36 -07:00
Russ Cox
81c3e8cabc gc: implement new len spec, range bug fix, optimization
Fixes #885.

R=ken2
CC=golang-dev
https://golang.org/cl/1680048
2010-07-01 18:04:25 -07:00
Russ Cox
47c85ec97a test: override gcc bug when preparing complex divide tables
R=iant
CC=golang-dev
https://golang.org/cl/1666048
2010-06-30 23:34:27 -07:00
Russ Cox
7c9ed7946c 8g: out of register bug fix
Fixes #868.

R=ken2
CC=golang-dev
https://golang.org/cl/1695049
2010-06-30 20:45:50 -07:00
Russ Cox
6d8b8101ea gc: fix crash for nested complex division
R=ken2
CC=golang-dev
https://golang.org/cl/1720043
2010-06-23 10:55:50 -04:00
Russ Cox
8bd99ebff5 test: another listen on ":0" -> "127.0.0.1:0"
R=r
CC=golang-dev
https://golang.org/cl/1664043
2010-06-21 16:34:55 -07:00
Russ Cox
fc090a3a54 reflect: add Type.Bits method, add tags to prohibit conversions
gob: substitute slice for map

R=r
CC=golang-dev
https://golang.org/cl/1699045
2010-06-21 13:19:29 -07:00
Russ Cox
1b79cd2e71 undo changes accidentally included in 09c5add99d50
R=ken2
CC=golang-dev
https://golang.org/cl/1736042
2010-06-20 12:45:39 -07:00
Russ Cox
37c531f51f errchk: fix build - allow matches in multiline error messages
TBR=r
CC=golang-dev
https://golang.org/cl/1734042
2010-06-20 12:05:43 -07:00
Russ Cox
a212d174ac gc: better error messages for interface failures, conversions
x.go:13: cannot use t (type T) as type Reader in assignment:
	T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
	Q does not implement Reader (missing Read method)
		have read()
		want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
	int does not implement Reader (missing Read method)

x.go:24: too many arguments to conversion to complex: complex(1, 3)

R=ken2
CC=golang-dev
https://golang.org/cl/1736041
2010-06-20 11:45:53 -07:00
Christopher Wedgwood
34cc011276 test: add missing import for zerodivide
R=rsc
CC=golang-dev, r
https://golang.org/cl/1706043
2010-06-18 22:42:48 -07:00
Russ Cox
21ff75bc0e complex divide: match C99 implementation
R=iant, ken2, r, r2, ken3
CC=golang-dev
https://golang.org/cl/1686044
2010-06-18 15:46:00 -07:00
Russ Cox
c9172fb2a3 runtime: correct fault for 16-bit divide on Leopard
R=r
CC=golang-dev
https://golang.org/cl/1703041
2010-06-14 18:07:17 -07:00
Rob Pike
d482c163be fmt.Print*: reimplement to switch on type first.
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.

One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:

	1) width is honored for String() items
	2) %x works for String() items
	3) implementations of String that merely recur will recur forever

Regarding point 3, example from the updated documentation:
	type X int
	func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
	func (x X) String() string { return Sprintf("%d", int(x)) }

R=rsc
CC=golang-dev
https://golang.org/cl/1613045
2010-06-14 17:16:35 -07:00
Rob Pike
dee4db0691 Add test for division by zero.
It fails with 6g. Once 6g is fixed up I will extend the value tests.

R=rsc, iant
CC=golang-dev
https://golang.org/cl/1677043
2010-06-14 15:00:19 -07:00
Russ Cox
6672b40c09 remove uses of ... from tree, add one test
R=r
CC=golang-dev
https://golang.org/cl/1662041
2010-06-14 11:23:11 -07:00
Russ Cox
76da2780c3 gc: less aggressive name binding, for better line numbers in errors
Cleans up a few other corner cases too.

R=ken2
CC=golang-dev
https://golang.org/cl/1592045
2010-06-12 11:17:24 -07:00
Russ Cox
6cd8537fd1 test: check that surrogate pair runes and huge rune values are rejected
R=r
CC=golang-dev
https://golang.org/cl/1615042
2010-06-10 13:30:39 -07:00
Robert Griesemer
fb279e7347 bug286: test case
R=r
CC=golang-dev
https://golang.org/cl/1644042
2010-06-09 16:05:00 -07:00
Russ Cox
a2a7d473f4 gc: more cleanup
* disallow surrogate pair runes.
 * diagnose impossible type assertions
 * eliminate another static buffer.
 * do not overflow lexbuf.
 * add -u flag to disable package unsafe.

R=ken2
CC=golang-dev
https://golang.org/cl/1619042
2010-06-09 11:00:55 -07:00
Russ Cox
42a691b877 fix build: invalid character literals
R=r
CC=golang-dev
https://golang.org/cl/1631041
2010-06-08 22:32:04 -07:00
Russ Cox
565b5dc076 gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
2010-06-08 18:50:02 -07:00
Russ Cox
6aaef04469 misc cleanup: gofmt + &x -> x[0:] conversion
R=gri
CC=golang-dev
https://golang.org/cl/1620042
2010-06-08 17:51:57 -07:00
Russ Cox
f892540513 fix build
R=gri
CC=golang-dev
https://golang.org/cl/1616041
2010-06-08 16:14:19 -07:00
Russ Cox
57a62a8bcb bug284: make conversion legal, fix error patterns
R=gri
CC=golang-dev
https://golang.org/cl/1612041
2010-06-08 15:51:31 -07:00
Russ Cox
2ec58f73e3 bug285: delete invalid map assignment
*T2 implements I2, but T2 does not.

R=gri
CC=golang-dev
https://golang.org/cl/1613041
2010-06-08 15:50:53 -07:00
Kyle Consalus
47bc1f2e4b Added regex-dna-parallel.go, a pretty trivial parallelization.
R=rsc, r
CC=golang-dev
https://golang.org/cl/972046
2010-06-03 16:20:54 -07:00
Robert Griesemer
86c9aca41e bug285: assignment compatible map keys must be accepted
R=r
CC=golang-dev
https://golang.org/cl/1473042
2010-06-03 14:58:00 -07:00