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