test/fixedbugs/issue48476.go
raw| 1 | // run |
| 2 | |
| 3 | // Copyright 2021 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 | package main |
| 8 | |
| 9 | import "fmt" |
| 10 | |
| 11 | //go:noinline |
| 12 | func f(x uint64) uint64 { |
| 13 | s := "\x04" |
| 14 | c := s[0] |
| 15 | return x << c << 4 |
| 16 | } |
| 17 | func main() { |
| 18 | if want, got := uint64(1<<8), f(1); want != got { |
| 19 | panic(fmt.Sprintf("want %x got %x", want, got)) |
| 20 | } |
| 21 | } |