Source file test/fixedbugs/issue64715.go

     1  // run
     2  
     3  // Copyright 2023 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  func boolInt32(b bool) int32 {
    10  	if b {
    11  		return 1
    12  	}
    13  
    14  	return 0
    15  }
    16  
    17  func f(left uint16, right int32) (r uint16) {
    18  	return left >> right
    19  }
    20  
    21  var n = uint16(65535)
    22  
    23  func main() {
    24  	println(f(n, boolInt32(int64(n^n) > 1)))
    25  }
    26  

View as plain text