blob: 4eb809835790c39425da7ed431c52221c0a3685f [file] [log] [blame]
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -O %s -o %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s
// REQUIRES: executable_test
// Check that ArrayElementPropagation does not crash when compiling this function.
@inline(never)
func testit(_ arr: inout [Int]) {
let a = [28]
arr += [a[0]]
}
var a = [27]
testit(&a)
// As a bonus, also check if the code works as expected.
// CHECK: [27, 28]
print(a)