1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:04:42 -07:00
go/test/fixedbugs/issue62360.go
Keith Randall 0e02baa59a Revert "cmd/compile: use shorter ANDL/TESTL if upper 32 bits are known to be zero"
This reverts commit c1dfbf72e1.

Reason for revert: TESTL rule is wrong when the result is used for an ordered comparison.

Fixes #62360

Change-Id: I4d5b6aca24389b0a2bf767bfbc0a9d085359eb38
Reviewed-on: https://go-review.googlesource.com/c/go/+/524255
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
2023-08-30 15:15:28 +00:00

25 lines
414 B
Go

// run
// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"math/big"
)
//go:noinline
func f(x uint32) *big.Int {
return big.NewInt(int64(x))
}
func main() {
b := f(0xffffffff)
c := big.NewInt(0xffffffff)
if b.Cmp(c) != 0 {
panic(fmt.Sprintf("b:%x c:%x", b, c))
}
}