[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.fill / fill.pass.cpp
blobb2d7c4a192409d5666243fb23e85690cd82b2a6c
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 // <array>
11 // void fill(const T& u);
13 #include <array>
14 #include <cassert>
16 #include "test_macros.h"
18 TEST_CONSTEXPR_CXX20 bool tests()
21 typedef double T;
22 typedef std::array<T, 3> C;
23 C c = {1, 2, 3.5};
24 c.fill(5.5);
25 assert(c.size() == 3);
26 assert(c[0] == 5.5);
27 assert(c[1] == 5.5);
28 assert(c[2] == 5.5);
32 typedef double T;
33 typedef std::array<T, 0> C;
34 C c = {};
35 c.fill(5.5);
36 assert(c.size() == 0);
38 return true;
41 int main(int, char**)
43 tests();
44 #if TEST_STD_VER >= 20
45 static_assert(tests(), "");
46 #endif
47 return 0;