File: callwise.c

package info (click to toggle)
frama-c 20140301%2Bneon%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 19,548 kB
  • ctags: 28,183
  • sloc: ml: 181,252; ansic: 13,776; makefile: 2,452; sh: 1,085; lisp: 178
file content (48 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* run.config
   OPT: -check -calldeps -slice-return main -slicing-level 2 -journal-disable -then-on 'Slicing export' -print
*/

int a = 1, b = 1, c = 1, d = 1, *p;

void f(int *p, int *q)
{
  *p  += *q;
}

int choose (int cond, int x, int y) {
  return cond ? x : y;
}

void fs163_f (int *p,int n) {
  *p = n;
}

int fs163_main (int n) {
  int A,B,C;
  int T[5];

  fs163_f (&A, 1);
  fs163_f (&B, n);
  fs163_f (&C, 2);
  fs163_f (&T[0], 0);
  fs163_f (&T[1], 1);
  for (int i=0; i<5; i++)
    fs163_f (&T[i],i);

  return T[3];
}

int main(void)
{
  int n = 2, m = 3;

  f(&a, &b);
  f(&c, &d);

  b = choose (0, n, m);
  a += choose (1, n, m);

  a += fs163_main (10);

  return a;
}