// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test nil.
+
package main
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that the implementation catches nil ptr indirection
+// in a large address space.
+
package main
import "unsafe"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that types can be parenthesized.
+
package main
func f(interface{})
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that heavy recursion works. Simple torture test for
+// segmented stacks: do math in unary by recursion.
+
package main
type Number *Number
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that big numbers work as constants and print can print them.
+
package main
func main() {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test the 'for range' construct.
+
package main
// test range over channels
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test recovering from runtime errors.
+
package main
import (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test that predeclared names can be redeclared by the user.
+
package main
import "fmt"
func main() {
n :=
- bool +
+ append +
+ bool +
byte +
- float +
+ complex +
+ complex64 +
+ complex128 +
+ cap +
+ close +
+ delete +
+ error +
+ false +
float32 +
float64 +
+ imag +
int +
int8 +
int16 +
int32 +
int64 +
+ len +
+ make +
+ new +
+ nil +
+ panic +
+ print +
+ println +
+ real +
+ recover +
+ rune +
+ string +
+ true +
uint +
uint8 +
uint16 +
uint32 +
uint64 +
uintptr +
- true +
- false +
- iota +
- nil +
- cap +
- len +
- make +
- new +
- panic +
- print +
- println
- if n != 27*28/2 {
- fmt.Println("BUG: wrong n", n, 27*28/2)
+ iota
+ if n != NUM*(NUM-1)/2 {
+ fmt.Println("BUG: wrong n", n, NUM*(NUM-1)/2)
}
}
const (
- bool = 1
- byte = 2
- float = 3
- float32 = 4
- float64 = 5
- int = 6
- int8 = 7
- int16 = 8
- int32 = 9
- int64 = 10
- uint = 11
- uint8 = 12
- uint16 = 13
- uint32 = 14
- uint64 = 15
- uintptr = 16
- true = 17
- false = 18
- iota = 19
- nil = 20
- cap = 21
- len = 22
- make = 23
- new = 24
- panic = 25
- print = 26
- println = 27
+ append = iota
+ bool
+ byte
+ complex
+ complex64
+ complex128
+ cap
+ close
+ delete
+ error
+ false
+ float32
+ float64
+ imag
+ int
+ int8
+ int16
+ int32
+ int64
+ len
+ make
+ new
+ nil
+ panic
+ print
+ println
+ real
+ recover
+ rune
+ string
+ true
+ uint
+ uint8
+ uint16
+ uint32
+ uint64
+ uintptr
+ NUM
+ iota = 0
)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Verify that renamed identifiers no longer have their old meaning.
+// Does not compile.
+
package main
func main() {
var n byte // ERROR "not a type|expected type"
- var y = float(0) // ERROR "cannot call|expected function"
+ var y = float32(0) // ERROR "cannot call|expected function"
const (
a = 1 + iota // ERROR "string|incompatible types" "convert iota"
)
}
const (
- bool = 1
- byte = 2
- float = 3
- float32 = 4
- float64 = 5
- int = 6
- int8 = 7
- int16 = 8
- int32 = 9
- int64 = 10
- uint = 11
- uint8 = 12
- uint16 = 13
- uint32 = 14
- uint64 = 15
- uintptr = 16
- true = 17
- false = 18
- iota = "abc"
- nil = 20
- cap = 21
- len = 22
- make = 23
- new = 24
- panic = 25
- print = 26
- println = 27
+ append = iota
+ bool
+ byte
+ complex
+ complex64
+ complex128
+ cap
+ close
+ delete
+ error
+ false
+ float32
+ float64
+ imag
+ int
+ int8
+ int16
+ int32
+ int64
+ len
+ make
+ new
+ nil
+ panic
+ print
+ println
+ real
+ recover
+ rune
+ string
+ true
+ uint
+ uint8
+ uint16
+ uint32
+ uint64
+ uintptr
+ NUM
+ iota = "123"
)
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Check reordering of assignments.
+// Test reordering of assignments.
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// derived from fixedbugs/bug294.go
+// Test reorderings; derived from fixedbugs/bug294.go.
package main
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// Test rune constants, expressions and types.
+// Compiles but does not run.
+
package rune
var (
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// make sure that even if a file imports runtime,
+// Test that even if a file imports runtime,
// it cannot get at the low-level runtime definitions
-// known to the compiler. for normal packages
+// known to the compiler. For normal packages
// the compiler doesn't even record the lower case
// functions in its symbol table, but some functions
// in runtime are hard-coded into the compiler.
+// Does not compile.
package main