Skip to content

Commit 42649b3

Browse files
authored
Merge pull request #10468 from eeckstein/convert-benchmark
2 parents dc3e6c1 + f45bddc commit 42649b3

File tree

4 files changed

+38
-36
lines changed

4 files changed

+38
-36
lines changed

benchmark/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ set(SWIFT_BENCH_MODULES
5050
single-source/ErrorHandling
5151
single-source/ExistentialPerformance
5252
single-source/Fibonacci
53-
single-source/GlobalClass
5453
single-source/Hanoi
5554
single-source/Hash
5655
single-source/HashQuadratic

benchmark/single-source/GlobalClass.swift

Lines changed: 0 additions & 33 deletions
This file was deleted.

benchmark/utils/main.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ import DropWhile
5555
import ErrorHandling
5656
import ExistentialPerformance
5757
import Fibonacci
58-
import GlobalClass
5958
import Hanoi
6059
import Hash
6160
import HashQuadratic
@@ -237,7 +236,6 @@ addTo(&precommitTests, "EqualSubstringString", run_EqualSubstringString)
237236
addTo(&precommitTests, "EqualSubstringSubstring", run_EqualSubstringSubstring)
238237
addTo(&precommitTests, "EqualSubstringSubstringGenericEquatable", run_EqualSubstringSubstringGenericEquatable)
239238
addTo(&precommitTests, "ErrorHandling", run_ErrorHandling)
240-
addTo(&precommitTests, "GlobalClass", run_GlobalClass)
241239
addTo(&precommitTests, "Hanoi", run_Hanoi)
242240
addTo(&precommitTests, "HashTest", run_HashTest)
243241
addTo(&precommitTests, "Histogram", run_Histogram)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// RUN: %target-swift-frontend -parse-as-library -O -emit-sil %s | %FileCheck %s
2+
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib,CPU=x86_64
3+
4+
// Test inline cache with a global class. Make sure the retain|release pair
5+
// for the fast path is removed in the loop.
6+
7+
open class A
8+
{
9+
open func f(_ a: Int) -> Int
10+
{
11+
return a + 1
12+
}
13+
}
14+
15+
var x = 0
16+
public var a = A()
17+
18+
public func testit() {
19+
// CHECK-LABEL: sil @{{.*}}testityyF
20+
// CHECK: bb0:
21+
// CHECK-NOT: {{.*(retain|release).*}}
22+
// CHECK: checked_cast_br
23+
// CHECK: bb1{{.*}}:
24+
// CHECK-NOT: {{.*(retain|release).*}}
25+
// CHECK: return
26+
// CHECK: bb2{{.*}}:
27+
// CHECK-NOT: {{.*(retain|release|apply).*}}
28+
// CHECK: br bb1
29+
// CHECK: bb3{{.*}}:
30+
// CHECK-NEXT: class_method
31+
// CHECK-NEXT: strong_retain
32+
// CHECK-NEXT: apply
33+
// CHECK-NEXT: strong_release
34+
// CHECK-NEXT: br bb1
35+
36+
x = a.f(x)
37+
}
38+

0 commit comments

Comments
 (0)