From bce1c3f09ad59ad5d1f44f0498ef54bb18cc9850 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 18 Jul 2008 12:26:48 -0700 Subject: [PATCH] - added 2 bugs tests SVN=128056 --- test/bugs/bug072.go | 11 +++++++++++ test/bugs/bug073.go | 14 ++++++++++++++ test/{bugs => fixedbugs}/bug071.go | 0 test/golden.out | 22 ++++++++-------------- 4 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 test/bugs/bug072.go create mode 100644 test/bugs/bug073.go rename test/{bugs => fixedbugs}/bug071.go (100%) diff --git a/test/bugs/bug072.go b/test/bugs/bug072.go new file mode 100644 index 00000000000..f7117905707 --- /dev/null +++ b/test/bugs/bug072.go @@ -0,0 +1,11 @@ +// errchk $G $D/$F.go + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + s := string(bug); // crash +} diff --git a/test/bugs/bug073.go b/test/bugs/bug073.go new file mode 100644 index 00000000000..e7a084306e5 --- /dev/null +++ b/test/bugs/bug073.go @@ -0,0 +1,14 @@ +// errchk $G $D/$F.go + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + var s int = 0; + var x int = 0; + x = x << s; // should complain that s is not a uint + x = x >> s; // should complain that s is not a uint +} diff --git a/test/bugs/bug071.go b/test/fixedbugs/bug071.go similarity index 100% rename from test/bugs/bug071.go rename to test/fixedbugs/bug071.go diff --git a/test/golden.out b/test/golden.out index 37d76cdcae7..746175239f2 100644 --- a/test/golden.out +++ b/test/golden.out @@ -192,15 +192,6 @@ enqueue: main·.stringo: not defined BUG: link failure =========== bugs/bug052.go -SIGSEGV: segmentation violation -Faulting address: 0x1 -pc: 0x1346 - -0x1346?zi - main·main(1, 0, 1606414968, ...) - main·main(0x1, 0x7fff5fbff278, 0x0, ...) - -BUG: incorrect code for division =========== bugs/bug053.go bugs/bug053.go:6: syntax error @@ -249,7 +240,6 @@ bugs/bug064.go:15: illegal types for operand: CALL BUG: compilation should succeed =========== bugs/bug066.go -BUG: compilation should succeed =========== bugs/bug067.go @@ -265,12 +255,14 @@ outer loop top k 1 k not zero panic on line 271 PC=0x1362 0x1362?zi - main·main(1, 0, 1606414960, ...) - main·main(0x1, 0x7fff5fbff270, 0x0, ...) + main·main(1, 0, 1606416424, ...) + main·main(0x1, 0x7fff5fbff828, 0x0, ...) BUG: crashes -=========== bugs/bug071.go -BUG: compiler crashes +=========== bugs/bug072.go + +=========== bugs/bug073.go +BUG: should not compile =========== fixedbugs/bug000.go @@ -364,3 +356,5 @@ fixedbugs/bug051.go:10: expression must be a constant =========== fixedbugs/bug065.go =========== fixedbugs/bug069.go + +=========== fixedbugs/bug071.go