mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
22 lines
463 B
Swift
22 lines
463 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift -O %s -o %t/a.out
|
|
// RUN: %target-codesign %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)
|
|
|