ipa-cp: Perform operations in the appropriate types (PR 118097)
[gcc.git] / gcc / testsuite / g++.dg / contracts / pr110159.C
blob3cf5967cfd6f007cb28aebfac8394cf81ab10679
1 // check that contracts can be handled even when exceptions are disabled
2 // { dg-do run }
3 // { dg-options "-std=c++2a -fcontracts -fno-exceptions " }
4 // { dg-skip-if "requires hosted libstdc++ for stdc++exp" { ! hostedlib } }
5 // { dg-output "contract violation in function f at .* a<5" }
7 #include <exception>
8 #include <cstdlib>
10 int terminate_called = 0;
11 void my_term()
13     std::exit(0);
17 void f(int a)
18   [[ pre : a<5 ]]
19   {
20   }
22 int
23 main ()
25   std::set_terminate (my_term);
26   f(3);
27   f(10);