OSDN Git Service

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