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

« back to all changes in this revision

Viewing changes to tests/misc/abs_addr.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: -memory-footprint 1 -val -deps -out -input -absolute-valid-range 0x20000-0x3FFFF -journal-disable
 
4
*/
 
5
 
 
6
unsigned short AutoTest[1000]={0};
 
7
 
 
8
unsigned char TstRomUcmm(void)
 
9
{
 
10
 union {unsigned char byte[2];unsigned short word;} rom;
 
11
 unsigned short chkrom;
 
12
 unsigned short *ptrom;
 
13
 
 
14
 
 
15
 ptrom = (unsigned short *)0x020000;
 
16
 chkrom = 0;
 
17
 
 
18
 while(ptrom != (unsigned short *) 0x02FFFE)
 
19
 {
 
20
  rom.word = *ptrom;
 
21
  chkrom = chkrom + rom.byte[0] + rom.byte[1];
 
22
  ptrom++;
 
23
 }
 
24
 if(chkrom != *ptrom)
 
25
 {
 
26
  AutoTest[73] = (unsigned short)1;
 
27
 }
 
28
 
 
29
 
 
30
 ptrom = (unsigned short *)0x030000;
 
31
 chkrom = 0;
 
32
 while(ptrom != (unsigned short *) 0x03FFFE)
 
33
 {
 
34
  rom.word = *ptrom;
 
35
  chkrom = chkrom + rom.byte[0] + rom.byte[1];
 
36
  ptrom++;
 
37
 }
 
38
 if(chkrom != *ptrom)
 
39
 {
 
40
  AutoTest[73] = (unsigned short)1;
 
41
 }
 
42
 return(AutoTest[73]);
 
43
}
 
44
 
 
45
void main(void){
 
46
  TstRomUcmm();
 
47
}