blob: c77a76d057ac512617f504f73a8e069779dbf57e [file] [log] [blame]
Rémy Oudompheng4bb75cd2012-09-30 10:35:09 +02001// run
2
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2012 The Go Authors. All rights reserved.
Rémy Oudompheng4bb75cd2012-09-30 10:35:09 +02004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Issue 3907: out of fixed registers in nested byte multiply.
8// Used to happen with both 6g and 8g.
9
10package main
11
12func F(a, b, c, d uint8) uint8 {
13 return a * (b * (c * (d *
14 (a * (b * (c * (d *
15 (a * (b * (c * (d *
16 a * (b * (c * d)))))))))))))
17}
18
19func main() {
20 var a, b, c, d uint8 = 1, 1, 1, 1
21 x := F(a, b, c, d)
22 if x != 1 {
23 println(x)
24 panic("x != 1")
25 }
26}