Source file test/fixedbugs/issue82141.go

     1  // run
     2  
     3  // Copyright 2026 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  // On s390x, comparing a right-shifted uint64 against a constant in
     8  // [1<<31, 1<<32) was folded to a constant result because the rewrite
     9  // rule sign-extended the 32-bit immediate.
    10  
    11  package main
    12  
    13  //go:noinline
    14  func gt(x uint64) bool { return x>>6 > 0xffffffff }
    15  
    16  func main() {
    17  	if !gt(1 << 40) {
    18  		panic("gt(1<<40) = false, want true")
    19  	}
    20  }
    21  

View as plain text