1 // { dg-do run { target c++11 } }
2 // { dg-require-cstdint "" }
3 
4 // 2011-02-28  Paolo Carlini  <paolo.carlini@oracle.com>
5 
6 // Copyright (C) 2011-2018 Free Software Foundation, Inc.
7 //
8 // This file is part of the GNU ISO C++ Library.  This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
12 // any later version.
13 
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 // GNU General Public License for more details.
18 
19 // You should have received a copy of the GNU General Public License
20 // along with this library; see the file COPYING3.  If not see
21 // <http://www.gnu.org/licenses/>.
22 
23 #include <ratio>
24 #include <testsuite_hooks.h>
25 
26 void
test01()27 test01()
28 {
29   VERIFY( (std::ratio_less<std::ratio<59, 29131>,
30 	                   std::ratio<59, 29129>>::value == 1) );
31   VERIFY( (std::ratio_less<std::ratio<4733, 13>,
32 	                   std::ratio<4751, 13>>::value == 1) );
33   VERIFY( (std::ratio_less<std::ratio<25703, 25717>,
34 	                   std::ratio<25733, 25741>>::value == 1) );
35   VERIFY( (std::ratio_less<std::ratio<631, 769>,
36 	                   std::ratio<673, 773>>::value == 1) );
37   VERIFY( (std::ratio_less<std::ratio<8353, 16903>,
38 	                   std::ratio<17891, 32099>>::value == 1) );
39   VERIFY( (std::ratio_less<std::ratio<2311, 18701>,
40 	                   std::ratio<18457, 19571>>::value == 1) );
41 
42   VERIFY( (std::ratio_less<std::ratio<60, 29132>,
43 	                   std::ratio<60, 29130>>::value == 1) );
44   VERIFY( (std::ratio_less<std::ratio<4734, 14>,
45 	                   std::ratio<4752, 14>>::value == 1) );
46   VERIFY( (std::ratio_less<std::ratio<25704, 25718>,
47 	                   std::ratio<25732, 25742>>::value == 1) );
48   VERIFY( (std::ratio_less<std::ratio<632, 770>,
49 	                   std::ratio<674, 774>>::value == 1) );
50   VERIFY( (std::ratio_less<std::ratio<8352, 16904>,
51 	                   std::ratio<17892, 32100>>::value == 1) );
52   VERIFY( (std::ratio_less<std::ratio<2312, 18702>,
53 	                   std::ratio<18458, 19572>>::value == 1) );
54 
55   VERIFY( (std::ratio_less<std::ratio<58, 29130>,
56 	                   std::ratio<58, 29128>>::value == 1) );
57   VERIFY( (std::ratio_less<std::ratio<4732, 12>,
58 	                   std::ratio<4750, 12>>::value == 1) );
59   VERIFY( (std::ratio_less<std::ratio<25702, 25716>,
60 	                   std::ratio<25734, 25740>>::value == 1) );
61   VERIFY( (std::ratio_less<std::ratio<630, 768>,
62 	                   std::ratio<672, 772>>::value == 1) );
63   VERIFY( (std::ratio_less<std::ratio<8354, 16902>,
64 	                   std::ratio<17890, 32102>>::value == 1) );
65   VERIFY( (std::ratio_less<std::ratio<2310, 18700>,
66 	                   std::ratio<18456, 19570>>::value == 1) );
67 }
68 
main()69 int main()
70 {
71   test01();
72   return 0;
73 }
74