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

« back to all changes in this revision

Viewing changes to tests/pdg/multiple_calls.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
/* run.config
 
2
   GCC:
 
3
   OPT: -inout -deps -main appel_ptr_fct -pdg-debug "-fct-pdg appel_ptr_fct" -journal-disable
 
4
   OPT: -inout -deps -main appel_ptr_fct_bis -pdg-debug "-fct-pdg appel_ptr_fct_bis" -journal-disable
 
5
*/
 
6
 
 
7
extern int G1, G2, G3, G4;
 
8
 
 
9
int fct1 (int x, int y, int z) {
 
10
  G1 = z;
 
11
  G3 = y;
 
12
  G4 = z;
 
13
  return x;
 
14
}
 
15
int fct2 (int x, int y, int z) {
 
16
  G2 = z;
 
17
  G3 = x;
 
18
  return y;
 
19
}
 
20
int appel_ptr_fct (int c, int d) {
 
21
  int a = 1, b = 2;
 
22
  int (*pf) (int, int) = c ? &fct1 : &fct2;
 
23
  int x = (*pf)(a, b, d);
 
24
  return x + G1 + G2;
 
25
}
 
26
int appel_ptr_fct_bis (int c, int a, int b, int d) {
 
27
  int (*pf) (int, int) = c ? &fct1 : &fct2;
 
28
  G4 = (*pf)(a, b, d);
 
29
  return G4 ;
 
30
}