Source file test/fixedbugs/issue62360.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  import (
    10  	"fmt"
    11  	"math/big"
    12  )
    13  
    14  //go:noinline
    15  func f(x uint32) *big.Int {
    16  	return big.NewInt(int64(x))
    17  }
    18  func main() {
    19  	b := f(0xffffffff)
    20  	c := big.NewInt(0xffffffff)
    21  	if b.Cmp(c) != 0 {
    22  		panic(fmt.Sprintf("b:%x c:%x", b, c))
    23  	}
    24  }
    25  

View as plain text