aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ext/fnname1.C
blob: 521d5a7367f65aecef22aca6629fb982032d0d95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Test whether __func__ works for namespace-scope C++ functions.

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Matt Austern <austern@apple.com>, 3 Aug 2003
// { dg-do run }

namespace xyzzy
{
  const char* ab6(double, void*)
  {
    return __func__;
  }
}

int main()
{
  const char* s = xyzzy::ab6(2.3, (void*) 0);
  bool ok = true;

  ok = ok && s[0] == 'a';
  ok = ok && s[1] == 'b';
  ok = ok && s[2] == '6';
  ok = ok && s[3] == '\0';

  return ok ? 0 : 1;
}