2 20020402-3.c from the execute part of the gcc torture suite.
11 #define NULL ((void *) 0)
13 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) // Lack of memory
15 /* extracted from gdb sources */
17 typedef unsigned long long CORE_ADDR
;
22 struct blockvector
*blockvector
;
35 CORE_ADDR startaddr
, endaddr
;
36 struct symbol
*function
;
37 struct block
*superblock
;
38 unsigned char gcc_compile_flag
;
40 struct symbol syms
[1];
45 struct block
*block
[2];
48 struct blockvector
*blockvector_for_pc_sect(register CORE_ADDR pc
,
49 struct symtab
*symtab
)
51 register struct block
*b
;
52 register int bot
, top
, half
;
53 struct blockvector
*bl
;
55 bl
= symtab
->blockvector
;
63 half
= (top
- bot
+ 1) >> 1;
64 b
= bl
->block
[bot
+ half
];
65 if (b
->startaddr
<= pc
)
84 void testTortureExecute(void)
86 #if !(defined (__SDCC_mcs51) && defined (__SDCC_MODEL_SMALL)) && !defined(__SDCC_pdk14) // Not enough memory
87 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
88 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) // No long long
89 struct block a
= { 0, 0x10000, 0, 0, 1, 20 };
90 struct block b
= { 0x10000, 0x20000, 0, 0, 1, 20 };
91 struct blockvector bv
= { 2, { &a
, &b
} };
92 struct symtab s
= { &bv
};
94 struct blockvector
*ret
;
96 ret
= blockvector_for_pc_sect(0x500, &s
);
98 ASSERT (ret
!= NULL
&& ret
->nblocks
== 2);
99 ASSERT (ret
->block
[0] != NULL
&& ret
->block
[0]->startaddr
== 0LL && ret
->block
[0]->endaddr
== 65536LL);
100 ASSERT (ret
->block
[1] != NULL
&& ret
->block
[1]->startaddr
== 65536LL && ret
->block
[1]->endaddr
== 131072LL);