Fix gcc.dg/vect/bb-slp-77.c for x86
[official-gcc.git] / libgo / go / go / doc / testdata / d1.go
blobebd69419589f1ad038b9aa0cd817313d34a34c36
1 // Copyright 2012 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.
5 // Test cases for sort order of declarations.
7 package d
9 // C2 should be third.
10 const C2 = 2
12 // V2 should be third.
13 var V2 int
15 // CBx constants should appear before CAx constants.
16 const (
17 CB2 = iota // before CB1
18 CB1 // before CB0
19 CB0 // at end
22 // VBx variables should appear before VAx variables.
23 var (
24 VB2 int // before VB1
25 VB1 int // before VB0
26 VB0 int // at end
29 const (
30 // Single const declarations inside ()'s are considered ungrouped
31 // and show up in sorted order.
32 Cungrouped = 0
35 var (
36 // Single var declarations inside ()'s are considered ungrouped
37 // and show up in sorted order.
38 Vungrouped = 0
41 // T2 should be third.
42 type T2 struct{}
44 // Grouped types are sorted nevertheless.
45 type (
46 // TG2 should be third.
47 TG2 struct{}
49 // TG1 should be second.
50 TG1 struct{}
52 // TG0 should be first.
53 TG0 struct{}
56 // F2 should be third.
57 func F2() {}