doxygen/tests/upstream-test-suite/035_invariant.c
Petr Šabata 32cf374a4b RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/doxygen#6b0c5db74b337b843ad543bf84325b6e1ef5d040
2020-10-14 23:50:45 +02:00

16 lines
267 B
C

// objective: test \invariant, \pre and \post commands
// check: 035__invariant_8c.xml
/** \file */
/** \invariant i+j=p
* \pre p\>=0
* \post *q=2^(p+1)
*/
void func(int p,int *q)
{
int j = p, k=1, i;
for (i=0; i<=p; i++) j--,k=k*2;
*q = k;
}