Skip to content

Commit

Permalink
fix some broken tests (tests themselves were wrong)
Browse files Browse the repository at this point in the history
R=gri,rsc
OCL=15310
CL=15402
  • Loading branch information
robpike committed Sep 16, 2008
1 parent c3b397b commit 85f8d45
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 29 deletions.
12 changes: 10 additions & 2 deletions test/235.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ func min(xs *[]uint64) uint64 {
func main() {
F := []uint64{2, 3, 5};
const n = len(F);
OUT := []uint64{
2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36,
40, 45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100, 108, 120, 125,
128, 135, 144, 150, 160, 162, 180, 192, 200, 216, 225, 240, 243, 250,
256, 270, 288, 300, 320, 324, 360, 375, 384, 400, 405, 432, 450, 480,
486, 500, 512, 540, 576, 600, 625, 640, 648, 675, 720, 729, 750, 768,
800, 810, 864, 900, 960, 972, 1000, 1024, 1080, 1125, 1152, 1200, 1215,
1250, 1280, 1296, 1350, 1440, 1458, 1500, 1536, 1600 };

x := uint64(1);
ins := new([]*T, n);
Expand All @@ -44,7 +52,7 @@ func main() {
xs[i] = x;
}

for i := 0; i < 100; i++ {
for i := 0; i < len(OUT); i++ {
t := min(xs);
for i := 0; i < n; i++ {
ins[i] -< x;
Expand All @@ -55,7 +63,7 @@ func main() {
}

x = min(xs);
print(x, "\n");
if x != OUT[i] { panic("bad: ", x, " should be ", OUT[i]); }
}
sys.exit(0);
}
File renamed without changes.
106 changes: 79 additions & 27 deletions test/golden.out
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@

=========== ./bufiolib.go
throw: index out of range
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x11c43

0x11c43?zi
throw(98060, 0, 235528, ...)
throw(0x17f0c, 0x39808, 0x5e2e, ...)
0x11b97?zi
sys·throwindex(235528, 0, 0, ...)
sys·throwindex(0x39808, 0x0, 0x1, ...)
0x5e2e?zi
bufio·BufRead_ReadLineString(235312, 0, 65546, ...)
bufio·BufRead_ReadLineString(0x39730, 0x1000a, 0x39758, ...)
0x1cb8?zi
main·ReadLines(235312, 0, 235304, ...)
main·ReadLines(0x39730, 0x39728, 0x1, ...)
0x2bb5?zi
main·TestBufRead(85470, 0, 1, ...)
main·TestBufRead(0x14dde, 0x1, 0x7fff5fbff268, ...)
0x3830?zi
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)


=========== ./func1.go
func1.go:12: var a redeclared in this block
previous declaration at func1.go:12

=========== ./helloworld.go
hello, world

=========== ./map.go
skipping increment test until bug060 is fixed

=========== ./peano.go
0! = 1
1! = 1
Expand Down Expand Up @@ -59,7 +88,7 @@ bugs/bug020.go:7: type of a structure field cannot be an open array
BUG should compile

=========== bugs/bug026.go
sys·printstring: main·sigs_I: not defined
sys·printstring: main·sigi_I: not defined
BUG: known to fail incorrectly

=========== bugs/bug032.go
Expand All @@ -70,6 +99,8 @@ BUG: compilation succeeds incorrectly

=========== bugs/bug060.go
map does not increment
BUG: map increment

=========== bugs/bug064.go
bugs/bug064.go:15: illegal types for operand: CALL
(<int32>INT32)
Expand All @@ -81,11 +112,6 @@ bugs/bug074.go:6: syntax error
bugs/bug074.go:7: x: undefined
BUG: compiler crashes - Bus error

=========== bugs/bug075.go
bugs/bug075.go:11: bad shape across assignment - cr=1 cl=2

BUG: known to fail incorrectly

=========== bugs/bug077.go
BUG: known to succeed incorrectly

Expand Down Expand Up @@ -125,52 +151,78 @@ BUG: compilation succeeds incorrectly
throw: ifaces2i: nil pointer
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x1b7d

0x1b7d?zi
throw(30409, 0, 0, ...)
throw(0x76c9, 0x0, 0x0, ...)
0x207f?zi
sys·ifaces2i(31440, 0, 31480, ...)
sys·ifaces2i(0x7ad0, 0x7af8, 0x0, ...)
pc: 0x1c11

0x1c11?zi
throw(30465, 0, 0, ...)
throw(0x7701, 0x0, 0x0, ...)
0x2113?zi
sys·ifaces2i(31496, 0, 31536, ...)
sys·ifaces2i(0x7b08, 0x7b30, 0x0, ...)
0x136f?zi
main·main(1, 0, 1606416392, ...)
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)

BUG: fails incorrectly

=========== bugs/bug094.go
bugs/bug094.go:11: left side of := must be a name
bad top
. LITERAL-I0 l(343)
. LITERAL-I0 l(353)
bugs/bug094.go:11: fatal error: walktype: top=3 LITERAL
BUG: fails incorrectly

=========== bugs/bug095.go
found 2, expected 1

panic on line 342 PC=0x139e
panic on line 352 PC=0x139e
0x139e?zi
main·main(1, 0, 1606416392, ...)
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)
BUG wrong result
Trace/BPT trap ./$A.out

=========== bugs/bug097.go

panic on line 344 PC=0x13c2
0x13c2?zi
main·main(1, 0, 1606416392, ...)
main·main(0x1, 0x7fff5fbff808, 0x0, ...)
panic on line 354 PC=0x13bc
0x13bc?zi
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)
BUG wrong result
Trace/BPT trap ./$A.out

=========== bugs/bug098.go
bugs/bug098.go:10: illegal types for operand: AS
(*MAP[<int32>INT32]<int32>INT32)
(**MAP[<int32>INT32]<int32>INT32)
BUG should compile

=========== bugs/bug099.go
done1
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x0

0x0?zi
panic(5070, 0, 45192, ...)
panic(0x13ce, 0xb088, 0xb088, ...)


=========== bugs/bug102.go
throw: index out of range
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0x2615

0x2615?zi
throw(31052, 0, 0, ...)
throw(0x794c, 0x0, 0x1315, ...)
0x2569?zi
sys·throwindex(45096, 0, 0, ...)
sys·throwindex(0xb028, 0x0, 0x0, ...)
0x1315?zi
main·main(1, 0, 1606414952, ...)
main·main(0x1, 0x7fff5fbff268, 0x0, ...)


=========== fixedbugs/bug015.go
fixedbugs/bug015.go:7: overflow converting constant to <int64>INT64

Expand Down Expand Up @@ -205,7 +257,7 @@ fixedbugs/bug035.go:7: var f redeclared in this block

=========== fixedbugs/bug037.go
fixedbugs/bug037.go:6: vlong: undefined
fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(338) t=<T> nil
fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(348) t=<T> nil

=========== fixedbugs/bug039.go
fixedbugs/bug039.go:6: var x redeclared in this block
Expand Down

0 comments on commit 85f8d45

Please sign in to comment.