PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / obj-c++.dg / proto-lossage-3.mm
blob9c08f07e4d9702eda3a8114f273540e4985d920d
1 /* Crash due to descriptionFor(Instance|Class)Method applied to
2    a protocol with no instance/class methods respectively.
3    Problem report and original fix by richard@brainstorm.co.uk.  */
4 /* { dg-do run } */
5 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
6 #include <objc/Protocol.h>
7 #include "../objc-obj-c++-shared/runtime.h"
9 @interface MyClass
10 - name;
11 @end
13 @protocol NoInstanceMethods
14 + testMethod;
15 @end
17 @protocol NoClassMethods
18 - testMethod;
19 @end
21 int
22 main()
24 protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(name), YES, YES);
25 protocol_getMethodDescription (@protocol(NoInstanceMethods), @selector(name), YES, NO);
26 protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name), YES, YES);
27 protocol_getMethodDescription (@protocol(NoClassMethods), @selector(name), YES, NO);
28 return 0;