reverse.pass.cpp revision a8bf9de8057ad254cc642f33bd7d0a48dc1ae55c
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// void reverse();
13
14#include <list>
15#include <cassert>
16
17int main()
18{
19    int a1[] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
20    int a2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
21    std::list<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
22    c1.reverse();
23    assert(c1 == std::list<int>(a2, a2+sizeof(a2)/sizeof(a2[0])));
24}
25