|
| 1 | +// Please keep this file in alphabetical order! |
| 2 | + |
| 3 | +// RUN: %empty-directory(%t) |
| 4 | +// RUN: %target-swift-frontend -emit-module-path %t/resilient_struct.swiftmodule %S/../Inputs/resilient_struct.swift -enable-library-evolution |
| 5 | +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/resilient_objc_class.swiftmodule %S/../Inputs/resilient_objc_class.swift -I %t -enable-library-evolution -emit-objc-header-path %t/resilient_objc_class.h |
| 6 | + |
| 7 | +// RUN: cp %S/Inputs/custom-modules/module.map %t/module.map |
| 8 | + |
| 9 | +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution |
| 10 | +// RUN: %FileCheck %s --check-prefix=NO-STUBS < %t/resilient.h |
| 11 | +// RUN: %check-in-clang %t/resilient.h -I %t |
| 12 | + |
| 13 | +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution -enable-resilient-objc-class-stubs |
| 14 | +// RUN: %FileCheck %s < %t/resilient.h |
| 15 | +// RUN: %check-in-clang %t/resilient.h -I %t |
| 16 | + |
| 17 | +// REQUIRES: objc_interop |
| 18 | + |
| 19 | +import Foundation |
| 20 | +import resilient_objc_class |
| 21 | + |
| 22 | +// Note: @_fixed_layout on a class only applies to the storage layout and |
| 23 | +// not metadata, which remains resilient. |
| 24 | + |
| 25 | +// NO-STUBS-NOT: FixedLayoutNSObjectSubclass |
| 26 | + |
| 27 | +// CHECK-LABEL: SWIFT_RESILIENT_CLASS("_TtC9resilient27FixedLayoutNSObjectSubclass") |
| 28 | +// CHECK-NEXT: @interface FixedLayoutNSObjectSubclass : FixedLayoutNSObjectOutsideParent |
| 29 | +// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
| 30 | +// CHECK-NEXT: @end |
| 31 | + |
| 32 | +@_fixed_layout |
| 33 | +public class FixedLayoutNSObjectSubclass : FixedLayoutNSObjectOutsideParent {} |
| 34 | + |
| 35 | +// NO-STUBS-NOT: ResilientNSObjectSubclass |
| 36 | + |
| 37 | +// CHECK-LABEL: SWIFT_RESILIENT_CLASS("_TtC9resilient25ResilientNSObjectSubclass") |
| 38 | +// CHECK-NEXT: @interface ResilientNSObjectSubclass : ResilientNSObjectOutsideParent |
| 39 | +// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
| 40 | +// CHECK-NEXT: @end |
| 41 | + |
| 42 | +public class ResilientNSObjectSubclass : ResilientNSObjectOutsideParent {} |
| 43 | + |
| 44 | +// NO-STUBS-NOT: RenamedNSObjectSubclass |
| 45 | + |
| 46 | +// CHECK-LABEL: SWIFT_RESILIENT_CLASS_NAMED("UnrenamedNSObjectSubclass") |
| 47 | +// CHECK-NEXT: @interface RenamedNSObjectSubclass : ResilientNSObjectOutsideParent |
| 48 | +// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
| 49 | +// CHECK-NEXT: @end |
| 50 | + |
| 51 | +@objc(RenamedNSObjectSubclass) |
| 52 | +public class UnrenamedNSObjectSubclass : ResilientNSObjectOutsideParent {} |
0 commit comments