File: combine.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 (28 lines) | stat: -rw-r--r-- 405 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
/* run.config
   EXECNOW: make -s tests/slicing/combine.opt
   CMD: tests/slicing/combine.opt
   OPT: -check -deps -journal-disable
*/

//@ assigns \result \from x;
int g (int x);

int f (int c, int x) {
  int y = c ? 1 : -1;
  int r;
  if (y < 0)
    r = x+y;
  else
    r = 0;
  r = g (r);
  return r;
}

int main (int x) {
  int r;
  if (x > 0)
    r = f (0, x);
  else
    r = f (1, x);
  return r;
}