1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:01:37 -07:00
go/test/fixedbugs/issue53018.go
Cuong Manh Le a2bca290e7 cmd/compile: fix loong64 constant folding in division rules
The divisor must be non-zero for the rule to be triggered.

Fixes #53018

Change-Id: Id56b8d986945bbb66e13131d11264ee438de5cb2
Reviewed-on: https://go-review.googlesource.com/c/go/+/407655
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: xiaodong liu <teaofmoli@gmail.com>
Reviewed-by: WANG Xuerui <git@xen0n.name>
2022-05-23 23:54:07 +00:00

31 lines
495 B
Go

// compile
// Copyright 2022 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 p
var V []int
func f(i int, c chan int) int {
arr := []int{0, 1}
for range c {
for a2 := range arr {
var a []int
V = V[:1/a2]
a[i] = 0
}
return func() int {
arr = []int{}
return func() int {
return func() int {
return func() int { return 4 }()
}()
}()
}()
}
return 0
}