Merge from trunk @ 138209
[official-gcc.git] / libstdc++-v3 / testsuite / 20_util / duration / comparisons / 1.cc
blob31ac42ddceed30b6f1598b9cd6c898f73886208b
1 // { dg-options "-std=gnu++0x" }
2 // { dg-require-cstdint "" }
4 // Copyright (C) 2008 Free Software Foundation
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 // USA.
22 // 20.8.3 Class template duration [time.duration]
24 #include <chrono>
25 #include <testsuite_hooks.h>
27 // 20.8.3.6 duration comparisons [time.duration.comparisons]
28 void
29 test01()
31 bool test __attribute__((unused)) = true;
32 using namespace std::chrono;
34 duration<int> d0(12);
35 duration<int> d1(3);
36 duration<int> d2(3);
38 VERIFY(d1 < d0);
39 VERIFY(d0 > d1);
41 VERIFY(d0 != d1);
42 VERIFY(d1 == d2);
44 VERIFY(d1 <= d2);
45 VERIFY(d1 >= d2);
47 VERIFY(d1 <= d0);
48 VERIFY(d0 >= d1);
51 int
52 main()
54 test01();
55 return 0;