Debian Codegraph @

gcc/testsuite/g++.dg/contracts/contracts-externC.C

raw
1 // simple check to ensure we don't emit a function with the same name twice,
2 // when wrapping functions in pre- and postconditions.
3 // { dg-do link }
4 // { dg-options "-std=c++2a -fcontracts -fcontract-continuation-mode=on" }
5 // { dg-skip-if "requires hosted libstdc++ for stdc++exp" { ! hostedlib } }
6
7 volatile int x = 10;
8
9 extern "C" void
10 f ()
11 [[ pre: x < 10 ]]
12 {
13 }
14
15 int
16 main ()
17 [[ post: x > 10 ]]
18 {
19 f();
20 }