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.
main
David Chisnall 8 years ago
parent 12a0d97849
commit 1dfa6a6785

@ -7,6 +7,7 @@
int main(void) int main(void)
{ {
Protocol *force_reference = @protocol(Test2);
Protocol *p = objc_allocateProtocol("Test"); Protocol *p = objc_allocateProtocol("Test");
protocol_addMethodDescription(p, @selector(someMethod), "@:", YES, NO); protocol_addMethodDescription(p, @selector(someMethod), "@:", YES, NO);
assert(objc_getProtocol("Test2")); assert(objc_getProtocol("Test2"));

Loading…
Cancel
Save