From 1dfa6a67850d82304dec592f65227355ef26c192 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 20 Mar 2018 15:21:57 +0000 Subject: [PATCH] Explicitly reference a protocol in a test. With the old ABI, we generated a copy of every protocol in every compilation unit that declared it. We now emit protocols only if they are referenced (and have the linker deduplicate them). This test was previously failing with the Apple runtime. --- Test/ProtocolCreation.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Test/ProtocolCreation.m b/Test/ProtocolCreation.m index 0a42205..1cbf296 100644 --- a/Test/ProtocolCreation.m +++ b/Test/ProtocolCreation.m @@ -7,6 +7,7 @@ int main(void) { + Protocol *force_reference = @protocol(Test2); Protocol *p = objc_allocateProtocol("Test"); protocol_addMethodDescription(p, @selector(someMethod), "@:", YES, NO); assert(objc_getProtocol("Test2"));