PR target/83368
[official-gcc.git] / gcc / testsuite / objc.dg / pr18255.m
blobd8afd839c80012ff292bf0a05f36555a3d2ae006
1 /* This is a test for a GNU Objective-C Runtime library bug.  */
2 /* { dg-do run } */
3 /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
5 #include <objc/runtime.h>
6 #include <objc/Protocol.h>
7 #include <stdlib.h>
9 @protocol a
10 - aMethod;
11 @end
14 @protocol b <a>
15 - bMethod;
16 @end
19 int main (int argc, char **argv)
21   struct objc_method_description m;
22   m = protocol_getMethodDescription (@protocol(b), @selector(aMethod), YES, YES);
24   if (m.name != NULL)
25     abort ();
27   m = protocol_getMethodDescription (@protocol(a), @selector(aMethod), YES, YES);
29   if (m.name == NULL)
30     abort ();
32   return 0;