1 /* Test demangling an Objective-C method. */
3 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
11 @interface DemangleTest
16 + (int) testFunction1;
17 + (int) test_function2;
18 + (int) __testFunction3: (int)unused andArgument: (char)unused2;
21 @implementation DemangleTest
22 + (id) initialize { return self; }
25 printf ("%s\n", __PRETTY_FUNCTION__);
26 return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest testFunction1]");
28 /* Note that in general, due to how mangling is done, it's impossible
29 to get the demangling right for all functions containing '_' in the
30 name. But at least we should be able to get that right for single
31 argument ones that don't end with '_', such as the following
33 + (int) test_function2
35 printf ("%s\n", __PRETTY_FUNCTION__);
36 return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest test_function2]");
38 + (int) __testFunction3: (int)unused andArgument: (char)unused2
40 printf ("%s\n", __PRETTY_FUNCTION__);
41 return strcmp (__PRETTY_FUNCTION__, "+[DemangleTest __testFunction3:andArgument:]");
47 if ([DemangleTest testFunction1] != 0)
50 if ([DemangleTest test_function2] != 0)
53 if ([DemangleTest __testFunction3:0 andArgument: 'c'] != 0)