1 # Copyright (C) 2018-2019 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 # For some reason cxxfilt is not working on the following targets.
18 # FIXME: Investigate why.
19 if { [istarget "cris*-*-*"] || \
20 [istarget "cr16-*-*"] || \
21 [istarget "crx*-*-*"] || \
22 [istarget "epiphany-*-*"] || \
23 [istarget "ip2k-*-*"] || \
24 [istarget "metag-*-*"] || \
25 [istarget "mn10200-*-*"] || \
26 [istarget "mn10300-*-*"] || \
27 [istarget "ns32k-*-*"] || \
28 [istarget "pdp11-*-*"] || \
29 [istarget "rl78-*-*"] || \
30 [istarget "rx-*-*"] || \
31 [istarget "sh-*-*"] || \
32 [istarget "tic4*-*-*"] || \
33 [istarget "tic54*-*-*"] || \
34 [istarget "v850-*-*"] || \
35 [istarget "z8k-*-*"] || \
36 [istarget "*-*-cygwin"] || \
37 [istarget "*-*-mingw32"] } then {
41 proc test_cxxfilt {options mangled_string demangled_string} {
45 set testname "cxxfilt: demangling $mangled_string"
46 set got [binutils_run $CXXFILT "$options $CXXFILTFLAGS $mangled_string"]
48 if ![regexp $demangled_string $got] then {
50 verbose 0 "expected: $demangled_string"
57 # Mangled and demangled strings stolen from libiberty/testsuite/demangle-expected.
59 "_Z1fIvJiELb0EEvPDOT1_EFT_DpT0_E" \
60 "void f.void, int, false.(void (.)(int) noexcept(false))*"
62 test_cxxfilt {--format=gnu-v3} \
63 "_Z14int_if_addableI1YERiP1AIXszpldecvPT_Li0EdecvS4_Li0EEE" \
64 "int& int_if_addable.Y.(A.sizeof ((.((Y.)(0))).(.((Y.)(0))))..)*"
66 test_cxxfilt {--no-recurse-limit} \
67 "Z3fooiPiPS_PS0_PS1_PS2_PS3_PS4_PS5_PS6_PS7_PS8_PS9_PSA_PSB_PSC_" \
68 "foo(int, int., int.., int..., int...., int....., int......, int......., int........, int........., int.........., int..........., int............, int............., int.............., int...............)*"