summaryrefslogtreecommitdiff
path: root/misc/cgo/life
diff options
context:
space:
mode:
Diffstat (limited to 'misc/cgo/life')
-rw-r--r--misc/cgo/life/life.go6
-rw-r--r--misc/cgo/life/main.go4
-rw-r--r--misc/cgo/life/main.out (renamed from misc/cgo/life/golden.out)1
-rwxr-xr-xmisc/cgo/life/test.bash14
4 files changed, 7 insertions, 18 deletions
diff --git a/misc/cgo/life/life.go b/misc/cgo/life/life.go
index ec000ce3a..fda5495e5 100644
--- a/misc/cgo/life/life.go
+++ b/misc/cgo/life/life.go
@@ -1,3 +1,5 @@
+// skip
+
// 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.
@@ -9,8 +11,8 @@ import "C"
import "unsafe"
-func Run(gen, x, y int, a []int) {
- n := make([]int, x*y)
+func Run(gen, x, y int, a []int32) {
+ n := make([]int32, x*y)
for i := 0; i < gen; i++ {
C.Step(C.int(x), C.int(y), (*C.int)(unsafe.Pointer(&a[0])), (*C.int)(unsafe.Pointer(&n[0])))
copy(a, n)
diff --git a/misc/cgo/life/main.go b/misc/cgo/life/main.go
index 47ae0e18c..725e10f76 100644
--- a/misc/cgo/life/main.go
+++ b/misc/cgo/life/main.go
@@ -1,3 +1,5 @@
+// cmpout
+
// 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.
@@ -22,7 +24,7 @@ var gen = flag.Int("gen", 10, "generations")
func main() {
flag.Parse()
- var a [MAXDIM * MAXDIM]int
+ var a [MAXDIM * MAXDIM]int32
for i := 2; i < *dim; i += 8 {
for j := 2; j < *dim-3; j += 8 {
for y := 0; y < 3; y++ {
diff --git a/misc/cgo/life/golden.out b/misc/cgo/life/main.out
index 539d2106d..26fc9c6e3 100644
--- a/misc/cgo/life/golden.out
+++ b/misc/cgo/life/main.out
@@ -1,4 +1,3 @@
-* life
XXX XXX
diff --git a/misc/cgo/life/test.bash b/misc/cgo/life/test.bash
deleted file mode 100755
index bb483522c..000000000
--- a/misc/cgo/life/test.bash
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-# 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.
-
-set -e
-go build -o life main.go
-
-echo '*' life >run.out
-./life >>run.out
-diff run.out golden.out
-
-rm -f life
-