blob: 3d5a8c9e39fe13507ae3061f4bf778337c825fb5 [file] [log] [blame]
Dan Willemsen09eb3b12015-09-16 14:34:17 -07001// Copyright 2011 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// This file is used to generate an object file which
6// serves as test file for gcimporter_test.go.
7
8package exports
9
Dan Willemsenebae3022017-01-13 23:01:08 -080010import "go/ast"
Dan Willemsen09eb3b12015-09-16 14:34:17 -070011
12// Issue 3682: Correctly read dotted identifiers from export data.
13const init1 = 0
14
15func init() {}
16
17const (
Dan Willemsenbc60c3c2021-12-15 01:09:00 -080018 C0 int = 0
19 C1 = 3.14159265
20 C2 = 2.718281828i
21 C3 = -123.456e-789
22 C4 = +123.456e+789
23 C5 = 1234i
24 C6 = "foo\n"
25 C7 = `bar\n`
26 C8 = 42
27 C9 int = 42
28 C10 float64 = 42
Dan Willemsen09eb3b12015-09-16 14:34:17 -070029)
30
31type (
32 T1 int
33 T2 [10]int
34 T3 []int
35 T4 *int
36 T5 chan int
37 T6a chan<- int
38 T6b chan (<-chan int)
39 T6c chan<- (chan int)
40 T7 <-chan *ast.File
41 T8 struct{}
42 T9 struct {
43 a int
44 b, c float32
45 d []string `go:"tag"`
46 }
47 T10 struct {
48 T8
49 T9
50 _ *T10
51 }
52 T11 map[int]string
Dan Willemsenbc60c3c2021-12-15 01:09:00 -080053 T12 any
Dan Willemsen09eb3b12015-09-16 14:34:17 -070054 T13 interface {
55 m1()
56 m2(int) float32
57 }
58 T14 interface {
59 T12
60 T13
61 m3(x ...struct{}) []T9
62 }
63 T15 func()
64 T16 func(int)
65 T17 func(x int)
66 T18 func() float32
67 T19 func() (x float32)
Dan Willemsenbc60c3c2021-12-15 01:09:00 -080068 T20 func(...any)
Dan Willemsen09eb3b12015-09-16 14:34:17 -070069 T21 struct{ next *T21 }
70 T22 struct{ link *T23 }
71 T23 struct{ link *T22 }
72 T24 *T24
73 T25 *T26
74 T26 *T27
75 T27 *T25
76 T28 func(T28) T28
77)
78
79var (
80 V0 int
Dan Willemsenebae3022017-01-13 23:01:08 -080081 V1 = -991.0
82 V2 float32 = 1.2
Dan Willemsen09eb3b12015-09-16 14:34:17 -070083)
84
85func F1() {}
86func F2(x int) {}
87func F3() int { return 0 }
88func F4() float32 { return 0 }
Dan Willemsenbc60c3c2021-12-15 01:09:00 -080089func F5(a, b, c int, u, v, w struct{ x, y T1 }, more ...any) (p, q, r chan<- T10)
Dan Willemsen09eb3b12015-09-16 14:34:17 -070090
91func (p *T1) M1()