summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.go/types.go
blob: be9179f18bc29a6da09258bac992bf43b0c4bf70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package main

import "fmt"

// Self-referential type.
type T *T

// Mutually recursive types.
type T1 *T2
type T2 *T1

// Mutually recursive struct types.
type S1 struct { p_s2 *S2 }
type S2 struct { p_s1 *S1 }

func main () {
  fmt.Println ("Shall we?")
  var t T
  fmt.Println (t)
  var s1 S1
  var s2 S2
  fmt.Println (s1)
  fmt.Println (s2)
}