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