Files
swift-mirror/test/SILOptimizer/spec_recursion.swift
Erik Eckstein 39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00

29 lines
701 B
Swift

// 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)