test/fixedbugs/issue41872.go
raw| 1 | // run |
| 2 | |
| 3 | // Copyright 2020 The Go Authors. All rights reserved. Use of this |
| 4 | // source code is governed by a BSD-style license that can be found in |
| 5 | // the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | //go:noinline |
| 10 | func f8(x int32) bool { |
| 11 | return byte(x&0xc0) == 64 |
| 12 | } |
| 13 | |
| 14 | //go:noinline |
| 15 | func f16(x int32) bool { |
| 16 | return uint16(x&0x8040) == 64 |
| 17 | } |
| 18 | |
| 19 | func main() { |
| 20 | if !f8(64) { |
| 21 | panic("wanted true, got false") |
| 22 | } |
| 23 | if !f16(64) { |
| 24 | panic("wanted true, got false") |
| 25 | } |
| 26 | } |