code
stringlengths
10
1.34M
language
stringclasses
1 value
//line x3.go:4 package main func F3() {}
Go
//line x2.go:4 package main func F2() {}
Go
//line x19.go:4 package main func F19() {}
Go
//line x13.go:4 package main func F13() {}
Go
//line x5.go:4 package main func F5() {}
Go
//line x1.go:4 package main func F1() {}
Go
//line x17.go:4 package main func F17() {}
Go
//line x6.go:4 package main func F6() {}
Go
// $G $D/$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 main import "fmt" func main() { n := bool + byte + float + float32 + float64 + int + int...
Go
// $G $D/$F.go // Copyright 2011 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 main var ( r0 = 'a' r1 = 'a'+1 r2 = 1+'a' r3 = 'a'*2 r4 = 'a'/2 r5 = 'a'<<1 r6 = 'b'<<2 r7 int32 r = []rune{r0, r1, r2, r3, ...
Go
// errchk $G -e $D/$F.go // 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 main type ( A [10]int B []int C chan int F func() int I interface { m() int } M map[int]int P *int S struct { X ...
Go
// $G $D/$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 main const ( // example from the spec n1 = +5 n2 = -5 d1 = +3 d2 = -3 q1 = +1 q2 = -1 q3 = -1 q4 = +1...
Go
// $G $D/$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 main func main() { var x,y int; x,y = simple(10,20,30); if x+y != 65 { panic(x+y); } } func simple(ia,ib,i...
Go
// $G $D/$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 main const nilchar = 0; type Atom struct { str string; integer int; next *Slist; /* in hash bucket */ }...
Go
// $G $D/$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 main import "math/rand" const Count = 1e5 func i64rand() int64 { for { a := int64(rand.Uint32()) a = (a ...
Go
// $G $D/$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 main var bx []byte var by []byte var fx []float64 var fy []float64 var lb, hb int var t int func main() { //...
Go
// $G $D/$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 main func setpd(a []int) { // print("setpd a=", a, " len=", len(a), " cap=", cap(a), "\n"); for i := 0; i < l...
Go
// $G $D/$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 main var b[10] float32; func main() { var a[10] float32; for i:=int16(5); i<10; i=i+1 { a[i] = float32(i)...
Go
// $G $D/$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 main var bx [10]byte var by []byte var fx [10]float64 var fy []float64 var lb, hb int var t int func main() { ...
Go
// $G $D/$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 main var x,y int; func main() { x = 15; y = 20; { var x int; x = 25; y = 25; _ = x; } x = x+y; ...
Go
// $G $D/$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 main func main() { var t,i int; for i=0; i<100; i=i+1 { t = t+i; } if t != 50*99 { panic(t); } }
Go
// $G $D/$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 main const size = 16 var a [size]byte var p []byte var m map[int]byte func f(k int) byte { return byte(k * 1...
Go
// $G $D/$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 main var ians [18]int; var uans [18]uint; var pass string; func testi(i int, t1,t2,t3 int) { n := ((t1*3) + t...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main const ( R = 5 I = 6i C1 = R + I // ADD(5,6) C2 = R - I // SUB(5,-6) C3 = -(R + I) // ADD(5,6) ...
Go
// $G $D/$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 main import "math/rand" const Count = 1e5 func i64rand() int64 { for { a := int64(rand.Uint32()) a = (a ...
Go
// $G $D/$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 main func main() { print("hello world\n"); }
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main const ( R = 5 I = 6i C1 = R + I // ADD(5,6) ) func doprint(c complex128) { println(c) } func main() ...
Go
// $G $D/$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 main func main() { a := 3; for i:=0; i<10; i=i+1 { switch(i) { case 5: print("five"); case a,7: p...
Go
// $G $D/$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 main type x2 struct { a,b,c int; d int; }; var g1 x2; var g2 struct { a,b,c int; d x2; }; func main() { var ...
Go
// $G $D/$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 main func assertequal(is, shouldbe int, msg string) { if is != shouldbe { print("assertion fail" + msg + "\n...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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. // near-exhaustive test of converting numbers between types. package main var i8 int8; var u8 uint8; var i16 int16; va...
Go
// $G $D/$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 main type I interface { test1() int test2() int test3() int test4() int test5() int test6() int test7()...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main var a [12]complex128 var s []complex128 var c chan complex128 var f struct { c complex128 } var m map[com...
Go
// $G $D/$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 main import "runtime" const N = 1000 // sent messages const M = 10 // receiving goroutines const W = 2 //...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main import "fmt" const ( R = 5 I = 6i C1 = R + I // ADD(5,6) ) func doprint(c complex128) { fmt.Printf("...
Go
// $G $D/$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 main import "os" import "runtime" import "sync" var randx int func nrand(n int) int { randx += 10007 if ran...
Go
// $G $D/$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 main func main() { var x int; x = fun(10,20,30); if x != 60 { panic(x); } } func fun(ia,ib,ic int)int { ...
Go
// $G $D/$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 main func main() { i := 0; if false { goto gogoloop; } if false { goto gogoloop; } if false { goto...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main const ( R = 5 I = 6i C1 = R + I // ADD(5,6) ) func main() { var b bool // constants b = (5 + 6i) ...
Go
// $G $D/$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 main type s struct { a bool; b bool; } func main() { var a,b bool; a = true; b = false; if !a { panic(...
Go
// $G $D/$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 main type Item interface { Print(); } type ListItem struct { item Item; next *ListItem; } type List ...
Go
// $G $D/$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 main type x2 struct { a,b,c int; d int; }; var g1 x2; var g2 struct { a,b,c int; d x2; }; func main() { var ...
Go
// $G $D/$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 main type M map[int]int type S struct{ a,b,c int }; type SS struct{ aa,bb,cc S }; type SA struct{ a,b,c [3]int ...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main import "unsafe" import "reflect" const ( R = 5 I = 6i C1 = R + I // ADD(5,6) ) func main() { c0 := ...
Go
// $G $D/$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 main type S struct { a,b int; } type I1 interface { f ()int; } type I2 interface { g() int; f() int; } f...
Go
// $G $D/$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 main func main() { x := func(a int)int { x := func(a int)int { x := func(a int)int { return a+5; ...
Go
// $G $D/$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 main type myint int type mystring string type I0 interface{} func f() { var ia, ib I0 var i myint var s mys...
Go
// $G $D/$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 main type vlong int64 type short int16 func main() { s1 := vlong(0) for i := short(0); i < 10; i = i + 1 { ...
Go
// $G $D/$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 main type C struct { a int; x func(p *C)int; } func (this *C) f()int { return this.a; } func main() { va...
Go
// $G $D/$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 main func main() { var c string a := `abc` b := `xyz` /* print a literal */ print(`abc`) /* print a v...
Go
// $G $D/$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 main type Iputs interface { puts (s string); } // --------- type Print struct { whoami int; put Iputs; } ...
Go
// $G $D/$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 main func assertequal(is, shouldbe int, msg string) { if is != shouldbe { print("assertion fail" + msg + "\n...
Go
// $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 main var a, b, c, d, e, f, g, h, i int func printit() { println(a, b, c, d, e, f, g, h, i) } func testit(permut...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 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 main var calledf = false func f() int { calledf = true return 1 } func g() int { if !calledf { println(...
Go
// $G $D/$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 main func main() { c := make(chan int, 10) if len(c) != 0 || cap(c) != 10 { println("chan len/cap ", len(c)...
Go
// errchk $G -e $D/$F.go // 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 main type S struct { A, B, C, X, Y, Z int } type T struct { S } var x = 1 var a1 = S { 0, X: 1 } // ERROR "mixture|undefi...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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 main func main() { defer println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[strin...
Go
// errchk -0 $G -m $D/$F.go // Copyright 2010 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 foo import ( "fmt" "unsafe" ) var gxx *int func foo1(x int) { // ERROR "moved to heap: x" gxx = &x // ERROR "&x esca...
Go
// $G $D/$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 main const ( ci8 = -1 << 7 ci16 = -1<<15 + 100 ci32 = -1<<31 + 100000 ci64 = -1<<63 + 10000000001 cu8 =...
Go
// errchk $G -e $D/$F.go // Copyright 2011 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 main type Tbyte []byte type Trune []rune type Tint64 []int64 type Tstring string func main() { s := "hello" sb := []byte(...
Go
// errchk $G -e $D/$F.go // Copyright 2011 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 main func main() {} type v bool var ( // valid _ map[int8]v _ map[uint8]v _ map[int16]v _ map[uint16]v _ map[int32]v...
Go
// ([ "$GOOS" = windows ] && echo survived SIGCHLD) || // ($G $D/$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 main import "syscall" func main() { syscall.Kill(sys...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG indirect // 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 main var m0 map[string]int var m1 *map[string]int var m2 *map[string]int = &m0 var m3 map[...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 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 main import "time" func main() { go println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil)...
Go
// errchk $G -e $D/$F.go // Copyright 2011 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. // Pass 1 label errors. package main var x int func f() { L1: // ERROR "label .*L1.* defined and not used" for { } L2: // ERROR ...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2010 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. // Test of recover during recursive panics. // Here be dragons. package main import "runtime" func main() { test1()...
Go
// $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 main import "fmt" var result string func addInt(i int) { result += fmt.Sprint(i) } func test1helper() { for i ...
Go
// $G $D/$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 main import "fmt" const ( a = iota b c d e ) var x = []int{1, 2, 3} func f(x int, len *byte) { *len = ...
Go
// $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 main const ( c0 = 0 cm1 = -1 chuge = 1 << 100 chuge_1 = chuge - 1 c1 = chuge >> 100 c3div2 = 3/2 c1e3 = 1e3...
Go
// $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 main func assert(cond bool, msg string) { if !cond { print("assertion fail: ", msg, "\n") panic(1) } } cons...
Go
// $G $D/$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. // Try to tickle stack splitting bugs by doing // go, defer, and closure calls at different stack depths. package main ...
Go
// errchk $G $D/$F.go // Copyright 2010 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 main func main() { _ = asdf // ERROR "undefined.*asdf" new = 1 // ERROR "use of builtin new not in function call|invalid lef...
Go
// $G -S $D/$F.go | egrep initdone >/dev/null && echo BUG sinit || true // Copyright 2010 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 p // Should be no init func in the assembly. // All these initializations sho...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 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. // divide corner cases package main import "fmt" func f8(x, y, q, r int8) { if t := x / y; t != q { fmt.Printf("%...
Go
// $G $D/$F.go && $L $F.$A && ./$A.out // Copyright 2011 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. // Check reordering of assignments. package main import "fmt" func main() { p1() p2() p3() p4() p5() p6() p7(...
Go
// true // Copyright 2010 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 ddd func Sum(args ...int) int { s := 0 for _, v := range args { s += v } return s }
Go
// $G $D/$F.go $D/cmplxdivide1.go && $L $D/$F.$A && ./$A.out // Copyright 2010 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. // Driver for complex division table defined in cmplxdivide1.go package main import ( "fmt" "...
Go
// $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 main var bad bool func pow10(pow int) float64 { if pow < 0 { return 1 / pow10(-pow) } if pow > 0 { return ...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { for var x = 0; x < 10; x++ { // ERROR "var declaration not allowed in for initializer"
Go
// errchk $G $D/$F.go // Copyright 2011 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 main func x() { } func main() { if { // ERROR "missing condition" } if x(); { // ERROR "missing condition" } }
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration" func main() { } x...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or newline after top level de...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or '}' or newl...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main type T // ERROR "unexpected semicolon or newline in type declaration" {
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { for x // GCCGO_ERROR "undefined" { // ERROR "unexpected semicolon or newline before .?{.?" z // GCC...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main import ( "io", // ERROR "unexpected comma" "os" )
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { if x; y // ERROR "unexpected semicolon or newline before .?{.?|undefined" { z // GCCGO_ERROR "undefi...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main var c chan int var v int func main() { if c <- v { // ERROR "send statement.*value.*select" } } var _ = c <- v // E...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { // ERROR "unexpected semicolon or newline before .?{.?"
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main type xyz struct { ch chan } // ERROR "unexpected .*}.* in channel type" func Foo(y chan) { // ERROR "unexpected .*...
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { for x; y; z // ERROR "unexpected semicolon or newline before .?{.?|undefined" { z // GCCGO_ERROR "und...
Go
// errchk $G $D/$F.go // Copyright 2011 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 main func main() { if true { } else ; // ERROR "else must be followed by if or statement block" }
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main type T interface { f, g () // ERROR "name list not allowed in interface type" }
Go
// errchk $G -e $D/$F.go // Copyright 2011 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 main func main() { switch main() := interface{}(nil).(type) { // ERROR "invalid variable name" default: } }
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { switch x; y // ERROR "unexpected semicolon or newline before .?{.?|undefined" { z
Go
// errchk $G -e $D/$F.go // Copyright 2010 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 main func main() { if x { } // GCCGO_ERROR "undefined" else { } // ERROR "unexpected semicolon or newline before .?else.?"...
Go
// errchk $G $F.go // 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. // does not compile and should not compile package main func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return v...
Go
// errchk $G -e $D/$F.go // 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 _ // ERROR "invalid package name _" func main() { _() // ERROR "cannot use _ as value" x := _+1 // ERROR "cannot use _ as v...
Go
// $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. // Semi-exhaustive test for copy() package main import ( "fmt" "os" ) const N = 40 var input8 = make([]uint8, N) var ...
Go
// errchk $G $D/$F.go // 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 main var a = []int { "a" }; // ERROR "conver|incompatible|cannot" var b = int { 1 }; // ERROR "compos" func f() int func main...
Go