Skip to content

Commit 1b458c8

Browse files
committed
Augment test/SILGen/objc_imported_generic.swift to ensure it gets through IRGen.
The crashing cases all appear to work now thanks to some help from @rjmccall, except for an IRGen issue with providing dependent associated type metadata for protocol witness thunks (rdar://problem/26602097).
1 parent e2d8ddc commit 1b458c8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/SILGen/objc_imported_generic.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-silgen %s | FileCheck %s
2+
// For integration testing, ensure we get through IRGen too.
3+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -verify -DIRGEN_INTEGRATION_TEST %s
4+
25
// REQUIRES: objc_interop
36

47
import objc_generics
@@ -54,7 +57,13 @@ protocol ThingHolder {
5457
var propertyArrayOfThings: [Thing]? { get set }
5558
}
5659

60+
// TODO: Crashes in IRGen because the type metadata for `T` is not found in
61+
// the witness thunk to satisfy the associated type requirement. This could be
62+
// addressed by teaching IRGen to fulfill erased type parameters from protocol
63+
// witness tables (rdar://problem/26602097).
64+
#if !IRGEN_INTEGRATION_TEST
5765
extension GenericClass: ThingHolder {}
66+
#endif
5867

5968
public func genericBlockBridging<T: AnyObject>(x: GenericClass<T>) {
6069
let block = x.blockForPerformingOnThings()

0 commit comments

Comments
 (0)