]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/util/testsuite_abi.h
re PR libstdc++/44417 (make check-target-libstdc++-v3 fails due to undefined ptrdiff_t)
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / util / testsuite_abi.h
CommitLineData
4b260c20
BK
1// -*- C++ -*-
2
c8061de7
PC
3// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
4// Free Software Foundation, Inc.
4b260c20
BK
5
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU General Public License as
748086b7 8// published by the Free Software Foundation; either version 3, or (at
4b260c20
BK
9// your option) any later version.
10
11// This library is distributed in the hope that it will be useful, but
12// WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// General Public License for more details.
15
16// You should have received a copy of the GNU General Public License
748086b7
JJ
17// along with this library; see the file COPYING3. If not see
18// <http://www.gnu.org/licenses/>.
19
4b260c20
BK
20// Benjamin Kosnik <bkoz@redhat.com>
21
22#include <string>
23#include <stdexcept>
0c312c2d 24#include <vector>
84b31797 25#include <locale>
0c3de900 26#include <tr1/unordered_map>
4b260c20
BK
27#include <cxxabi.h>
28
29// Encapsulates symbol characteristics.
30struct symbol
31{
bb2b2a24
BK
32 enum category { function, object, uncategorized };
33 enum designation { existing, added, subtracted, undesignated };
34 enum version { none, compatible, incompatible, unversioned };
4b260c20
BK
35 enum compatibility
36 {
37 compat_type = 1,
38 compat_name = 2,
39 compat_size = 4,
40 compat_version = 8
41 };
42
43 category type;
44 std::string name;
bb2b2a24 45 std::string raw_name; // Name with versioning info still attached.
4b260c20
BK
46 std::string demangled_name;
47 int size;
48 std::string version_name;
bb2b2a24 49 version version_status;
4b260c20
BK
50 designation status;
51
bb2b2a24
BK
52 symbol()
53 : type(uncategorized), size(0), version_status(unversioned),
54 status(undesignated) { }
4b260c20
BK
55
56 symbol(const symbol& other)
57 : type(other.type), name(other.name), demangled_name(other.demangled_name),
bb2b2a24
BK
58 size(other.size), version_name(other.version_name),
59 version_status(other.version_status), status(other.status) { }
4b260c20
BK
60
61 void
62 print() const;
63
64 void
65 init(std::string& data);
66};
67
0c312c2d
BK
68// Map type between symbol names and full symbol info.
69typedef std::tr1::unordered_map<std::string, symbol> symbols;
4b260c20
BK
70
71
72// Check.
73bool
bb2b2a24 74check_version(symbol& test, bool added = false);
4b260c20
BK
75
76bool
bb2b2a24 77check_compatible(symbol& lhs, symbol& rhs, bool verbose = false);
4b260c20
BK
78
79
80// Examine.
81bool
82has_symbol(const std::string& mangled, const symbols& list) throw();
83
0c312c2d 84const symbol&
4b260c20
BK
85get_symbol(const std::string& mangled, const symbols& list);
86
87extern "C" void
88examine_symbol(const char* name, const char* file);
89
fdbba6bc 90extern "C" int
4b260c20
BK
91compare_symbols(const char* baseline_file, const char* test_file, bool verb);
92
93
94// Util.
95symbols
96create_symbols(const char* file);
97
98const char*
99demangle(const std::string& mangled);