blob: 28c08f85e41532e03c0b63a47160d4d87aeb76a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// 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;
}
|