Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug3397636.c
blobe579301f2561da9f545119cf665c8b7139a57ff1
1 /*
2 bug3397636.c
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 85 // Unref. function arg. buf in cf_rdblk().
9 typedef unsigned char u8;
10 typedef unsigned short u16;
12 unsigned sf_page_size;
14 void sf_read_device_id( void ) {
15 sf_page_size = 0x0108;
18 u16 cf_rdblk( u8 *buf, int bufsize ) {
19 ASSERT(bufsize == 0x108);
20 return 4;
23 void far_cf_read() {
24 u8 cf_buf[1];
26 u16 block=0x0CC0;
27 u16 result;
29 sf_read_device_id( );
31 while(1) {
32 result=cf_rdblk((u8 *)cf_buf, sf_page_size);
34 if(result==4)
35 return;
36 block--;
40 void testBug(void) {
41 far_cf_read();