mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
19 lines
372 B
Swift
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()
|