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

25 lines
887 B
Swift

// RUN: %target-swift-frontend -O %s -parse-as-library -emit-sil | %FileCheck %s
public class BaseClass<T> {
func doSomething(_ value: T) -> Int {
return 1
}
}
public class DerivedClass: BaseClass<Double> {
// Don't eliminate this public method, which is called via a thunk
public override func doSomething(_ value: Double) -> Int {
return 1
}
}
// CHECK: sil_vtable BaseClass {
// CHECK: #BaseClass.doSomething!1: <T> (BaseClass<T>) -> (T) -> Int : @$s23alive_method_with_thunk9BaseClassC11doSomethingySixF // BaseClass.doSomething(_:)
// CHECK: }
// CHECK: sil_vtable DerivedClass {
// CHECK: #BaseClass.doSomething!1: <T> (BaseClass<T>) -> (T) -> Int : public @$s23alive_method_with_thunk12DerivedClassC11doSomethingySiSdFAA04BaseF0CADySixFTV [override] // vtable thunk for BaseClass.doSomething(_:) dispatching to DerivedClass.doSomething(_:)
// CHECK: }