diff options
author | lauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-01 15:27:54 +0000 |
---|---|---|
committer | lauras <lauras@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-01 15:27:54 +0000 |
commit | be8a82b8e4ad4886a4fc8210ea7f6b48bd0f10ee (patch) | |
tree | ecda0ba13ac028840ac2f39d6c13789ed98bcedb /gcc/testsuite/go.test/test/blank.go | |
parent | 9034761137f5fcdf7a46f9a545136fa615e7bafc (diff) | |
parent | 96b07a493754f1f2d72c564bb3e071b541f0e351 (diff) | |
download | gcc-be8a82b8e4ad4886a4fc8210ea7f6b48bd0f10ee.tar.gz |
Merge from trunk up to r170497
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gc-improv@170594 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/go.test/test/blank.go')
-rw-r--r-- | gcc/testsuite/go.test/test/blank.go | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/gcc/testsuite/go.test/test/blank.go b/gcc/testsuite/go.test/test/blank.go index b9d3a32a817..681a5e77cb4 100644 --- a/gcc/testsuite/go.test/test/blank.go +++ b/gcc/testsuite/go.test/test/blank.go @@ -28,7 +28,7 @@ const ( c4 ) -var ints = []string { +var ints = []string{ "1", "2", "3", @@ -36,15 +36,15 @@ var ints = []string { func f() (int, int) { call += "f" - return 1,2 + return 1, 2 } -func g() (float, float) { +func g() (float64, float64) { call += "g" - return 3,4 + return 3, 4 } -func h(_ int, _ float) { +func h(_ int, _ float64) { } func i() int { @@ -55,43 +55,64 @@ func i() int { var _ = i() func main() { - if call != "i" {panic("init did not run")} + if call != "i" { + panic("init did not run") + } call = "" _, _ = f() a, _ := f() - if a != 1 {panic(a)} + if a != 1 { + panic(a) + } b, _ := g() - if b != 3 {panic(b)} + if b != 3 { + panic(b) + } _, a = f() - if a != 2 {panic(a)} + if a != 2 { + panic(a) + } _, b = g() - if b != 4 {panic(b)} + if b != 4 { + panic(b) + } _ = i() - if call != "ffgfgi" {panic(call)} - if c4 != 4 {panic(c4)} + if call != "ffgfgi" { + panic(call) + } + if c4 != 4 { + panic(c4) + } out := "" for _, s := range ints { out += s } - if out != "123" {panic(out)} + if out != "123" { + panic(out) + } sum := 0 - for s, _ := range ints { + for s := range ints { sum += s } - if sum != 3 {panic(sum)} + if sum != 3 { + panic(sum) + } - h(a,b) + h(a, b) } // useless but legal var _ int = 1 var _ = 2 var _, _ = 3, 4 + const _ = 3 const _, _ = 4, 5 + type _ int + func _() { panic("oops") } |