ARM7 example: source file main.c


 1  #include "types.h"
 2  #include "routines.h" 
 3  
 4  
 5  int main (void)
 6  {
 7     uint x = 1;
 8  
 9     Count25 (&x);
10     /* This can be bounded automatically. */
11  
12     Foo7 (&x);
13     /* This can be bounded automatically because Foo7 calls */
14     /* Count with a static value for Count.u.               */
15  
16     Foo (6, &x);
17     /* This can be bounded automatically, because Foo.num = 6,  */
18     /* which makes Count.u = 9, which bounds the loop in Count. */
19  
20     Solve (&x);
21     /* The loop in Solve can be bounded automatically, but not */
22     /* the loop in Count when called from Solve.               */
23  
24     while (1) x++;
25     /* This is a simple eternal loop. Bound-T will report it */
26     /* and include one execution in the WCET.                */
27  
28  }