Debian Codegraph @

gcc/testsuite/g++.dg/modules/contracts-2_b.C

raw
1 // { dg-additional-options "-fmodules-ts -fcontracts -fcontract-role=default:maybe,maybe,ignore" }
2 module;
3 #include <cstdio>
4 module foo;
5
6 int fn1(int x)
7 {
8 printf("%s(%d)\n", __FUNCTION__, x);
9 return x;
10 }
11
12 int fn_iso(int n) [[ pre: pre_print(n) > 0 ]]
13 {
14 printf("%s(%d)\n", __FUNCTION__, n);
15 return n;
16 }
17
18 int pre_print2(int n)
19 {
20 printf("pre_print(%d)\n", n);
21 return n;
22 }
23
24 int fn2(int x)
25 {
26 printf("%s(%d)\n", __FUNCTION__, x);
27 return x;
28 }
29
30 int fn3(int x)
31 {
32 printf("%s(%d)\n", __FUNCTION__, x);
33 return x;
34 }
35
36 // { dg-skip-if "requires hosted libstdc++ for cstdio" { ! hostedlib } }