Marshall Clow | fc6cc70 | 2017-11-15 02:31:14 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 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 |
Marshall Clow | fc6cc70 | 2017-11-15 02:31:14 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // <array> |
| 10 | |
| 11 | // class array |
| 12 | |
| 13 | // bool empty() const noexcept; |
| 14 | |
| 15 | #include <array> |
| 16 | #include <cassert> |
| 17 | |
| 18 | #include "test_macros.h" |
| 19 | #include "min_allocator.h" |
| 20 | |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 21 | int main(int, char**) |
Marshall Clow | fc6cc70 | 2017-11-15 02:31:14 +0000 | [diff] [blame] | 22 | { |
| 23 | { |
| 24 | typedef std::array<int, 2> C; |
| 25 | C c; |
| 26 | ASSERT_NOEXCEPT(c.empty()); |
| 27 | assert(!c.empty()); |
| 28 | } |
| 29 | { |
| 30 | typedef std::array<int, 0> C; |
| 31 | C c; |
| 32 | ASSERT_NOEXCEPT(c.empty()); |
| 33 | assert( c.empty()); |
| 34 | } |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 35 | |
| 36 | return 0; |
Marshall Clow | fc6cc70 | 2017-11-15 02:31:14 +0000 | [diff] [blame] | 37 | } |