Source file test/fixedbugs/issue81687.go

     1  // compile
     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  package p
     8  
     9  // The rotate amounts are only rewritten on 32-bit platforms,
    10  // so this only failed to compile there.
    11  
    12  func rotate(x uint32, n int) uint32 {
    13  	if n < 0 {
    14  		s := uint(-n)
    15  		return x<<s | x>>(32-s)
    16  	}
    17  	s := uint(n)
    18  	return x>>s | x<<(32-s)
    19  }
    20  
    21  func f(x uint32) uint32 {
    22  	return rotate(rotate(x, 7), -7)
    23  }
    24  

View as plain text