summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/fnname1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/fnname1.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/fnname1.C26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/fnname1.C b/gcc/testsuite/g++.dg/ext/fnname1.C
new file mode 100644
index 000000000..521d5a736
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/fnname1.C
@@ -0,0 +1,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;
+}