Files
swift-mirror/test/SILOptimizer/devirtualize_existential.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

20 lines
449 B
Swift

// RUN: %target-swift-frontend %s -O -emit-sil | %FileCheck %s
protocol Pingable {
func ping(_ x : Int);
}
class Foo : Pingable {
func ping(_ x : Int) { var t : Int }
}
// Everything gets devirtualized, inlined, and promoted to the stack.
//CHECK: @$s24devirtualize_existential17interesting_stuffyyF
//CHECK-NOT: init_existential_addr
//CHECK-NOT: apply
//CHECK: return
public func interesting_stuff() {
var x : Pingable = Foo()
x.ping(1)
}