Skip to content

Commit 0aba7b6

Browse files
committed
Update various tests for enabling mandatory copy propagation.
1 parent 8839ca0 commit 0aba7b6

12 files changed

+49
-16
lines changed

test/Constraints/keypath_dynamic_member_lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var lens = Lens(Rectangle(topLeft: topLeft,
4242
// CHECK: function_ref @$s29keypath_dynamic_member_lookup4LensV0B6MemberACyqd__Gs15WritableKeyPathCyxqd__G_tcluig
4343
// CHECK-NEXT: apply %45<Rectangle, Point>({{.*}})
4444
// CHECK: function_ref @$s29keypath_dynamic_member_lookup4LensV0B6MemberACyqd__Gs7KeyPathCyxqd__G_tcluig
45-
// CHECK-NEXT: apply %54<Point, Int>({{.*}})
45+
// CHECK-NEXT: apply %{{.*}}<Point, Int>({{.*}})
4646
_ = lens.topLeft.x
4747

4848
// CHECK: function_ref @$s29keypath_dynamic_member_lookup4LensV0B6MemberACyqd__Gs15WritableKeyPathCyxqd__G_tcluig

test/DebugInfo/capturelist.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class C {
33
func withClosure(_ : () -> ()) -> () {}
44

55
func f() {
6-
// CHECK: define{{.*}}$s11capturelist1CC1fyyFyyXEfU_
6+
// CHECK-LABEL: define{{.*}}$s11capturelist1CC1fyyFyyXEfU_
77
// There should not be a local weak variable "self" shadowing the
88
// implicit self argument.
99
// let self
@@ -12,7 +12,7 @@ class C {
1212
// CHECK: call void @llvm.dbg
1313
// var weak self
1414
// CHECK-NOT: call void @llvm.dbg
15-
// CHECK: ret void
15+
// CHECK-LABEL: ret void
1616
withClosure { [weak self] in
1717
guard let s = self else { return }
1818
}

test/DebugInfo/if-branchlocations.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %target-swift-frontend %s -emit-sil -emit-verbose-sil -g -o - | %FileCheck %s
1+
// RUN: %target-swift-frontend %s -emit-sil -disable-copy-propagation -emit-verbose-sil -g -o - | %FileCheck %s --check-prefixes=CHECK,CHECK-NCP
2+
// RUN: %target-swift-frontend %s -emit-sil -enable-copy-propagation -emit-verbose-sil -g -o - | %FileCheck %s --check-prefixes=CHECK,CHECK-CP
23

34
class NSURL {}
45

@@ -26,14 +27,15 @@ class AppDelegate {
2627
// Verify that the branch's location is >= the cleanup's location.
2728
// (The implicit false block of the conditional
2829
// below inherits the location from the condition.)
30+
// CHECK-CP: destroy_value [poison] {{.*}}$NSPathControlItem{{.*}}line:[[@LINE+2]]
2931
// CHECK: br{{.*}}line:[[@LINE+1]]
3032
if let url = item.URL
3133
{
3234
LogStr( "There is a url" )
3335
}
3436
// Verify that the branch's location is >= the cleanup's location.
35-
// CHECK: strong_release{{.*}}$NSPathControlItem{{.*}}line:[[@LINE+2]]
36-
// CHECK-NEXT: br{{.*}}line:[[@LINE+1]]
37+
// CHECK-NCP: strong_release{{.*}}$NSPathControlItem{{.*}}line:[[@LINE+2]]
38+
// CHECK: br{{.*}}line:[[@LINE+1]]
3739
}
3840
}
3941
}

test/DebugInfo/linetable-do.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle %s -emit-ir -g -o - | %FileCheck %s
2-
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle %s -emit-sil -emit-verbose-sil -g -o - | %FileCheck -check-prefix=CHECK-SIL %s
2+
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -disable-copy-propagation %s -emit-sil -emit-verbose-sil -g -o - | %FileCheck --check-prefixes=CHECK-SIL,CHECK-NCP %s
3+
// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -enable-copy-propagation %s -emit-sil -emit-verbose-sil -g -o - | %FileCheck --check-prefixes=CHECK-SIL,CHECK-CP %s
34
import StdlibUnittest
45

56
class Obj {}
@@ -16,9 +17,10 @@ func testDoStmt() throws -> Void {
1617
do {
1718
let obj = Obj()
1819
_blackHole(obj)
20+
// CHECK-CP: destroy_value [poison] %{{.*}} : $Obj{{.*}} line:[[@LINE+1]]:13:auto_gen
1921
try foo(100)
2022
// CHECK-SIL: bb{{.*}}(%{{[0-9]+}} : $()):
21-
// CHECK-SIL-NEXT: strong_release {{.*}}: $Obj{{.*}} line:[[@LINE+1]]:3:cleanup
23+
// CHECK-NCP-NEXT: strong_release {{.*}}: $Obj{{.*}} line:[[@LINE+1]]:3:cleanup
2224
}
2325
// CHECK-SIL-NEXT: = tuple ()
2426
// CHECK-SIL-NEXT: return {{.*}} line:[[@LINE+1]]

test/Interpreter/SDK/AnyObject_native_interop.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ autoreleasepool {
1616

1717
// CHECK: {{^}}main.FullyNative{{$}}
1818
print(c.description!)
19+
_fixLifetime(c)
1920
}
2021
// CHECK-NEXT: dead
2122

test/SILOptimizer/closure_lifetime_fixup.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend %S/../Inputs/resilient_struct.swift -enable-library-evolution -emit-module -emit-module-path %t/resilient_struct.swiftmodule
33
// RUN: %target-swift-frontend %S/../Inputs/resilient_enum.swift -I %t -enable-library-evolution -emit-module -emit-module-path %t/resilient_enum.swiftmodule
4-
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil -I %t -o - | %FileCheck %s --check-prefix=CHECK --check-prefix=%target-os
4+
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil -disable-copy-propagation -I %t -o - | %FileCheck %s --check-prefix=CHECK --check-prefix=%target-os
5+
6+
// Using -disable-copy-propagation to pattern match against older SIL
7+
// output. At least until -enable-copy-propagation has been around
8+
// long enough in the same form to be worth rewriting CHECK lines.
59

610
import resilient_struct
711
import resilient_enum

test/SILOptimizer/closure_lifetime_fixup_objc.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil -o - -I %S/Inputs/usr/include | %FileCheck %s
1+
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil -disable-copy-propagation -o - -I %S/Inputs/usr/include | %FileCheck %s
22
// REQUIRES: objc_interop
33

4+
// Using -disable-copy-propagation to pattern match against older SIL
5+
// output. At least until -enable-copy-propagation has been around
6+
// long enough in the same form to be worth rewriting CHECK lines.
7+
48
import Foundation
59
import ClosureLifetimeFixupObjC
610

test/SILOptimizer/definite-init-convert-to-escape.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
// RUN: %target-swift-frontend -module-name A -verify -emit-sil -import-objc-header %S/Inputs/Closure.h -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
2-
// RUN: %target-swift-frontend -module-name A -verify -emit-sil -import-objc-header %S/Inputs/Closure.h -disable-objc-attr-requires-foundation-module -Xllvm -sil-disable-convert-escape-to-noescape-switch-peephole %s | %FileCheck %s --check-prefix=NOPEEPHOLE
1+
// RUN: %target-swift-frontend -module-name A -verify -emit-sil -import-objc-header %S/Inputs/Closure.h -disable-copy-propagation -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
2+
// RUN: %target-swift-frontend -module-name A -verify -emit-sil -import-objc-header %S/Inputs/Closure.h -disable-copy-propagation -disable-objc-attr-requires-foundation-module -Xllvm -sil-disable-convert-escape-to-noescape-switch-peephole %s | %FileCheck %s --check-prefix=NOPEEPHOLE
3+
//
4+
// Using -disable-copy-propagation to pattern match against older SIL
5+
// output. At least until -enable-copy-propagation has been around
6+
// long enough in the same form to be worth rewriting CHECK lines.
37

48
// REQUIRES: objc_interop
59

test/SILOptimizer/definite_init_failable_initializers.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// RUN: %target-swift-frontend -emit-sil %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-sil -disable-copy-propagation %s | %FileCheck %s
2+
3+
// Using -disable-copy-propagation to pattern match against older SIL
4+
// output. At least until -enable-copy-propagation has been around
5+
// long enough in the same form to be worth rewriting CHECK lines.
26

37
// High-level tests that DI handles early returns from failable and throwing
48
// initializers properly. The main complication is conditional release of self

test/SILOptimizer/definite_init_failable_initializers_objc.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
// RUN: %target-swift-frontend -emit-sil -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-sil -disable-copy-propagation -disable-objc-attr-requires-foundation-module %s | %FileCheck %s
2+
3+
// Using -disable-copy-propagation to pattern match against older SIL
4+
// output. At least until -enable-copy-propagation has been around
5+
// long enough in the same form to be worth rewriting CHECK lines.
26

37
// REQUIRES: objc_interop
48

0 commit comments

Comments
 (0)