blob: 4b32261d48994cd4c393aaf6238bd2984f0439b6 [file] [log] [blame]
Josh Bleecher Snyder03c0f3f2014-05-12 17:10:36 -04001// runoutput
2
3// Copyright 2014 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// Issue 7316
8// This test exercises all types of numeric conversions, which was one
9// of the sources of etype mismatch during register allocation in 8g.
10
11package main
12
13import "fmt"
14
15const tpl = `
16func init() {
17 var i %s
18 j := %s(i)
19 _ = %s(j)
20}
21`
22
23func main() {
24 fmt.Println("package main")
25 ntypes := []string{
26 "byte", "rune", "uintptr",
27 "float32", "float64",
28 "int", "int8", "int16", "int32", "int64",
29 "uint", "uint8", "uint16", "uint32", "uint64",
30 }
31 for i, from := range ntypes {
32 for _, to := range ntypes[i:] {
33 fmt.Printf(tpl, from, to, from)
34 }
35 }
36 fmt.Println("func main() {}")
37}