aboutsummaryrefslogtreecommitdiff
path: root/libiberty/testsuite
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2005-12-11 02:16:09 +0000
committerDJ Delorie <dj@redhat.com>2005-12-11 02:16:09 +0000
commit7887b2ce668890e9eb5b95119f7b28f75f0dbaf3 (patch)
treebab59b6452d1f71ee6fc52fa64dab05b27fcb256 /libiberty/testsuite
parentbd6791bc12909fc73c4b1fd9a872d0d12ff057c7 (diff)
downloadgdb-7887b2ce668890e9eb5b95119f7b28f75f0dbaf3.zip
gdb-7887b2ce668890e9eb5b95119f7b28f75f0dbaf3.tar.gz
gdb-7887b2ce668890e9eb5b95119f7b28f75f0dbaf3.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/testsuite')
-rw-r--r--libiberty/testsuite/demangle-expected24
-rw-r--r--libiberty/testsuite/test-demangle.c8
2 files changed, 31 insertions, 1 deletions
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 4526773..fa2a2fe 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -11,6 +11,7 @@
# --is-v3-ctor Calls is_gnu_v3_mangled_ctor on input; expected
# output is an integer representing ctor_kind.
# --is-v3-dtor Likewise, but for dtors.
+# --ret-postfix Passes the DMGL_RET_POSTFIX option
#
# For compatibility, just in case it matters, the options line may be
# empty, to mean --format=auto. If it doesn't start with --, then it
@@ -3781,3 +3782,26 @@ _test_array__L_1__B23b___clean.6
--format=java
_ZGAN4java4lang5Class7forNameEPNS0_6StringE
hidden alias for java.lang.Class.forName(java.lang.String)
+#
+# Test cases to verify encoding that determines if a return type is present
+# Related to PR9861
+--format=java
+_ZN4java4lang4Math4acosEJdd
+java.lang.Math.acos(double)double
+#
+--format=auto
+_ZN4java4lang4Math4acosEJdd
+double java::lang::Math::acos(double)
+#
+--format=auto
+_ZN4java4lang4Math4acosEJvd
+void java::lang::Math::acos(double)
+#
+--format=auto --ret-postfix
+_ZN4java4lang4Math4acosEJdd
+java::lang::Math::acos(double)double
+#
+--format=gnu-v3 --no-params --ret-postfix
+_Z4makeI7FactoryiET_IT0_Ev
+make<Factory, int>()Factory<int>
+make<Factory, int>
diff --git a/libiberty/testsuite/test-demangle.c b/libiberty/testsuite/test-demangle.c
index dcb27d2..9379399 100644
--- a/libiberty/testsuite/test-demangle.c
+++ b/libiberty/testsuite/test-demangle.c
@@ -114,6 +114,7 @@ exp: %s\n",
--is-v3-ctor Calls is_gnu_v3_mangled_ctor on input; expected
output is an integer representing ctor_kind.
--is-v3-dtor Likewise, but for dtors.
+ --ret-postfix Passes the DMGL_RET_POSTFIX option
For compatibility, just in case it matters, the options line may be
empty, to mean --format=auto. If it doesn't start with --, then it
@@ -129,6 +130,7 @@ main(argc, argv)
int no_params;
int is_v3_ctor;
int is_v3_dtor;
+ int ret_postfix;
struct line format;
struct line input;
struct line expect;
@@ -158,6 +160,7 @@ main(argc, argv)
tests++;
no_params = 0;
+ ret_postfix = 0;
is_v3_ctor = 0;
is_v3_dtor = 0;
if (format.data[0] == '\0')
@@ -212,6 +215,8 @@ main(argc, argv)
is_v3_ctor = 1;
else if (strcmp (opt, "--is-v3-dtor") == 0)
is_v3_dtor = 1;
+ else if (strcmp (opt, "--ret-postfix") == 0)
+ ret_postfix = 1;
else
{
printf ("FAIL at line %d: unrecognized option %s\n",
@@ -255,7 +260,8 @@ main(argc, argv)
cplus_demangle_set_style (style);
result = cplus_demangle (input.data,
- DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES);
+ DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES
+ |(ret_postfix ? DMGL_RET_POSTFIX : 0));
if (result
? strcmp (result, expect.data)