Source file
test/abi/too_big_to_ssa.go
1
2
3
4
5
6
7
8
9 package main
10
11 import (
12 "fmt"
13 )
14
15 var sink *string
16
17 type toobig struct {
18
19 a, b, c string
20 }
21
22
23
24 func H(x toobig) string {
25 return x.a + " " + x.b + " " + x.c
26 }
27
28
29
30 func I(a, b, c string) toobig {
31 return toobig{a, b, c}
32 }
33
34 func main() {
35 s := H(toobig{"Hello", "there,", "World"})
36 gotVsWant(s, "Hello there, World")
37 fmt.Println(s)
38 t := H(I("Ahoy", "there,", "Matey"))
39 gotVsWant(t, "Ahoy there, Matey")
40 fmt.Println(t)
41 }
42
43 func gotVsWant(got, want string) {
44 if got != want {
45 fmt.Printf("FAIL, got %s, wanted %s\n", got, want)
46 }
47 }
48
View as plain text