From e5373f27d0f4995eb34d85dc11be8600a80b7e76 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 17 Jun 2008 16:04:33 -0700 Subject: [PATCH] - added 2 bug tests SVN=123220 --- test/bugs/bug051.go | 15 +++++++++++++++ test/bugs/bug052.go | 20 ++++++++++++++++++++ test/golden.out | 24 ++++++++++++++++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 test/bugs/bug051.go create mode 100644 test/bugs/bug052.go diff --git a/test/bugs/bug051.go b/test/bugs/bug051.go new file mode 100644 index 0000000000..c5b960602b --- /dev/null +++ b/test/bugs/bug051.go @@ -0,0 +1,15 @@ +// 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 f() int { + return 0; +} + +func main() { + const n = f(); // should report only one error +} diff --git a/test/bugs/bug052.go b/test/bugs/bug052.go new file mode 100644 index 0000000000..07c651d4ac --- /dev/null +++ b/test/bugs/bug052.go @@ -0,0 +1,20 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// 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() { + c := 10; + d := 7; + var x [10]int; + i := 0; + /* this works: + q := c/d; + x[i] = q; + */ + // this doesn't: + x[i] = c/d; // BUG segmentation fault +} diff --git a/test/golden.out b/test/golden.out index c2728e6d1c..631a74762b 100644 --- a/test/golden.out +++ b/test/golden.out @@ -47,10 +47,10 @@ test0.go:49: illegal types for operand: AS (FLOAT32) (INT32) test0.go:50: error in shape across assignment -test0.go:55: illegal types for operand: CALLMETH +test0.go:47: illegal types for operand: CALLMETH (*{}) ({INT32;INT32;120({},{}){};101({},{}){};}) -test0.go:54: illegal types for operand: AS +test0.go:47: illegal types for operand: AS ({INT32;INT32;120({},{}){};101({},{}){};}) ({}) BUG: known to fail incorrectly @@ -139,7 +139,6 @@ BUG: known to succeed incorrectly =========== bugs/bug022.go bugs/bug022.go:8: illegal types for operand: INDEXPTR (**STRING) - (INT32) BUG: known to fail incorrectly =========== bugs/bug023.go @@ -210,7 +209,7 @@ BUG: compilation should succeed =========== bugs/bug043.go bugs/bug043.go:14: error in shape across assignment -bugs/bug043.go:17: error in shape across assignment +bugs/bug043.go:14: error in shape across assignment BUG: compilation should succeed =========== bugs/bug044.go @@ -251,6 +250,23 @@ bugs/bug050.go:3: package statement must be first sys.6:1 bugs/bug050.go:2: syntax error BUG: segfault +=========== bugs/bug051.go +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: expression must be a constant +bugs/bug051.go:10: fatal error: too many errors +BUG: infinite loop in error reporting + +=========== bugs/bug052.go +BUG: incorrect code for division + =========== fixedbugs/bug000.go =========== fixedbugs/bug001.go -- 2.48.1