mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This results in wrong argument/return calling conventions. First, the method call must be specialized. Only then the call can be de-virtualized. Usually, it's done in this order anyway, because the `class_method` instruction is located before the `apply`. But when inlining functions, the order (in the worklist) can be the other way round. Fixes a compiler crash. rdar://154631438
23 lines
462 B
Swift
23 lines
462 B
Swift
// RUN: %target-swift-frontend %s -parse-as-library -enable-experimental-feature Embedded -Xllvm -sil-disable-pass=mandatory-inlining -emit-ir -o /dev/null
|
|
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
|
|
// Check that the compiler doesn't crash
|
|
|
|
public class Base<T> {
|
|
func foo(_ t: T) -> T {
|
|
return t
|
|
}
|
|
}
|
|
|
|
@_transparent
|
|
func callee(_ i: Int, _ c: Base<Int>) -> Int {
|
|
return c.foo(i)
|
|
}
|
|
|
|
public func testit(_ i : Int) -> Int {
|
|
return callee(i, Base<Int>())
|
|
}
|
|
|