File: main.c

package info (click to toggle)
cbmc 5.10-5
  • links: PTS
  • area: main
  • in suites: buster
  • size: 73,416 kB
  • sloc: cpp: 264,330; ansic: 38,268; java: 19,025; python: 4,539; yacc: 4,275; makefile: 2,547; lex: 2,394; sh: 932; perl: 525; xml: 289; pascal: 169
file content (53 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (4)
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
struct tag1 {
  int f;
  int g;
  int *p;
  int a[2];
} x;

struct tag1 y={ 1, 2, &x.f };

struct tag1 z={ 1>>3 };

struct tag1 array[]={ 1, 2, 0, 3, 4, 5, 6 };

struct tag1 S1={ .g=2, .p=0 };

struct tag2 {
  int a, b;
};

struct tag3 {
  struct tag2 s1, s2;
};

struct tag3 S2={ 1, 2, 3, 4 };

struct tag3 S3={ .s1={ 1, 2 }, .s2={ 3, 4 } };

int main() {
  assert(x.f == 0);
  assert(x.g == 0);
  assert(x.p == 0);

  assert(y.f==1);
  assert(y.g==2);
  assert(y.p==&x.f);

  assert(array[0].f==1);
  assert(array[1].g==6);

  assert(S1.f==0);
  assert(S1.g==2);
  assert(S1.p==0);

  assert(S2.s1.a==1);
  assert(S2.s1.b==2);
  assert(S2.s2.a==3);
  assert(S2.s2.b==4);

  assert(S3.s1.a==1);
  assert(S3.s1.b==2);
  assert(S3.s2.a==3);
  assert(S3.s2.b==4);
}