Debian Codegraph @

gcc/testsuite/g++.dg/ext/fnname1.C

raw
1 // Test whether __func__ works for namespace-scope C++ functions.
2
3 // Copyright (C) 2003 Free Software Foundation, Inc.
4 // Contributed by Matt Austern <[email protected]>, 3 Aug 2003
5 // { dg-do run }
6
7 namespace xyzzy
8 {
9 const char* ab6(double, void*)
10 {
11 return __func__;
12 }
13 }
14
15 int main()
16 {
17 const char* s = xyzzy::ab6(2.3, (void*) 0);
18 bool ok = true;
19
20 ok = ok && s[0] == 'a';
21 ok = ok && s[1] == 'b';
22 ok = ok && s[2] == '6';
23 ok = ok && s[3] == '\0';
24
25 return ok ? 0 : 1;
26 }