]> Cypherpunks.ru repositories - gostls13.git/blob - test/phiopt.go
Merge "Merge branch 'dev.ssa' into mergebranch"
[gostls13.git] / test / phiopt.go
1 // +build amd64
2 // errorcheck -0 -d=ssa/phiopt/debug=3
3
4 package main
5
6 func f0(a bool) bool {
7         x := false
8         if a {
9                 x = true
10         } else {
11                 x = false
12         }
13         return x // ERROR "converted OpPhi to OpCopy$"
14 }
15
16 func f1(a bool) bool {
17         x := false
18         if a {
19                 x = false
20         } else {
21                 x = true
22         }
23         return x // ERROR "converted OpPhi to OpNot$"
24 }
25
26 func f2(a, b int) bool {
27         x := true
28         if a == b {
29                 x = false
30         }
31         return x // ERROR "converted OpPhi to OpNot$"
32 }
33
34 func f3(a, b int) bool {
35         x := false
36         if a == b {
37                 x = true
38         }
39         return x // ERROR "converted OpPhi to OpCopy$"
40 }
41
42 func main() {
43 }