]> Cypherpunks.ru repositories - gostls13.git/blob - test/fixedbugs/issue26438.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / fixedbugs / issue26438.go
1 // run
2
3 // Copyright 2018 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6
7 // Issue 26438: arm64 backend may use 64-bit TST for
8 // "if uint32(a)&uint32(b) == 0", which should be
9 // 32-bit TSTW
10
11 package main
12
13 //go:noinline
14 func tstw(a, b uint64) uint64 {
15         if uint32(a)&uint32(b) == 0 {
16                 return 100
17         } else {
18                 return 200
19         }
20 }
21
22 func main() {
23         if tstw(0xff00000000, 0xaa00000000) == 200 {
24                 panic("impossible")
25         }
26 }