1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // ADDITIONAL_COMPILE_FLAGS: -Wno-unused-function
15 #include "../src/demangle/ItaniumDemangle.h"
17 void testPODSmallVector() {
19 itanium_demangle::PODSmallVector
<int, 1> PSV
;
24 for (int i
= 0; i
< 4; ++i
)
27 for (int i
= 0; i
< 3; ++i
)
31 assert(!PSV
.empty() && PSV
.size() == 1);
33 assert(PSV
.empty() && PSV
.size() == 0);
37 itanium_demangle::PODSmallVector
<int, 1> PSV1
;
42 itanium_demangle::PODSmallVector
<int, 1> PSV2
;
43 std::swap(PSV1
, PSV2
);
44 assert(PSV1
.size() == 0);
45 assert(PSV2
.size() == 3);
52 std::swap(PSV1
, PSV2
);
53 assert(PSV1
.size() == 3);
54 assert(PSV2
.size() == 0);
64 itanium_demangle::PODSmallVector
<int, 10> PSV1
;
65 itanium_demangle::PODSmallVector
<int, 10> PSV2
;
69 assert(PSV1
.size() == 3);
70 assert(PSV2
.size() == 0);
71 std::swap(PSV1
, PSV2
);
72 assert(PSV1
.size() == 0);
73 assert(PSV2
.size() == 3);
86 int main(int, char**) {