]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/libcxx/containers/sequences/list/db_back.pass.cpp
Vendor import of libc++ release_39 branch r287912:
[FreeBSD/FreeBSD.git] / test / libcxx / containers / sequences / list / db_back.pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <list>
11
12 // Call back() on empty container.
13
14 #define _LIBCPP_DEBUG 1
15 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
16
17 #include <list>
18 #include <cassert>
19 #include <iterator>
20 #include <exception>
21 #include <cstdlib>
22
23 int main()
24 {
25     typedef int T;
26     typedef std::list<T> C;
27     C c(1);
28     assert(c.back() == 0);
29     c.clear();
30     assert(c.back() == 0);
31     assert(false);
32 }