diff options
Diffstat (limited to 'llgo/test/execution/slices/copy.go')
| -rw-r--r-- | llgo/test/execution/slices/copy.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llgo/test/execution/slices/copy.go b/llgo/test/execution/slices/copy.go new file mode 100644 index 00000000000..a6bf6c56454 --- /dev/null +++ b/llgo/test/execution/slices/copy.go @@ -0,0 +1,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 +} |

