Add a test for forward declared protocols.
Check that a protocol accessed by forward definition in one compilation unit is the one defined in another compilation unit.main
parent
1dfa6a6785
commit
8b6793aa52
@ -0,0 +1,6 @@
|
|||||||
|
@protocol P;
|
||||||
|
|
||||||
|
Protocol *getProtocol(void)
|
||||||
|
{
|
||||||
|
return @protocol(P);
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
#include "Test.h"
|
||||||
|
|
||||||
|
@protocol P
|
||||||
|
- (void)someMethod;
|
||||||
|
@end
|
||||||
|
|
||||||
|
// Defined in another compilation unit. Returns @protocol(P).
|
||||||
|
Protocol *getProtocol(void);
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
//Protocol *p1 = @protocol(P);
|
||||||
|
Protocol *p2 = getProtocol();
|
||||||
|
//assert(protocol_isEqual(p1, p2));
|
||||||
|
//assert(p1 == p2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue