Files
swift-mirror/test/Interop/Cxx/class/closure-thunk-executable.swift
Gabor Horvath 26e672e4e0 [cxx-interop] Fix runtime crash passing FRTs as const FRT*
We should pass foreign references as Direct_Unowned calling convention,
this happened for non-const pointers. Unfortunately, we passed the const
variants as Indirect_In. This resulted in SILGen trying to insert a
non-sensical conversion. This triggered an assertion failure or a
miscompilation depending on how the compiler was compiled.

rdar://149398905
2025-04-24 14:32:58 +01:00

19 lines
372 B
Swift

// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -cxx-interoperability-mode=default)
//
// REQUIRES: executable_test
import StdlibUnittest
import Closure
var ClosureTestSuite = TestSuite("Closure")
ClosureTestSuite.test("ConvertToFunctionPointer") {
cfunc2({N in})
}
ClosureTestSuite.test("Pass FRT to function pointer") {
cppGo({N in })
}
runAllTests()