mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Use the correct `FunctionRefBaseInst` API to get the callee. Fixes a compiler crash when using `dynamic` functions in embedded swift. rdar://162309631
15 lines
371 B
Swift
15 lines
371 B
Swift
// RUN: %target-swift-frontend %s -g -enable-experimental-feature Embedded -emit-ir | %FileCheck %s
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
|
|
// CHECK-LABEL: define {{.*}} @"$e4main3fooyS2iF"
|
|
// CHECK: call ptr @swift_getFunctionReplacement
|
|
// CHECK: ret
|
|
dynamic func foo(_ i: Int) -> Int {
|
|
return i
|
|
}
|
|
|
|
public func test(_ i: Int) -> Int {
|
|
return foo(i)
|
|
}
|