111
|
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
|
|
5 #include <cstring>
|
|
6 #include <cstdlib>
|
|
7 #include <iostream>
|
|
8 #include <objc/objc.h>
|
|
9
|
|
10 @interface DemangleTest
|
|
11 {
|
|
12 Class isa;
|
|
13 }
|
|
14 + (int) testFunction1;
|
|
15 + (int) test_function2;
|
|
16 + (int) __testFunction3: (int)unused andArgument: (char)unused2;
|
|
17 + (id) initialize;
|
|
18 @end
|
|
19
|
|
20 @implementation DemangleTest
|
|
21 + (int) testFunction1
|
|
22 {
|
|
23 std::cout << __PRETTY_FUNCTION__ << "\n";
|
|
24 return std::strcmp (__PRETTY_FUNCTION__, "+[DemangleTest testFunction1]");
|
|
25 }
|
|
26 + (int) test_function2
|
|
27 {
|
|
28 std::cout << __PRETTY_FUNCTION__ << "\n";
|
|
29 return std::strcmp (__PRETTY_FUNCTION__, "+[DemangleTest test_function2]");
|
|
30 }
|
|
31 + (int) __testFunction3: (int)unused andArgument: (char)unused2
|
|
32 {
|
|
33 std::cout << __PRETTY_FUNCTION__ << "\n";
|
|
34 return std::strcmp (__PRETTY_FUNCTION__, "+[DemangleTest __testFunction3:andArgument:]");
|
|
35 }
|
|
36 + (id) initialize { return self; }
|
|
37 @end
|
|
38
|
|
39 int main ()
|
|
40 {
|
|
41 if ([DemangleTest testFunction1] != 0)
|
|
42 abort ();
|
|
43
|
|
44 if ([DemangleTest test_function2] != 0)
|
|
45 abort ();
|
|
46
|
|
47 if ([DemangleTest __testFunction3:0 andArgument: 'c'] != 0)
|
|
48 abort ();
|
|
49
|
|
50 return 0;
|
|
51 }
|
|
52
|
|
53
|