File: cxxfilt.exp

package info (click to toggle)
binutils-gold 2.44-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 412,824 kB
  • sloc: ansic: 1,459,850; asm: 761,693; cpp: 215,799; exp: 78,086; makefile: 71,902; sh: 24,043; yacc: 15,048; lisp: 13,579; perl: 13,404; lex: 1,717; ada: 1,681; pascal: 1,446; cs: 879; python: 636; java: 478; sed: 191; xml: 95; awk: 25
file content (44 lines) | stat: -rw-r--r-- 1,894 bytes parent folder | download | duplicates (8)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#   Copyright (C) 2018-2025 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.

proc test_cxxfilt {options mangled_string demangled_string} {
    global CXXFILT
    global CXXFILTFLAGS
    
    set testname "cxxfilt: demangling $mangled_string"
    set got [binutils_run $CXXFILT "$options $CXXFILTFLAGS $mangled_string"]

    if ![regexp $demangled_string $got] then {
	fail "$testname"
	verbose 0 "expected: $demangled_string"
	return
    }

    pass $testname
}

# Mangled and demangled strings stolen from libiberty/testsuite/demangle-expected.
test_cxxfilt {--no-strip-underscores} \
    "_Z1fIvJiELb0EEvPDOT1_EFT_DpT0_E" \
    "void f.void, int, false.(void (.)(int) noexcept(false))*"

test_cxxfilt {--format=gnu-v3 --no-strip-underscores} \
    "_Z14int_if_addableI1YERiP1AIXszpldecvPT_Li0EdecvS4_Li0EEE" \
    "int& int_if_addable.Y.(A.sizeof ((.((Y.)(0))).(.((Y.)(0))))..)*"

test_cxxfilt {--no-recurse-limit} \
    "Z3fooiPiPS_PS0_PS1_PS2_PS3_PS4_PS5_PS6_PS7_PS8_PS9_PSA_PSB_PSC_" \
    "foo(int, int., int.., int..., int...., int....., int......, int......., int........, int........., int.........., int..........., int............, int............., int.............., int...............)*"