Source file test/fixedbugs/issue887.go
1 // compile 2 3 // Copyright 2013 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 // Used to leak registers on 8g. 8 9 package p 10 11 func f(x byte, y uint64) { 12 var r byte 13 switch y { 14 case 1: 15 r = x << y // '>>' triggers it too 16 case 2: 17 r = x << y 18 case 3: 19 r = x << y 20 case 4: 21 r = x << y 22 case 5: 23 r = x << y 24 case 6: 25 r = x << y 26 case 7: 27 r = x << y 28 case 8: 29 r = x << y 30 case 9: 31 r = x << y 32 case 10: 33 r = x << y 34 } 35 _ = r 36 } 37