aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test/test/test0.go
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/go.test/test/test0.go')
-rw-r--r--gcc/testsuite/go.test/test/test0.go40
1 files changed, 23 insertions, 17 deletions
diff --git a/gcc/testsuite/go.test/test/test0.go b/gcc/testsuite/go.test/test/test0.go
index dd2033a..d8d86c4 100644
--- a/gcc/testsuite/go.test/test/test0.go
+++ b/gcc/testsuite/go.test/test/test0.go
@@ -6,12 +6,11 @@
package main
-const
- a_const = 0
+const a_const = 0
const (
- pi = /* the usual */ 3.14159265358979323
- e = 2.718281828
+ pi = /* the usual */ 3.14159265358979323
+ e = 2.718281828
mask1 int = 1 << iota
mask2 = 1 << iota
mask3 = 1 << iota
@@ -19,7 +18,7 @@ const (
)
type (
- Empty interface {}
+ Empty interface{}
Point struct {
x, y int
}
@@ -32,19 +31,21 @@ func (p *Point) Initialize(x, y int) *Point {
}
func (p *Point) Distance() int {
- return p.x * p.x + p.y * p.y
+ return p.x*p.x + p.y*p.y
}
var (
- x1 int
- x2 int
- u, v, w float
+ x1 int
+ x2 int
+ u, v, w float32
)
func foo() {}
func min(x, y int) int {
- if x < y { return x; }
+ if x < y {
+ return x
+ }
return y
}
@@ -57,24 +58,29 @@ func swap(x, y int) (u, v int) {
func control_structs() {
var p *Point = new(Point).Initialize(2, 3)
i := p.Distance()
- var f float = 0.3
+ var f float32 = 0.3
_ = f
- for {}
- for {}
+ for {
+ }
+ for {
+ }
for j := 0; j < i; j++ {
if i == 0 {
- } else i = 0
- var x float
+ } else {
+ i = 0
+ }
+ var x float32
_ = x
}
- foo: // a label
+foo: // a label
var j int
switch y := 0; true {
case i < y:
fallthrough
case i < j:
case i == 0, i == 1, i == j:
- i++; i++
+ i++
+ i++
goto foo
default:
i = -+-+i