c++: Improve errors parsing a braced list [PR101232]
[official-gcc.git] / gcc / testsuite / go.test / test / func8.go
blob9de01d43ea5e86a9885071b9fd441185762c17a3
1 // run
3 // Copyright 2011 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 evaluation order.
9 package main
11 var calledf int
13 func f() int {
14 calledf++
15 return 0
18 func g() int {
19 return calledf
22 var xy string
24 //go:noinline
25 func x() bool {
26 xy += "x"
27 return false
30 //go:noinline
31 func y() string {
32 xy += "y"
33 return "abc"
36 func main() {
37 if f() == g() {
38 panic("wrong f,g order")
41 if x() == (y() == "abc") {
42 panic("wrong compare")
44 if xy != "xy" {
45 panic("wrong x,y order")