File: bitwise_or.c

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 (39 lines) | stat: -rw-r--r-- 774 bytes parent folder | download
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
/* run.config*
   OPT: -big-ints-hex 256 -val @VALUECONFIG@ -journal-disable
*/
#include "__fc_builtin.h"

int or1, or2, or3, or4, or5;
int and1, and2, and3, and4, xor1, xor2;
unsigned int uand1, uand2, uand3, uand4, uand5;
int a,b,c,d,e;
extern unsigned short s;

main(){
  a = Frama_C_interval(3,17);
  b = Frama_C_interval(-3,17);
  c = Frama_C_interval(13,27);
  or1 = a | b;
  or2 = a | c;
  or3 = b | c;

  and1 = a & b;
  and2 = a & c;
  and3 = b & c;

  uand4 = 0xFFFFFFF8U & (unsigned int) c;

  xor1 = a ^ a;
  xor2 = a ^ b;

  unsigned i1 = s * 2;
  unsigned i2 = s * 4;
  unsigned v1 = i1 & i2;
  unsigned v2 = i1 | i2;
  
  unsigned mask07 = (16 * s + 13) & 0x7;
  unsigned mask0f = (16 * s + 13) & 0xF;
  unsigned mask1f = (16 * s + 13) & 0x1F;

  return 0;
}