Source file
test/fixedbugs/issue26495.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 var i int
13
14 func checkorder(order int) {
15 if i != order {
16 panic("FAIL: wrong evaluation order")
17 }
18 i++
19 }
20
21 func A() bool { checkorder(1); return true }
22 func B() bool { checkorder(2); return true }
23 func C() bool { checkorder(5); return false }
24 func D() bool { panic("FAIL: D should not be called") }
25 func E() int { checkorder(3); return 0 }
26 func F() int { checkorder(0); return 0 }
27 func G(bool) int { checkorder(9); return 0 }
28 func H(int, bool, int) int { checkorder(7); return 0 }
29 func I(int) bool { checkorder(8); return true }
30 func J() int { checkorder(4); return 0 }
31 func K() int { checkorder(6); return 0 }
32 func L() int { checkorder(10); return 0 }
33
34 func main() {
35 _ = F() + G(A() && B() && I(E()+H(J(), C() && D(), K()))) + L()
36 }
37
View as plain text