1
0
mirror of https://github.com/golang/go synced 2024-11-23 11:20:05 -07:00
go/test/fixedbugs/issue16741.go
Cherry Zhang 3d5cf72ca9 cmd/compile: CSE copied tuple selectors
In CSE if a tuple generator is CSE'd to a different block, its
selectors are copied to the same block. In this case, also CES
the copied selectors.

Test copied from Keith's CL 27202.

Fixes #16741.

Change-Id: I2fc8b9513d430f10d6104275cfff5fb75d3ef3d9
Reviewed-on: https://go-review.googlesource.com/27236
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2016-08-17 21:03:26 +00:00

18 lines
363 B
Go

// compile
// Copyright 2016 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.
// Make sure CSE of multi-output opcodes works correctly
// with select0/1 operations.
package main
func div(d, r int64) int64 {
if m := d % r; m > 0 {
return d/r + 1
}
return d / r
}