mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This corresponds to the parameter-passing convention of the Itanium C++ ABI, in which the argument is passed indirectly and possibly modified, but not destroyed, by the callee. @in_cxx is handled the same way as @in in callers and @in_guaranteed in callees. OwnershipModelEliminator emits the call to destroy_addr that is needed to destroy the argument in the caller. rdar://122707697
20 lines
398 B
Swift
20 lines
398 B
Swift
// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -cxx-interoperability-mode=default)
|
|
//
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: OS=macosx
|
|
|
|
import StdlibUnittest
|
|
import Closure
|
|
|
|
var ClosureTestSuite = TestSuite("Closure")
|
|
|
|
ClosureTestSuite.test("ConvertToBlock") {
|
|
cfunc({NonTrivial in})
|
|
}
|
|
|
|
ClosureTestSuite.test("ConvertToBlockARCWeak") {
|
|
cfuncARCWeak({ARCWeak in})
|
|
}
|
|
|
|
runAllTests()
|