Source file src/cmd/compile/internal/importer/testdata/exports.go

     1  // 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  
     8  package exports
     9  
    10  import "go/ast"
    11  
    12  // Issue 3682: Correctly read dotted identifiers from export data.
    13  const init1 = 0
    14  
    15  func init() {}
    16  
    17  const (
    18  	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
    29  	C11         = "\n$$\n" // an object file export data marker - export data extraction must not be led astray
    30  )
    31  
    32  type (
    33  	T1  int
    34  	T2  [10]int
    35  	T3  []int
    36  	T4  *int
    37  	T5  chan int
    38  	T6a chan<- int
    39  	T6b chan (<-chan int)
    40  	T6c chan<- (chan int)
    41  	T7  <-chan *ast.File
    42  	T8  struct{}
    43  	T9  struct {
    44  		a    int
    45  		b, c float32
    46  		d    []string `go:"tag"`
    47  	}
    48  	T10 struct {
    49  		T8
    50  		T9
    51  		_ *T10
    52  	}
    53  	T11 map[int]string
    54  	T12 interface{}
    55  	T13 interface {
    56  		m1()
    57  		m2(int) float32
    58  	}
    59  	T14 interface {
    60  		T12
    61  		T13
    62  		m3(x ...struct{}) []T9
    63  	}
    64  	T15 func()
    65  	T16 func(int)
    66  	T17 func(x int)
    67  	T18 func() float32
    68  	T19 func() (x float32)
    69  	T20 func(...interface{})
    70  	T21 struct{ next *T21 }
    71  	T22 struct{ link *T23 }
    72  	T23 struct{ link *T22 }
    73  	T24 *T24
    74  	T25 *T26
    75  	T26 *T27
    76  	T27 *T25
    77  	T28 func(T28) T28
    78  )
    79  
    80  var (
    81  	V0 int
    82  	V1         = -991.0
    83  	V2 float32 = 1.2
    84  )
    85  
    86  func F1()         {}
    87  func F2(x int)    {}
    88  func F3() int     { return 0 }
    89  func F4() float32 { return 0 }
    90  func F5(a, b, c int, u, v, w struct{ x, y T1 }, more ...interface{}) (p, q, r chan<- T10)
    91  
    92  func (p *T1) M1()
    93  

View as plain text