aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2003-05-01 22:17:23 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2003-05-01 22:17:23 +0000
commite78d8df476bd4e52e595b1e87fdc59da383725cd (patch)
tree7f10af23b9faff0b2d34ddbaf0b794b09538446f
parent06b021af7b30d4aa8793f2f638b701462788d814 (diff)
downloadgcc-e78d8df476bd4e52e595b1e87fdc59da383725cd.zip
gcc-e78d8df476bd4e52e595b1e87fdc59da383725cd.tar.gz
gcc-e78d8df476bd4e52e595b1e87fdc59da383725cd.tar.bz2
abi_check.cc (check_version): Update known versions.
2003-05-01 Benjamin Kosnik <bkoz@redhat.com> * testsuite/abi_check.cc (check_version): Update known versions. Check added symbols for version_name != base version. Add missing symbols to incompatible list. From-SVN: r66352
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/testsuite/abi_check.cc63
2 files changed, 42 insertions, 27 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index cd0c01a..331d5e5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,11 @@
2003-05-01 Benjamin Kosnik <bkoz@redhat.com>
+ * testsuite/abi_check.cc (check_version): Update known versions.
+ Check added symbols for version_name != base version. Add missing
+ symbols to incompatible list.
+
+2003-05-01 Benjamin Kosnik <bkoz@redhat.com>
+
* acinclude.m4 (GLIBCPP_EXPORT_FLAGS): Remove -Winline.
* aclocal.m4: Regenerated.
* configure: Regenerated.
diff --git a/libstdc++-v3/testsuite/abi_check.cc b/libstdc++-v3/testsuite/abi_check.cc
index 5d71211..51c384f 100644
--- a/libstdc++-v3/testsuite/abi_check.cc
+++ b/libstdc++-v3/testsuite/abi_check.cc
@@ -44,7 +44,7 @@
struct symbol_info
{
enum category { none, function, object, error };
- category type;
+ category type;
std::string name;
std::string demangled_name;
int size;
@@ -77,34 +77,39 @@ typedef __gnu_cxx::hash_map<std::string, symbol_info> symbol_infos;
bool
-check_version(const symbol_info& test)
+check_version(const symbol_info& test, bool added = false)
{
- bool ret = true;
-
typedef std::vector<std::string> compat_list;
- static compat_list known;
- if (known.empty())
+ static compat_list known_versions;
+ if (known_versions.empty())
{
- known.push_back("GLIBCPP_3.2");
- known.push_back("GLIBCPP_3.2.1");
- known.push_back("GLIBCPP_3.2.2");
- known.push_back("GLIBCPP_3.4");
- known.push_back("CXXABI_1.2");
- known.push_back("CXXABI_1.2.1");
- known.push_back("CXXABI_1.3");
+ known_versions.push_back("GLIBCPP_3.2"); // base version
+ known_versions.push_back("GLIBCPP_3.2.1");
+ known_versions.push_back("GLIBCPP_3.2.2");
+ known_versions.push_back("GLIBCPP_3.2.3"); // gcc-3.3.0
+ known_versions.push_back("GLIBCPP_3.4");
+ known_versions.push_back("CXXABI_1.2");
+ known_versions.push_back("CXXABI_1.2.1");
+ known_versions.push_back("CXXABI_1.3");
}
-
- compat_list::iterator end = known.end();
+ compat_list::iterator begin = known_versions.begin();
+ compat_list::iterator end = known_versions.end();
// Check version names for compatibility...
- compat_list::iterator it1 = find(known.begin(), end, test.version_name);
+ compat_list::iterator it1 = find(begin, end, test.version_name);
// Check for weak label.
- compat_list::iterator it2 = find(known.begin(), end, test.name);
- if (it1 != end || it2 != end)
- ret = true;
+ compat_list::iterator it2 = find(begin, end, test.name);
- return ret;
+ // Check that added symbols aren't added in the base version.
+ bool compat = true;
+ if (added && test.version_name == known_versions[0])
+ compat = false;
+
+ if (it1 == end && it2 == end)
+ compat = false;
+
+ return compat;
}
bool
@@ -377,12 +382,19 @@ main(int argc, char** argv)
added_names.erase(it);
}
else
- missing_names.push_back(what);
+ missing_names.push_back(what);
}
- // Check shared names for compatibility.
+ // Check missing names for compatibility.
typedef pair<symbol_info, symbol_info> symbol_pair;
vector<symbol_pair> incompatible;
+ for (size_t i = 0; i < missing_names.size(); ++i)
+ {
+ symbol_info base = baseline_symbols[missing_names[i]];
+ incompatible.push_back(symbol_pair(base, base));
+ }
+
+ // Check shared names for compatibility.
for (size_t i = 0; i < shared_names.size(); ++i)
{
symbol_info base = baseline_symbols[shared_names[i]];
@@ -395,11 +407,8 @@ main(int argc, char** argv)
for (size_t i = 0; i < added_names.size(); ++i)
{
symbol_info test = test_symbols[added_names[i]];
- if (!check_version(test))
- {
- incompatible.push_back(symbol_pair(test, test));
- cout << test.version_name << endl;
- }
+ if (!check_version(test, true))
+ incompatible.push_back(symbol_pair(test, test));
}
// Report results.