Skip to content

Commit

Permalink
[libc++abi] Avoid including source files into unittest_demangle
Browse files Browse the repository at this point in the history
That is not necessary to test what we're testing, and in fact including
abort_message.cpp into that file caused some link errors if we didn't
link some of the dependencies of libc++abi directly into the test.

Differential Revision: https://reviews.llvm.org/D152862
  • Loading branch information
ldionne committed Jun 15, 2023
1 parent baebe71 commit a86df48
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions libcxxabi/test/unittest_demangle.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++03
// ADDITIONAL_COMPILE_FLAGS: -Wno-unused-function

#include "../src/cxa_demangle.cpp"
#include "../src/abort_message.cpp"
#include <cassert>
#include <utility>

using namespace __cxxabiv1;
#include "../src/demangle/ItaniumDemangle.h"

void testPODSmallVector() {
{ // {push/pop}_back
PODSmallVector<int, 1> PSV;
itanium_demangle::PODSmallVector<int, 1> PSV;
PSV.push_back(0);
PSV.push_back(1);
PSV.push_back(2);
Expand All @@ -33,12 +34,12 @@ void testPODSmallVector() {
}

{
PODSmallVector<int, 1> PSV1;
itanium_demangle::PODSmallVector<int, 1> PSV1;
PSV1.push_back(1);
PSV1.push_back(2);
PSV1.push_back(3);

PODSmallVector<int, 1> PSV2;
itanium_demangle::PODSmallVector<int, 1> PSV2;
std::swap(PSV1, PSV2);
assert(PSV1.size() == 0);
assert(PSV2.size() == 3);
Expand All @@ -60,8 +61,8 @@ void testPODSmallVector() {
}

{
PODSmallVector<int, 10> PSV1;
PODSmallVector<int, 10> PSV2;
itanium_demangle::PODSmallVector<int, 10> PSV1;
itanium_demangle::PODSmallVector<int, 10> PSV2;
PSV1.push_back(0);
PSV1.push_back(1);
PSV1.push_back(2);
Expand Down

0 comments on commit a86df48

Please sign in to comment.