[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / forwardlist / empty.pass.cpp
blob727904c9871338a3a564ea71a93c40f10a9e8b44
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 // <forward_list>
11 // class forward_list
13 // bool empty() const noexcept;
15 #include <forward_list>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "min_allocator.h"
21 int main(int, char**)
24 typedef std::forward_list<int> C;
25 C c;
26 ASSERT_NOEXCEPT(c.empty());
27 assert(c.empty());
28 c.push_front(C::value_type(1));
29 assert(!c.empty());
30 c.clear();
31 assert(c.empty());
33 #if TEST_STD_VER >= 11
35 typedef std::forward_list<int, min_allocator<int>> C;
36 C c;
37 ASSERT_NOEXCEPT(c.empty());
38 assert(c.empty());
39 c.push_front(C::value_type(1));
40 assert(!c.empty());
41 c.clear();
42 assert(c.empty());
44 #endif
46 return 0;