Files
swift-mirror/test/Interop/Cxx/foreign-reference/pod-module-interface.swift
fahadnayyar 0ae0528434 [cxx-interop] convert CXXForeignReferenceTypeInitializers into SuppressCXXForeignReferenceTypeInitializers to be an opt-out flag
Turning the feature "ctor of C++ foreign reference types is callable as Swift Initializers" on by default.

rdar://148285972
2025-04-10 00:37:50 -07:00

89 lines
2.7 KiB
Swift

// RUN: %target-swift-ide-test -print-module -module-to-print=POD -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s
// CHECK: class Empty {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> Empty
// CHECK: }
// CHECK: func takesConstRefEmpty(_ e: Empty)
// CHECK: func takesConstRefEmptyDefaulted(_ e: Empty)
// CHECK: func mutateIt(_: Empty)
// CHECK-NOT: func passThroughByValue(_ x: Empty) -> Empty
// CHECK: class MultipleAttrs {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> MultipleAttrs
// CHECK: }
// CHECK: class IntPair {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: func instancePassThroughByRef(_ ref: IntPair) -> IntPair
// CHECK: class func staticPassThroughByRef(_ ref: IntPair) -> IntPair
// CHECK: class func create() -> IntPair
// CHECK: var a: Int32
// CHECK: var b: Int32
// CHECK: }
// CHECK: func mutateIt(_ x: IntPair)
// CHECK-NOT: func passThroughByValue(_ x: IntPair) -> IntPair
// CHECK: func passThroughByRef(_ x: IntPair) -> IntPair
// CHECK: class RefHoldingPair {
// CHECK: init
// CHECK-NOT: pair
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> RefHoldingPair
// CHECK: var otherValue: Int32
// CHECK: }
// CHECK: class RefHoldingPairRef {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> RefHoldingPairRef
// CHECK: var pair: IntPair
// CHECK: var otherValue: Int32
// CHECK: }
// CHECK: class RefHoldingPairPtr {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> RefHoldingPairPtr
// CHECK: var pair: IntPair
// CHECK: var otherValue: Int32
// CHECK: }
// CHECK: struct ValueHoldingPair {
// CHECK-NOT: pair
// CHECK: init()
// CHECK: func test() -> Int32
// CHECK: mutating func testMutable() -> Int32
// CHECK: static func create() -> UnsafeMutablePointer<ValueHoldingPair>
// CHECK: var otherValue: Int32
// CHECK: }
// CHECK: struct ValueHoldingPairRef {
// CHECK-NOT: pair
// CHECK: init()
// CHECK: func sub(_ other: IntPair) -> Int32
// CHECK: func max(_ other: IntPair) -> IntPair
// CHECK: }
// CHECK: class BigType {
// CHECK: init
// CHECK: func test() -> Int32
// CHECK: func testMutable() -> Int32
// CHECK: class func create() -> BigType
// CHECK: var a: Int32
// CHECK: var b: Int32
// CHECK: var buffer:
// CHECK: }
// CHECK: func mutateIt(_ x: BigType)
// CHECK-NOT: func passThroughByValue(_ x: BigType) -> BigType