Debian Codegraph @

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

raw
1 // Test whether __func__ works for ordinary member 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 struct y8a
8 {
9 const char* zqjx(int, char);
10 };
11
12 const char* y8a::zqjx(int, char)
13 {
14 return __func__;
15 }
16
17
18 int main()
19 {
20 y8a tmp;
21 const char* s = tmp.zqjx(16, 'x');
22 bool ok = true;
23
24 ok = ok && s[0] == 'z';
25 ok = ok && s[1] == 'q';
26 ok = ok && s[2] == 'j';
27 ok = ok && s[3] == 'x';
28 ok = ok && s[4] == '\0';
29
30 return ok ? 0 : 1;
31 }