1 // Copyright (C) 1999 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 21 Nov 1999 <nathan@acm.org>
4 // make sure __FUNCTION__ and __PRETTY_FUNCTION__ work in templates
6 // execution test - XFAIL *-*-*
11 static bool bad = false;
13 template<class T> void f1 (T)
15 char const *function = __FUNCTION__;
16 char const *pretty = __PRETTY_FUNCTION__;
19 printf ("__FUNCTION__ %s\n", function);
20 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
22 if (strcmp (function, "f1"))
24 if (strcmp (pretty, "void f1<float> (float)")) // only for float instantiation
28 template<> void f1<int> (int)
30 char const *function = __FUNCTION__;
31 char const *pretty = __PRETTY_FUNCTION__;
33 printf ("specialized\n");
34 printf ("__FUNCTION__ %s\n", function);
35 printf ("__PRETTY_FUNCTION__ %s\n", pretty);
37 if (strcmp (function, "f1"))
39 if (strcmp (pretty, "void f1<int> (int)"))
46 f1(0.0f); // f1<float>