- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathresilient-ancestry.swift
52 lines (36 loc) · 2.39 KB
/
resilient-ancestry.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Please keep this file in alphabetical order!
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -target %target-pre-stable-abi-triple -emit-module-path %t/resilient_struct.swiftmodule %S/../Inputs/resilient_struct.swift -enable-library-evolution
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -target %target-pre-stable-abi-triple -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
// RUN: cp %S/Inputs/custom-modules/module.modulemap %t/module.modulemap
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -target %target-pre-stable-abi-triple %s -module-name resilient -typecheck -verify -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution
// RUN: %FileCheck %s --check-prefix=NO-STUBS < %t/resilient.h
// RUN: %check-in-clang %t/resilient.h -I %t
// REQUIRES: objc_interop
// UNSUPPORTED: OS=iosmac
// UNSUPPORTED: OS=xros
// See also resilient-ancestry.swift, for the stable ABI deployment target test.
import Foundation
import resilient_objc_class
// Note: @_fixed_layout on a class only applies to the storage layout and
// not metadata, which remains resilient.
// NO-STUBS-NOT: FixedLayoutNSObjectSubclass
// CHECK-LABEL: SWIFT_RESILIENT_CLASS("_TtC9resilient27FixedLayoutNSObjectSubclass")
// CHECK-NEXT: @interface FixedLayoutNSObjectSubclass : FixedLayoutNSObjectOutsideParent
// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: @end
@_fixed_layout
publicclassFixedLayoutNSObjectSubclass:FixedLayoutNSObjectOutsideParent{}
// NO-STUBS-NOT: ResilientNSObjectSubclass
// CHECK-LABEL: SWIFT_RESILIENT_CLASS("_TtC9resilient25ResilientNSObjectSubclass")
// CHECK-NEXT: @interface ResilientNSObjectSubclass : ResilientNSObjectOutsideParent
// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: @end
publicclassResilientNSObjectSubclass:ResilientNSObjectOutsideParent{}
// NO-STUBS-NOT: RenamedNSObjectSubclass
// CHECK-LABEL: SWIFT_RESILIENT_CLASS_NAMED("UnrenamedNSObjectSubclass")
// CHECK-NEXT: @interface RenamedNSObjectSubclass : ResilientNSObjectOutsideParent
// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
// CHECK-NEXT: @end
@objc(RenamedNSObjectSubclass)
publicclassUnrenamedNSObjectSubclass:ResilientNSObjectOutsideParent{}