2 // Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
5 // make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in member functions
10 static bool bad = false;
22 char const *function = __FUNCTION__;
23 char const *pretty = __PRETTY_FUNCTION__;
26 printf ("__FUNCTION__ %s\n", function);
27 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
29 if (strcmp (function, "X"))
31 if (strcmp (pretty, "X::X()"))
36 char const *function = __FUNCTION__;
37 char const *pretty = __PRETTY_FUNCTION__;
40 printf ("__FUNCTION__ %s\n", function);
41 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
43 if (strcmp (function, "~X"))
45 if (strcmp (pretty, "X::~X()"))
50 char const *function = __FUNCTION__;
51 char const *pretty = __PRETTY_FUNCTION__;
53 printf ("member fn\n");
54 printf ("__FUNCTION__ %s\n", function);
55 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
57 if (strcmp (function, "fn"))
59 if (strcmp (pretty, "void X::fn()"))
64 char const *function = __FUNCTION__;
65 char const *pretty = __PRETTY_FUNCTION__;
67 printf ("conversion\n");
68 printf ("__FUNCTION__ %s\n", function);
69 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
71 if (strcmp (pretty, "X::operator int()"))