~ubuntu-branches/debian/sid/frama-c/sid

« back to all changes in this revision

Viewing changes to tests/misc/struct_call.c

  • Committer: Bazaar Package Importer
  • Author(s): Mehdi Dogguy
  • Date: 2009-06-03 08:19:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090603081925-kihvxvt0wy3zc4ar
Tags: upstream-20081201.dfsg
ImportĀ upstreamĀ versionĀ 20081201.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
int G= 77;
 
2
int GG;
 
3
 
 
4
struct A { int x; int y; };
 
5
struct B { int z; int t; };
 
6
 
 
7
struct A t[4];
 
8
struct A tt[5];
 
9
 
 
10
int g(struct A s)
 
11
{
 
12
  CEA_G(s);
 
13
  return s.y; // (*((struct B*)(&t[1]))).t;
 
14
  
 
15
}
 
16
 
 
17
struct A create_A() {
 
18
  struct A r={0,0};
 
19
  r.x = 1;
 
20
//  r.y = 2;
 
21
  CEA_GG(r);
 
22
  return r;
 
23
}
 
24
 
 
25
int main(void)
 
26
{
 
27
  int i = 2 - 1;
 
28
  t[1].y = G;
 
29
  GG = g(tt[i]);
 
30
  struct A init = create_A();
 
31
  return g(t[i]); // loosing some precision because of call with struct
 
32
}