|
1 | | -// RUN: %target-swift-frontend -primary-file %s -O -sil-verify-all -Xllvm -sil-disable-pass=function-signature-opts -module-name=test -O -target %target-cpu-apple-macos10.14 -emit-sil | %FileCheck --check-prefix=CHECK-SWIFT4x %s |
2 | | -// RUN: %target-swift-frontend -primary-file %s -O -sil-verify-all -Xllvm -sil-disable-pass=function-signature-opts -module-name=test -O -target %target-cpu-apple-macos10.15 -emit-sil | %FileCheck --check-prefix=CHECK-SWIFT50 %s |
| 1 | +// RUN: %target-swift-frontend -primary-file %s -O -sil-verify-all -Xllvm -sil-disable-pass=function-signature-opts -module-name=test -O -target %target-cpu-apple-macos10.15 -emit-sil | %FileCheck %s |
3 | 2 |
|
4 | 3 | // RUN: %empty-directory(%t) |
5 | 4 | // RUN: %target-build-swift -O -Xllvm -sil-disable-pass=function-signature-opts -module-name=test %s -o %t/a.out |
|
12 | 11 | // Check that the optimizer can remove "unbalanced" retains for immortal objects. |
13 | 12 | // But only with a Swift 5.1 runtime (which supports immortal objects). |
14 | 13 |
|
15 | | -// CHECK-SWIFT4x-LABEL: sil hidden [noinline] @$s4test10emptyArraySaySiGyF |
16 | | -// CHECK-SWIFT4x: global_addr |
17 | | -// CHECK-SWIFT4x: retain |
18 | | -// CHECK-SWIFT4x: } // end sil function '$s4test10emptyArraySaySiGyF' |
19 | | - |
20 | | -// CHECK-SWIFT50-LABEL: sil hidden [noinline] @$s4test10emptyArraySaySiGyF |
21 | | -// CHECK-SWIFT50: global_addr |
22 | | -// CHECK-SWIFT50-NOT: retain |
23 | | -// CHECK-SWIFT50: } // end sil function '$s4test10emptyArraySaySiGyF' |
| 14 | +// CHECK-LABEL: sil hidden [noinline] @$s4test10emptyArraySaySiGyF |
| 15 | +// CHECK: global_addr |
| 16 | +// CHECK-NOT: retain |
| 17 | +// CHECK: } // end sil function '$s4test10emptyArraySaySiGyF' |
24 | 18 | @inline(never) |
25 | 19 | func emptyArray() -> [Int] { |
26 | 20 | let x = [Int]() |
27 | 21 | return x |
28 | 22 | } |
29 | 23 |
|
30 | | -// CHECK-SWIFT4x-LABEL: sil hidden [noinline] @$s4test13constantArraySaySiGyF |
31 | | -// CHECK-SWIFT4x: global_value |
32 | | -// CHECK-SWIFT4x: retain |
33 | | -// CHECK-SWIFT4x: } // end sil function '$s4test13constantArraySaySiGyF' |
34 | | - |
35 | | -// CHECK-SWIFT50-LABEL: sil hidden [noinline] @$s4test13constantArraySaySiGyF |
36 | | -// CHECK-SWIFT50: global_value |
37 | | -// CHECK-SWIFT50-NOT: retain |
38 | | -// CHECK-SWIFT50: } // end sil function '$s4test13constantArraySaySiGyF' |
| 24 | +// CHECK-LABEL: sil hidden [noinline] @$s4test13constantArraySaySiGyF |
| 25 | +// CHECK: global_value |
| 26 | +// CHECK-NOT: retain |
| 27 | +// CHECK: } // end sil function '$s4test13constantArraySaySiGyF' |
39 | 28 | @inline(never) |
40 | 29 | func constantArray() -> [Int] { |
41 | 30 | return [1, 2, 3] |
|
0 commit comments