aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/objc.dg/pr18255.m
blob: d8afd839c80012ff292bf0a05f36555a3d2ae006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* This is a test for a GNU Objective-C Runtime library bug.  */
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */

#include <objc/runtime.h>
#include <objc/Protocol.h>
#include <stdlib.h>

@protocol a
- aMethod;
@end


@protocol b <a>
- bMethod;
@end


int main (int argc, char **argv)
{
  struct objc_method_description m;
  m = protocol_getMethodDescription (@protocol(b), @selector(aMethod), YES, YES);

  if (m.name != NULL)
    abort ();

  m = protocol_getMethodDescription (@protocol(a), @selector(aMethod), YES, YES);

  if (m.name == NULL)
    abort ();

  return 0;
}