blob: f05d8d2af56dfdd765ccadfe4ae9410d7e7247f6 [file] [log] [blame]
// RUN: %target-swift-frontend -O -emit-sil %s | %FileCheck %s
// Make sure we are not looping forever.
extension Array {
mutating func new_method(_ predicate: (Element, Element) -> Bool, left : Int, right : Int) {
new_method(predicate, left: left, right: right);
}
}
var x1 = [1]
x1.new_method(<, left: 0, right: 1)
struct Test<T> {
init() {}
func recursive(x x : T) {
return recursive(x: x)
}
}
// Make sure that the specialized function calls itself.
//CHECK: sil shared @$s14spec_recursion4TestV9recursive{{[_0-9a-zA-Z]*}}FSi_Tg5
//CHECK: function_ref @$s14spec_recursion4TestV9recursive{{[_0-9a-zA-Z]*}}FSi_Tg5
//CHECK: return
var x2 = Test<Int>()
x2.recursive(x: 3)