mirror of
https://github.com/golang/go
synced 2024-10-14 20:05:36 +00:00
Refined deMorgan's tests to be more explicit with regexp
This commit is contained in:
parent
b9f424e7d1
commit
f22e2350c9
|
@ -28,14 +28,14 @@ func ornot(x, y int) int {
|
|||
|
||||
// Verify that (OR (NOT x) (NOT y)) rewrites to (NOT (AND x y))
|
||||
func orDemorgans(x, y int) int {
|
||||
// amd64:"AND"
|
||||
// amd64:"AND",-"OR"
|
||||
z := ^x | ^y
|
||||
return z
|
||||
}
|
||||
|
||||
// Verify that (AND (NOT x) (NOT y)) rewrites to (NOT (OR x y))
|
||||
func andDemorgans(x, y int) int {
|
||||
// amd64:"OR"
|
||||
// amd64:"OR",-"AND"
|
||||
z := ^x & ^y
|
||||
return z
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue