aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm
blob: 9c08f07e4d9702eda3a8114f273540e4985d920d (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
/* Crash due to descriptionFor(Instance|Class)Method applied to
   a protocol with no instance/class methods respectively.
   Problem report and original fix by richard@brainstorm.co.uk.  */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
#include <objc/Protocol.h>
#include "../objc-obj-c++-shared/runtime.h"

@interface MyClass
- name;
@end

@protocol NoInstanceMethods
+ testMethod;
@end

@protocol NoClassMethods
- testMethod;
@end

int
main()
{
protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(name), YES, YES);
protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(name), YES, NO);
protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name), YES, YES);
protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name), YES, NO);
return 0;
}