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 | //===----------------------------------------------------------------------===// |
8 | // |
9 | |
10 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
11 | // REQUIRES: -fsized-deallocation |
12 | // ADDITIONAL_COMPILE_FLAGS: -fsized-deallocation |
13 | |
14 | // This test will fail with ASan if the implementation passes different sizes |
15 | // to corresponding allocation and deallocation functions. |
16 | |
17 | #include <memory> |
18 | |
19 | int main(int, char**) { |
20 | std::allocate_shared<int[]>(a: std::allocator<int>{}, args: 10); |
21 | std::make_shared<int[]>(args: 10); |
22 | |
23 | std::allocate_shared<int[10]>(a: std::allocator<int>{}); |
24 | std::make_shared<int[10]>(); |
25 | |
26 | return 0; |
27 | } |
28 | |