aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go')
-rw-r--r--gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go b/gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go
new file mode 100644
index 000000000..516a131e4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/go.go-torture/execute/array-2.go
@@ -0,0 +1,19 @@
+package main
+
+func fn(a []int) int {
+ alen := len(a);
+ for i := 0; i < alen; i++ {
+ a[i] = i
+ }
+ return alen;
+}
+
+func main() {
+ var a [2]int;
+ if fn(a[0:]) != 2 {
+ panic(0);
+ }
+ if a[0] != 0 || a[1] != 1 {
+ panic(1);
+ }
+}