From patchwork Mon Jun 14 06:27:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [gccgo] Update gcc testsuite for change to panic From: Ian Taylor X-Patchwork-Id: 55477 Message-Id: To: gcc-patches@gcc.gnu.org Date: Sun, 13 Jun 2010 23:27:41 -0700 The panic function now always takes a single argument. This patch updates the gcc testsuite to use it that way. Committed to gccgo branch. Ian Index: execute/array-1.go =================================================================== --- execute/array-1.go (revision 155628) +++ execute/array-1.go (working copy) @@ -6,5 +6,5 @@ func fn() { } func main() { fn(); - if a[0] != a[1] { panic() } + if a[0] != a[1] { panic(0) } } Index: execute/pointer-1.go =================================================================== --- execute/pointer-1.go (revision 155628) +++ execute/pointer-1.go (working copy) @@ -3,5 +3,5 @@ package main func main() { p := new(int); *p = 0; - if *p != 0 { panic() } + if *p != 0 { panic(0) } } Index: execute/method-1.go =================================================================== --- execute/method-1.go (revision 155628) +++ execute/method-1.go (working copy) @@ -3,5 +3,5 @@ type s struct { i int }; func (v *s) val() int { return v.i } func main() { p := new(s); - if p.val() != 0 { panic() } + if p.val() != 0 { panic(0) } } Index: execute/return-3.go =================================================================== --- execute/return-3.go (revision 155628) +++ execute/return-3.go (working copy) @@ -12,5 +12,5 @@ func main() { } else { ret = 1; } - if ret != 0 { panic() } + if ret != 0 { panic(0) } } Index: execute/nested-1.go =================================================================== --- execute/nested-1.go (revision 155628) +++ execute/nested-1.go (working copy) @@ -1,4 +1,4 @@ package main func main() { - if func (i int) int { return i} (0) != 0 { panic() } + if func (i int) int { return i} (0) != 0 { panic(0) } } Index: execute/struct-2.go =================================================================== --- execute/struct-2.go (revision 155628) +++ execute/struct-2.go (working copy) @@ -3,5 +3,5 @@ package main func main() { type s struct { x int; y int; }; var ret s = s{1, 2}; - if ret.y - (ret.x + ret.x) != 0 { panic() } + if ret.y - (ret.x + ret.x) != 0 { panic(0) } } Index: execute/function-2.go =================================================================== --- execute/function-2.go (revision 155628) +++ execute/function-2.go (working copy) @@ -5,5 +5,5 @@ func subr(p int) int { } func main() { - if subr(0) != 0 { panic() } + if subr(0) != 0 { panic(0) } } Index: execute/const-2.go =================================================================== --- execute/const-2.go (revision 155628) +++ execute/const-2.go (working copy) @@ -3,5 +3,5 @@ package main const c = 3; func main() { - if c != 3 { panic() } + if c != 3 { panic(0) } } Index: execute/for-2.go =================================================================== --- execute/for-2.go (revision 155628) +++ execute/for-2.go (working copy) @@ -9,7 +9,7 @@ func f1() { j = i; } if (j != 2) { - panic(); + panic(0); } } @@ -18,7 +18,7 @@ func f2() { if i >= 0 { continue; } - panic(); + panic(1); } } @@ -30,7 +30,7 @@ func f3() { break lab1; } } - panic(); + panic(2); } } @@ -40,7 +40,7 @@ func f4() { for j := 0; j < 10; j++ { continue lab1; } - panic(); + panic(3); } } Index: execute/var-2.go =================================================================== --- execute/var-2.go (revision 155628) +++ execute/var-2.go (working copy) @@ -2,5 +2,5 @@ package main func main() { var ret int; - if ret != 0 { panic() } + if ret != 0 { panic(0) } } Index: execute/switch-1.go =================================================================== --- execute/switch-1.go (revision 156187) +++ execute/switch-1.go (working copy) @@ -17,7 +17,7 @@ func f2(i int) int { default: return 0 case i != 0: return 1000 } - panic() + panic(0) } func f3(i int) int { @@ -37,32 +37,32 @@ func f3(i int) int { func main() { if !f1(1) { - panic(); + panic(1); } if f1(2) { - panic(); + panic(2); } if !f1(3) { - panic(); + panic(3); } if !f1(4) { - panic(); + panic(4); } if f1(5) { - panic(); + panic(5); } if f2(-100) != -1 { - panic(); + panic(6); } if f2(1000) != 1 { - panic(); + panic(7); } if f2(0) != 0 { - panic(); + panic(8); } if f3(1) != 1 || f3(2) != 2 || f3(3) != 1 || f3(4) != 4 { - panic(); + panic(9); } } Index: execute/go-1.go =================================================================== --- execute/go-1.go (revision 155628) +++ execute/go-1.go (working copy) @@ -7,5 +7,5 @@ func send_one(c chan <- int) { func main() { c := make(chan int); go send_one(c); - if <-c != 0 { panic() } + if <-c != 0 { panic(0) } } Index: execute/string-2.go =================================================================== --- execute/string-2.go (revision 155628) +++ execute/string-2.go (working copy) @@ -2,7 +2,7 @@ package main func fn(s string) string { if len(s) != 3 { - panic() + panic(0) } i := len(s) - 1; return s + s[0 : i]; @@ -11,6 +11,6 @@ func fn(s string) string { func main() { s := fn("abc"); if s != "abcab" { - panic() + panic(1) } } Index: execute/go-3.go =================================================================== --- execute/go-3.go (revision 155628) +++ execute/go-3.go (working copy) @@ -10,5 +10,5 @@ func main() { var i I = &s; c := make(chan int); go i.send(c); - if <- c != 0 { panic() } + if <- c != 0 { panic(0) } } Index: execute/goto-1.go =================================================================== --- execute/goto-1.go (revision 155628) +++ execute/goto-1.go (working copy) @@ -2,6 +2,6 @@ package main func main() { goto lab; - panic(); + panic(0); lab: } Index: execute/expr-1.go =================================================================== --- execute/expr-1.go (revision 155628) +++ execute/expr-1.go (working copy) @@ -6,6 +6,6 @@ func main() { var v3 = (v1 + v2) / (v1 + v2); var v4 = (v3 * v3) % (v3 * v3); if v4 != 0 { - panic() + panic(0) } } Index: execute/select-1.go =================================================================== --- execute/select-1.go (revision 155628) +++ execute/select-1.go (working copy) @@ -11,18 +11,18 @@ func main() { { case v := <- ch1: if v != 1 { - panic() + panic(0) } count++ case v = <- ch2: if v != 2 { - panic() + panic(1) } count++ } } if v != 2 { - panic() + panic(2) } } Index: execute/array-2.go =================================================================== --- execute/array-2.go (revision 155628) +++ execute/array-2.go (working copy) @@ -11,9 +11,9 @@ func fn(a []int) int { func main() { var a [2]int; if fn(&a) != 2 { - panic(); + panic(0); } if a[0] != 0 || a[1] != 1 { - panic(); + panic(1); } } Index: execute/return-2.go =================================================================== --- execute/return-2.go (revision 155628) +++ execute/return-2.go (working copy) @@ -14,5 +14,5 @@ func main() { } else { ret = 1; } - if ret != 0 { panic() } + if ret != 0 { panic(0) } } Index: execute/struct-1.go =================================================================== --- execute/struct-1.go (revision 155628) +++ execute/struct-1.go (working copy) @@ -4,5 +4,5 @@ func main() { type s struct { x int; }; var ret s; ret.x = 1; - if ret.x != 1 { panic() } + if ret.x != 1 { panic(0) } } Index: execute/function-1.go =================================================================== --- execute/function-1.go (revision 155628) +++ execute/function-1.go (working copy) @@ -5,5 +5,5 @@ func subr() int { } func main() { - if subr() != 0 { panic() } + if subr() != 0 { panic(0) } } Index: execute/const-1.go =================================================================== --- execute/const-1.go (revision 155628) +++ execute/const-1.go (working copy) @@ -2,5 +2,5 @@ package main func main() { const c = 2; - if c != 2 { panic() } + if c != 2 { panic(0) } } Index: execute/for-1.go =================================================================== --- execute/for-1.go (revision 155628) +++ execute/for-1.go (working copy) @@ -5,5 +5,5 @@ func main() { for i := 0; i < 10; i++ { sum += i; } - if sum != 45 { panic() } + if sum != 45 { panic(0) } } Index: execute/var-1.go =================================================================== --- execute/var-1.go (revision 155628) +++ execute/var-1.go (working copy) @@ -2,5 +2,5 @@ package main func main() { var ret = 0; - if ret != 0 { panic() } + if ret != 0 { panic(0) } } Index: execute/var-3.go =================================================================== --- execute/var-3.go (revision 155628) +++ execute/var-3.go (working copy) @@ -2,5 +2,5 @@ package main func main() { ret := 0; - if ret != 0 { panic() } + if ret != 0 { panic(0) } } Index: execute/string-1.go =================================================================== --- execute/string-1.go (revision 155628) +++ execute/string-1.go (working copy) @@ -2,7 +2,7 @@ package main func fn(s string) int { if s[0] != 'a' || s[1] != 'b' || s[2] != 'c' { - panic(); + panic(0); } return len(s); } @@ -10,6 +10,6 @@ func fn(s string) int { func main() { s := "abc"; if fn(s) != 3 { - panic(); + panic(1); } } Index: execute/go-2.go =================================================================== --- execute/go-2.go (revision 155628) +++ execute/go-2.go (working copy) @@ -7,5 +7,5 @@ func send_one(c chan <- int, val int) { func main() { c := make(chan int); go send_one(c, 0); - if <-c != 0 { panic() } + if <-c != 0 { panic(0) } } Index: execute/chan-1.go =================================================================== --- execute/chan-1.go (revision 155628) +++ execute/chan-1.go (working copy) @@ -3,5 +3,5 @@ package main func main() { c := make(chan int, 1); c <- 0; - if <-c != 0 { panic() } + if <-c != 0 { panic(0) } }