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 //===----------------------------------------------------------------------===//
11 // template<class T> class valarray;
13 // explicit valarray(size_t);
18 #include "test_macros.h"
24 static std::size_t cnt_dtor
;
27 size_t S::cnt_dtor
= 0;
32 std::valarray
<int> v(100);
33 assert(v
.size() == 100);
34 for (int i
= 0; i
< 100; ++i
)
38 std::valarray
<double> v(100);
39 assert(v
.size() == 100);
40 for (int i
= 0; i
< 100; ++i
)
44 std::valarray
<std::valarray
<double> > v(100);
45 assert(v
.size() == 100);
46 for (int i
= 0; i
< 100; ++i
)
47 assert(v
[i
].size() == 0);
50 std::valarray
<S
> v(100);
51 assert(v
.size() == 100);
52 for (int i
= 0; i
< 100; ++i
)
55 assert(S::cnt_dtor
== 100);