gcc/testsuite/g++.dg/modules/contracts-4_d.C
raw| 1 | // { dg-module-do run } |
| 2 | // { dg-additional-options "-fmodules-ts -fcontracts" } |
| 3 | // { dg-skip-if "requires hosted libstdc++ for cstdio" { ! hostedlib } } |
| 4 | |
| 5 | #include <cstdio> |
| 6 | import foo; |
| 7 | import bar; |
| 8 | |
| 9 | int main(int, char**) |
| 10 | { |
| 11 | int x = -1; |
| 12 | |
| 13 | printf("calling fn_int\n"); |
| 14 | fn_int(x--); |
| 15 | printf("calling bar_fn_int\n"); |
| 16 | bar_fn_int(x--); |
| 17 | |
| 18 | return violation_count - 4; |
| 19 | } |
| 20 | |
| 21 | // TODO verify dg-output as well once the testsuite supports it |
| 22 |