Skip to content

Commit

Permalink
Add regression test to close #43069
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyLatsis committed Jun 23, 2022
1 parent 767423a commit af568b5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/IRGen/recursion_infinite_optimized.sil
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// RUN: %target-swift-emit-ir %s -O | %FileCheck %s

// https://github.com/apple/swift/issues/43069

sil_stage canonical

import Swift

sil @rec : $@convention(thin) (Int) -> Int {
bb0(%arg : $Int):
%ref = function_ref @rec : $@convention(thin) (Int) -> Int
%res = apply %ref(%arg) : $@convention(thin) (Int) -> Int
return %res : $Int
}

// CHECK: define {{.*}} swiftcc [[T:i[0-9]+]] @rec([[T]] %0) #0 {
// CHECK-NEXT: entry:
// CHECK-NEXT: br label %tailrecurse
// CHECK-EMPTY:
// CHECK-NEXT: tailrecurse:
// CHECK-NEXT: br label %tailrecurse
// CHECK-NEXT: }

0 comments on commit af568b5

Please sign in to comment.