File: main.c

package info (click to toggle)
cbmc 6.6.0-4
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 153,852 kB
  • sloc: cpp: 386,459; ansic: 114,466; java: 28,405; python: 6,003; yacc: 4,552; makefile: 4,041; lex: 2,487; xml: 2,388; sh: 2,050; perl: 557; pascal: 184; javascript: 163; ada: 36
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);
}