mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The purpose of the benchmark was to check a very specific ARC optimization, which is better tested with a lit test. Beside that, the benchmark was broken anyway.
39 lines
887 B
Swift
39 lines
887 B
Swift
// RUN: %target-swift-frontend -parse-as-library -O -emit-sil %s | %FileCheck %s
|
|
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib,CPU=x86_64
|
|
|
|
// Test inline cache with a global class. Make sure the retain|release pair
|
|
// for the fast path is removed in the loop.
|
|
|
|
open class A
|
|
{
|
|
open func f(_ a: Int) -> Int
|
|
{
|
|
return a + 1
|
|
}
|
|
}
|
|
|
|
var x = 0
|
|
public var a = A()
|
|
|
|
public func testit() {
|
|
// CHECK-LABEL: sil @{{.*}}testityyF
|
|
// CHECK: bb0:
|
|
// CHECK-NOT: {{.*(retain|release).*}}
|
|
// CHECK: checked_cast_br
|
|
// CHECK: bb1{{.*}}:
|
|
// CHECK-NOT: {{.*(retain|release).*}}
|
|
// CHECK: return
|
|
// CHECK: bb2{{.*}}:
|
|
// CHECK-NOT: {{.*(retain|release|apply).*}}
|
|
// CHECK: br bb1
|
|
// CHECK: bb3{{.*}}:
|
|
// CHECK-NEXT: class_method
|
|
// CHECK-NEXT: strong_retain
|
|
// CHECK-NEXT: apply
|
|
// CHECK-NEXT: strong_release
|
|
// CHECK-NEXT: br bb1
|
|
|
|
x = a.f(x)
|
|
}
|
|
|