|
4 | 4 | // RUN: %target-codesign %t/%target-library-name(layout_string_witnesses_types)
|
5 | 5 | // RUN: %target-swift-frontend -enable-experimental-feature LayoutStringValueWitnesses -enable-experimental-feature LayoutStringValueWitnessesInstantiation -enable-layout-string-value-witnesses -enable-layout-string-value-witnesses-instantiation -enable-library-evolution -enable-autolinking-runtime-compatibility-bytecode-layouts -emit-module -emit-module-path=%t/layout_string_witnesses_types_resilient.swiftmodule %S/Inputs/layout_string_witnesses_types_resilient.swift
|
6 | 6 | // RUN: %target-build-swift -g -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnessesInstantiation -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -enable-layout-string-value-witnesses-instantiation -Xfrontend -enable-library-evolution -c -parse-as-library -o %t/layout_string_witnesses_types_resilient.o %S/Inputs/layout_string_witnesses_types_resilient.swift
|
7 |
| -// RUN: %target-build-swift -g -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnesses -Xfrontend -enable-experimental-feature -Xfrontend LayoutStringValueWitnessesInstantiation -Xfrontend -enable-layout-string-value-witnesses -Xfrontend -enable-layout-string-value-witnesses-instantiation -Xfrontend -enable-type-layout -parse-stdlib -module-name layout_string_witnesses_dynamic -llayout_string_witnesses_types -L%t %t/layout_string_witnesses_types_resilient.o -I %t -o %t/main %s %target-rpath(%t) |
| 7 | +// RUN: %target-build-swift -g -parse-stdlib -module-name layout_string_witnesses_dynamic -llayout_string_witnesses_types -L%t %t/layout_string_witnesses_types_resilient.o -I %t -o %t/main %s %target-rpath(%t) |
8 | 8 | // RUN: %target-codesign %t/main
|
9 | 9 | // RUN: %target-run %t/main %t/%target-library-name(layout_string_witnesses_types) | %FileCheck %s --check-prefix=CHECK -check-prefix=CHECK-%target-os
|
10 | 10 |
|
@@ -92,7 +92,35 @@ func testGeneric() {
|
92 | 92 |
|
93 | 93 | testGeneric()
|
94 | 94 |
|
95 |
| -func testPrespecializedStructAnyObject() { |
| 95 | +func testGenericAny() { |
| 96 | + let ptr = allocateInternalGenericPtr(of: Any.self) |
| 97 | + |
| 98 | + do { |
| 99 | + let x: Any = TestClass() |
| 100 | + testGenericInit(ptr, to: x as Any) |
| 101 | + } |
| 102 | + |
| 103 | + do { |
| 104 | + let y: Any = TestClass() |
| 105 | + // CHECK: Before deinit |
| 106 | + print("Before deinit") |
| 107 | + |
| 108 | + // CHECK-NEXT: TestClass deinitialized! |
| 109 | + testGenericAssign(ptr, from: y as Any) |
| 110 | + } |
| 111 | + |
| 112 | + // CHECK-NEXT: Before deinit |
| 113 | + print("Before deinit") |
| 114 | + |
| 115 | + // CHECK-NEXT: TestClass deinitialized! |
| 116 | + testGenericDestroy(ptr, of: Any.self) |
| 117 | + |
| 118 | + ptr.deallocate() |
| 119 | +} |
| 120 | + |
| 121 | +testGenericAny() |
| 122 | + |
| 123 | +func testPrespecializedAnyObject() { |
96 | 124 | let ptr = UnsafeMutablePointer<PrespecializedStruct<AnyObject>>.allocate(capacity: 1)
|
97 | 125 |
|
98 | 126 | do {
|
@@ -120,7 +148,7 @@ func testPrespecializedStructAnyObject() {
|
120 | 148 | ptr.deallocate()
|
121 | 149 | }
|
122 | 150 |
|
123 |
| -testPrespecializedStructAnyObject() |
| 151 | +testPrespecializedAnyObject() |
124 | 152 |
|
125 | 153 | func testPrespecializedStructSimpleClass() {
|
126 | 154 | let ptr = UnsafeMutablePointer<PrespecializedStruct<SimpleClass>>.allocate(capacity: 1)
|
@@ -866,7 +894,7 @@ func testResilientSinglePayloadEnumComplexTag() {
|
866 | 894 | testResilientSinglePayloadEnumComplexTag()
|
867 | 895 |
|
868 | 896 | func testResilientMultiPayloadEnumTag() {
|
869 |
| - let x = switch getResilientMultiPayloadEnumEmpty0() { |
| 897 | + let x = switch getResilientMultiPayloadEnumEmpty0(AnyObject.self) { |
870 | 898 | case .nonEmpty0: 0
|
871 | 899 | case .nonEmpty1: 1
|
872 | 900 | case .empty0: 2
|
|
0 commit comments