Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / bug-3079.c
blobb839faad1e3c21bb49854b507c46f481d3797a76
1 /* bug-3079.c
2 A crash in code generation for 8-bit parameters to __smallc functions.
3 */
5 #include <testfwk.h>
7 #pragma disable_warning 283
9 #if !defined(__SDCC_z80) && !defined(__SDCC_z180) && !defined(__SDCC_gz80)
10 #define __smallc
11 #endif
13 unsigned char func2()
15 return 0xa5;
18 int esxdos_f_read(unsigned char handle) __smallc
20 ASSERT (handle == 0xa5);
21 return 0;
24 void
25 testBug(void)
27 unsigned char h;
29 h =func2();
30 esxdos_f_read(h); // SIGSEGV when h allocated to lower half of register pair.