Files
swift-mirror/test/embedded/dynamic-functions.swift
Erik Eckstein 0c8877ea33 CrossModuleOptimization: fix a crash with dynamic functions
Use the correct `FunctionRefBaseInst` API to get the callee.

Fixes a compiler crash when using `dynamic` functions in embedded swift.
rdar://162309631
2025-10-13 07:41:39 +02:00

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