Rebase.
[official-gcc.git] / libgo / go / go / printer / testdata / comments2.input
blob4a055c82772886a0b2ea165d7b2abc987e458235
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 // This is a package for testing comment placement by go/printer.
6 //
7 package main
9 // Test cases for idempotent comment formatting (was issue 1835).
11 c1a
14    c1b
16 /* foo
17 c1c
19 /* foo
20    c1d
23 c1e
24 foo */
26    c1f
27    foo */
29 func f() {
31 c2a
34    c2b
36 /* foo
37 c2c
39 /* foo
40    c2d
43 c2e
44 foo */
46    c2f
47    foo */
50 func g() {
52 c3a
55    c3b
57 /* foo
58 c3c
60 /* foo
61    c3d
64 c3e
65 foo */
67    c3f
68    foo */
71 // Test case taken literally from issue 1835.
72 func main() {
74 prints test 5 times
76    for i := 0; i < 5; i++ {
77       println("test")
78    }
81 func issue5623() {
83    _ = yyyyyyyyyyyyyyyy // comment - should be aligned
84    _ = xxxxxxxxxxxxxxxxxxxxxxxxxxxx /* comment */
86    _ = yyyyyyyyyyyyyyyy /* comment - should be aligned */
87    _ = xxxxxxxxxxxxxxxxxxxxxxxxxxxx // comment
89 LLLLLLL:
90    _ = yyyyyyyyyyyyyyyy // comment - should be aligned
91    _ = xxxxxxxxxxxxxxxxxxxxxxxxxxxx // comment
93 LL:
94 LLLLL:
95    _ = xxxxxxxxxxxxxxxxxxxxxxxxxxxx /* comment */
96    _ = yyyyyyyyyyyyyyyy /* comment - should be aligned */
98    _ = xxxxxxxxxxxxxxxxxxxxxxxxxxxx // comment
99    _ = yyyyyyyyyyyyyyyy // comment - should be aligned
101 // test case from issue
102 label:
103    mask := uint64(1)<<c - 1 // Allocation mask
104    used := atomic.LoadUint64(&h.used) // Current allocations