Files
swift-mirror/test/Interop/Cxx/class/inheritance/virtual-methods-module-interface.swift
Egor Zhdan b330376a43 [cxx-interop] Pull changes from swift-6 compat mode into swift-5.9
This gives projects using C++ interop compat mode 5.9 access to the new features such as virtual methods and move-only types.

rdar://126485814
2024-04-24 11:53:31 +01:00

37 lines
1.4 KiB
Swift

// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=swift-5.9 -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=swift-6 -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
// RUN: %target-swift-ide-test -print-module -cxx-interoperability-mode=upcoming-swift -print-implicit-attrs -module-to-print=VirtualMethods -I %S/Inputs -source-filename=x | %FileCheck %s
// CHECK: struct Base {
// CHECK-NEXT: @available(*, unavailable, message: "constructors of abstract C++ classes are unavailable in Swift")
// CHECK-NEXT: init()
// CHECK-NEXT: @available(*, unavailable, message: "virtual function is not available in Swift because it is pure")
// CHECK-NEXT: mutating func foo()
// CHECK: }
// CHECK: struct Base3 {
// CHECK-NEXT: init()
// CHECK: }
// CHECK: struct Derived2 {
// CHECK-NEXT: init()
// CHECK: }
// CHECK: struct Derived<CInt> {
// CHECK-NEXT: init()
// CHECK-NEXT: mutating func foo()
// CHECK: }
// CHECK: struct VirtualNonAbstractBase {
// CHECK-NEXT: init()
// CHECK-NEXT: func nonAbstractMethod()
// CHECK: class ImmortalBase {
// CHECK: func get42() -> Int32
// CHECK: func getOverridden42() -> Int32
// CHECK: }
// CHECK: class Immortal {
// CHECK: func getOverridden42() -> Int32
// CHECK: func get42() -> Int32
// CHECK: }