RISC-V: Remove testcase XFAIL
[official-gcc.git] / gcc / testsuite / go.test / test / varinit.go
blob84a4a1aa55cd58cf2169b1c2b83ec517d67f6a26
1 // run
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test var x = x + 1 works.
9 package main
11 func main() {
12 var x int = 1
13 if x != 1 {
14 print("found ", x, ", expected 1\n")
15 panic("fail")
18 var x int = x + 1
19 if x != 2 {
20 print("found ", x, ", expected 2\n")
21 panic("fail")
25 x := x + 1
26 if x != 2 {
27 print("found ", x, ", expected 2\n")
28 panic("fail")