Skip to content

Commit 2d5e591

Browse files
committed
Add regression test to close #43069
1 parent 767423a commit 2d5e591

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %target-swift-emit-ir %s -O | %FileCheck %s
2+
3+
// https://github.com/apple/swift/issues/43069
4+
5+
sil_stage canonical
6+
7+
import Swift
8+
9+
sil @rec : $@convention(thin) (Int) -> Int {
10+
bb0(%arg : $Int):
11+
%ref = function_ref @rec : $@convention(thin) (Int) -> Int
12+
%res = apply %ref(%arg) : $@convention(thin) (Int) -> Int
13+
return %res : $Int
14+
}
15+
16+
// CHECK: define{{.*}} swiftcc [[T:i[0-9]+]] @rec([[T]] %0) #0 {
17+
// CHECK-NEXT: entry:
18+
// CHECK-NEXT: br label %tailrecurse
19+
// CHECK-EMPTY:
20+
// CHECK-NEXT: tailrecurse:
21+
// CHECK-NEXT: br label %tailrecurse
22+
// CHECK-NEXT: }

0 commit comments

Comments
 (0)