1 // +build amd64 s390x arm64
2 // errorcheck -0 -d=ssa/phiopt/debug=3
4 // Copyright 2016 The Go Authors. All rights reserved.
5 // Use of this source code is governed by a BSD-style
6 // license that can be found in the LICENSE file.
11 func f0(a bool) bool {
18 return x // ERROR "converted OpPhi to Copy$"
22 func f1(a bool) bool {
29 return x // ERROR "converted OpPhi to Not$"
33 func f2(a, b int) bool {
38 return x // ERROR "converted OpPhi to Not$"
42 func f3(a, b int) bool {
47 return x // ERROR "converted OpPhi to Copy$"
51 func f4(a, b bool) bool {
52 return a || b // ERROR "converted OpPhi to OrB$"
56 func f5or(a int, b bool) bool {
63 return x // ERROR "converted OpPhi to OrB$"
67 func f5and(a int, b bool) bool {
74 return x // ERROR "converted OpPhi to AndB$"
78 func f6or(a int, b bool) bool {
81 // f6or has side effects so the OpPhi should not be converted.
88 func f6and(a int, b bool) bool {
91 // f6and has side effects so the OpPhi should not be converted.
98 func f7or(a bool, b bool) bool {
99 return a || b // ERROR "converted OpPhi to OrB$"
103 func f7and(a bool, b bool) bool {
104 return a && b // ERROR "converted OpPhi to AndB$"
108 func f8(s string) (string, bool) {
110 if s[0] == '-' { // ERROR "converted OpPhi to Copy$"
120 func f9(a, b int) bool {
122 if a < 0 { // ERROR "converted OpPhi to Copy$"