15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier 
95a83710eSEric Fiselier // <valarray>
105a83710eSEric Fiselier 
115a83710eSEric Fiselier // template<class T> class valarray;
125a83710eSEric Fiselier 
135a83710eSEric Fiselier // valarray();
145a83710eSEric Fiselier 
155a83710eSEric Fiselier #include <valarray>
165a83710eSEric Fiselier #include <cassert>
175a83710eSEric Fiselier 
182b20304dSMikhail Maltsev struct S {
192b20304dSMikhail Maltsev     S() { ctor_called = true; }
202b20304dSMikhail Maltsev     static bool ctor_called;
212b20304dSMikhail Maltsev };
222b20304dSMikhail Maltsev 
232b20304dSMikhail Maltsev bool S::ctor_called = false;
242b20304dSMikhail Maltsev 
25*2df59c50SJF Bastien int main(int, char**)
265a83710eSEric Fiselier {
275a83710eSEric Fiselier     {
285a83710eSEric Fiselier         std::valarray<int> v;
295a83710eSEric Fiselier         assert(v.size() == 0);
305a83710eSEric Fiselier     }
315a83710eSEric Fiselier     {
325a83710eSEric Fiselier         std::valarray<float> v;
335a83710eSEric Fiselier         assert(v.size() == 0);
345a83710eSEric Fiselier     }
355a83710eSEric Fiselier     {
365a83710eSEric Fiselier         std::valarray<double> v;
375a83710eSEric Fiselier         assert(v.size() == 0);
385a83710eSEric Fiselier     }
395a83710eSEric Fiselier     {
405a83710eSEric Fiselier         std::valarray<std::valarray<double> > v;
415a83710eSEric Fiselier         assert(v.size() == 0);
425a83710eSEric Fiselier     }
432b20304dSMikhail Maltsev     {
442b20304dSMikhail Maltsev         std::valarray<S> v;
452b20304dSMikhail Maltsev         assert(v.size() == 0);
462b20304dSMikhail Maltsev         assert(!S::ctor_called);
472b20304dSMikhail Maltsev     }
48*2df59c50SJF Bastien 
49*2df59c50SJF Bastien   return 0;
505a83710eSEric Fiselier }
51