[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / vector / vector.modifiers / emplace_extra.pass.cpp
blob7a73580d1e6fe951c17795e34a7e7725672d0a53
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <vector>
13 // template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
15 #include <vector>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "min_allocator.h"
20 #include "asan_testing.h"
22 int main(int, char**)
25 std::vector<int> v;
26 v.reserve(3);
27 assert(is_contiguous_container_asan_correct(v));
28 v = { 1, 2, 3 };
29 v.emplace(v.begin(), v.back());
30 assert(v[0] == 3);
31 assert(is_contiguous_container_asan_correct(v));
34 std::vector<int> v;
35 v.reserve(4);
36 assert(is_contiguous_container_asan_correct(v));
37 v = { 1, 2, 3 };
38 v.emplace(v.begin(), v.back());
39 assert(v[0] == 3);
40 assert(is_contiguous_container_asan_correct(v));
43 std::vector<int, min_allocator<int>> v;
44 v.reserve(3);
45 assert(is_contiguous_container_asan_correct(v));
46 v = { 1, 2, 3 };
47 v.emplace(v.begin(), v.back());
48 assert(v[0] == 3);
49 assert(is_contiguous_container_asan_correct(v));
52 std::vector<int, min_allocator<int>> v;
53 v.reserve(4);
54 assert(is_contiguous_container_asan_correct(v));
55 v = { 1, 2, 3 };
56 v.emplace(v.begin(), v.back());
57 assert(v[0] == 3);
58 assert(is_contiguous_container_asan_correct(v));
61 return 0;