rs6000: Add const_vector into any_operand predicate
[official-gcc.git] / gcc / testsuite / objc.dg / demangle-1.m
blob61e79a69976687f0d2d48b7bf8f6cefee4a33c6c
1 /* Test demangling an Objective-C method.  */
2 /* { dg-do run } */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
4 /* { dg-additional-options "-Wno-objc-root-class" } */
6 #include <string.h>
7 #include <stdlib.h>
8 #include <stdio.h>
10 #include <objc/objc.h>
12 @interface DemangleTest
14   Class isa;
16 + (id) initialize;
17 + (int) testFunction1;
18 + (int) test_function2;
19 + (int) __testFunction3: (int)unused  andArgument: (char)unused2;
20 @end
22 @implementation DemangleTest
23 + (id) initialize { return self; }
24 + (int) testFunction1
26   printf ("%s\n", __PRETTY_FUNCTION__);
27   return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest testFunction1]");
29 /* Note that in general, due to how mangling is done, it's impossible
30    to get the demangling right for all functions containing '_' in the
31    name.  But at least we should be able to get that right for single
32    argument ones that don't end with '_', such as the following
33    one.  */
34 + (int) test_function2
36   printf ("%s\n", __PRETTY_FUNCTION__);
37   return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest test_function2]");
39 + (int) __testFunction3: (int)unused   andArgument: (char)unused2
41   printf ("%s\n", __PRETTY_FUNCTION__);
42   return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest __testFunction3:andArgument:]");
44 @end
46 int main ()
48   if ([DemangleTest testFunction1] != 0)
49       abort ();
51   if ([DemangleTest test_function2] != 0)
52     abort ();
54   if ([DemangleTest __testFunction3:0 andArgument: 'c'] != 0)
55       abort ();
57   return 0;