Source file src/internal/types/testdata/fixedbugs/issue79252.go

     1  // Copyright 2026 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  
     5  package p
     6  
     7  func _() {
     8  	var s int
     9  	_ = 1 << (- /* ERROR "overflows uint" */ 1 << s)
    10  	_ = 1 << (1 << 63 << s)
    11  	_ = 1 << (1 /* ERROR "overflows uint" */ << 64 << s)
    12  	_ = 1 << (1 /* ERROR "overflows uint" */ << 65 << s)
    13  
    14  	_ = 1 << (1.0 << s)
    15  	_ = 1 << (- /* ERROR "truncated to uint" */ 1.0 << s)
    16  	_ = 1 << (1.1 /* ERROR "must be integer" */ << s)
    17  }
    18  
    19  func _() {
    20  	var s int
    21  	var _ float32 = (1 /* ERROR "must be integer" */ << 200) << s
    22  }
    23  
    24  // test case from issue
    25  
    26  func main() {
    27  	var v7 int
    28  	v8 := 0 >> ((2 /* ERROR "overflows uint" */ ^ 0xffffffffffffffff<<2) >> v7)
    29  	_ = v8
    30  }
    31  

View as plain text