gcc/testsuite/g++.dg/contracts/contracts4.C
raw| 1 | // ensure an audit level assert with a failing predicate does not generate an |
| 2 | // error during runtime when the contract build level is default |
| 3 | // { dg-do run } |
| 4 | // { dg-options "-std=c++2a -fcontracts" } |
| 5 | // { dg-skip-if "requires hosted libstdc++ for stdc++exp" { ! hostedlib } } |
| 6 | |
| 7 | int main() |
| 8 | { |
| 9 | int x = 1; |
| 10 | [[assert audit: x < 0]]; |
| 11 | return 0; |
| 12 | } |