shift.go 358 B

12345678910111213
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // This file contains tests for the suspicious shift checker.
  5. package shift
  6. func ShiftTest() {
  7. var i8 int8
  8. _ = i8 << 7
  9. _ = (i8 + 1) << 8 // ERROR ".i8 . 1. .8 bits. too small for shift of 8"
  10. }