Source file test/fixedbugs/arm64bitfieldoverlap.go

     1  // compile -N
     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 arm64 the SBFX -> SBFIZ rewrite produced a negative bitfield
     8  // width when the left shift moved the extracted field entirely out
     9  // of range, generating an ICE.
    10  
    11  package p
    12  
    13  func f(x int64) int64 {
    14  	return int64(int8(x<<16)) >> 1
    15  }
    16  

View as plain text