summaryrefslogtreecommitdiffstats
path: root/llgo/test/execution/slices/copy.go
blob: a6bf6c56454aa687f4b6a047e76adc009299d923 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: llgo -o %t %s
// RUN: %t 2>&1 | FileCheck %s

// CHECK: 5
// CHECK-NEXT: 0

package main

func main() {
	a := make([]int, 10)
	b := make([]int, 10)
	for i, _ := range b {
		b[i] = 1
	}
	println(copy(a[:5], b)) // expect 5
	println(a[5])           // expect 0
}
OpenPOWER on IntegriCloud