URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [test0.go] - Rev 700
Compare with Previous | Blame | View Log
// $G $F.go && $L $F.$A && ./$A.out// Copyright 2009 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package mainconst a_const = 0const (pi = /* the usual */ 3.14159265358979323e = 2.718281828mask1 int = 1 << iotamask2 = 1 << iotamask3 = 1 << iotamask4 = 1 << iota)type (Empty interface{}Point struct {x, y int}Point2 Point)func (p *Point) Initialize(x, y int) *Point {p.x, p.y = x, yreturn p}func (p *Point) Distance() int {return p.x*p.x + p.y*p.y}var (x1 intx2 intu, v, w float32)func foo() {}func min(x, y int) int {if x < y {return x}return y}func swap(x, y int) (u, v int) {u = yv = xreturn}func control_structs() {var p *Point = new(Point).Initialize(2, 3)i := p.Distance()var f float32 = 0.3_ = ffor {}for {}for j := 0; j < i; j++ {if i == 0 {} else {i = 0}var x float32_ = x}foo: // a labelvar j intswitch y := 0; true {case i < y:fallthroughcase i < j:case i == 0, i == 1, i == j:i++i++goto foodefault:i = -+-+ibreak}}func main() {}
