aboutsummaryrefslogtreecommitdiffstats
path: root/src/examples/busy.c
blob: cec5fcf0c5cb416c8f3ef863a2d915c588fd8382 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* klaar@ida

   Just do some work, and then exit with status given by first
   argument.

   Normally called by some parent test program.
 */

#include <syscall.h>
#include <stdlib.h>
#include <stdio.h>

int main (int argc, char* argv[])
{
  int i;
  
  if (argc != 2)
    return 0;
  
  for(i = 0; i < 200000; i++)
  {
    int a = (i * i) + (i * i);
    int b = i;
    i = a; a = b; i = b;
  }
  return atoi(argv[1]);
}