File: shift_big.i

package info (click to toggle)
frama-c 20161101%2Bsilicon%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,324 kB
  • ctags: 35,695
  • sloc: ml: 200,142; ansic: 31,465; makefile: 2,334; sh: 1,643; lisp: 259; python: 85; asm: 26
file content (72 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download | duplicates (5)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
volatile int nondet;

int t1() {
  unsigned int j = nondet;
  unsigned i = 1 << j;
  return i;
}

int t2() {
  unsigned int j = 1;
  if (nondet) j = 10;
  if (nondet) j = 31;
  if (nondet) j = 1000000000;
  if (nondet) j = 2000000000;
  unsigned i = 1 << j;
  return i;
}

void t3() {
  unsigned int x = 1000000000;
  int i;
  for (i = 1000000000; i < 2000000000; i++) {
    if (nondet) x = i;
  }
  //@assert 1 << (1 << x) > 0;
}

void t4() {
  unsigned int x = 1000000000;
  if (nondet)  x = 1000000001;
  //@assert 1 << (1 << x) > 0;
}

void t5() {
  unsigned int x = 1000000000;
  int i;
  for (i = 1000000000; i < 2000000000; i++) {
    if (nondet) x = i;
  }
  //@assert 1 << (1 >> x) > 0;
}

void t6() {
  unsigned int x = 1000000000;
  if (nondet)  x = 1000000001;
  //@assert 1 << (1 >> x) > 0;
}

void t7() {
  unsigned int x = 1022;
  if (nondet)  x = 1023;
  //@assert 1 << (1 << x) > 0;
}

void t8() {
  unsigned int x = 1022;
  if (nondet)  x = 1023;
  //@assert 1 << (1 >> x) > 0;
}

int main() {
  int r = 0;
  if (nondet) r += t1();
  if (nondet) r += t2();
  t3();
  t4();
  t5();
  t6();
  t7();
  t8();
  return r;
}