1 // { dg-options "-mieee" { target alpha*-*-* } }
2 // { dg-options "-mieee" { target sh*-*-* } }
4 // Copyright (C) 2005, 2009 Free Software Foundation
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 3, or (at your option)
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 COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
21 // 18.2.1.1 template class numeric_limits
24 #include <testsuite_hooks.h>
28 test_traps(T r = T(0))
31 volatile value_type i(5);
32 volatile value_type j(0);
34 if (!std::numeric_limits<value_type>::traps)
42 test_traps<unsigned int>();
44 test_traps<unsigned long>();
45 test_traps<long long>();
46 test_traps<unsigned long long>();
49 For floating points, trapping is a different, more complicated
50 story. If is_iecxxx is true, then division by zero would not trap
51 (infinity). If is_iecxxx is false, we don't know (VAX may trap for
52 0/0 -- I have to check). For most cases (i.e. IEE-754), trapping
53 for floating points have to do with whether there is a support for
57 // test_traps<float>();
58 // test_traps<double>();
59 // test_traps<long double>();