struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-2793.c
blobc171a520e8330503c1844c1fe661bf3f09459889
1 /* bug-2793.c
2 A parameter changed from unsigned int to unsigned long in CSE.
3 */
5 #include <testfwk.h>
7 typedef unsigned int UINT;
8 typedef unsigned char BYTE;
9 typedef unsigned short WORD;
10 typedef unsigned long DWORD;
12 BYTE global_buf[10];
14 static void mem_set (void* dst, int val, UINT cnt)
16 ASSERT (dst == global_buf);
17 ASSERT (val == 0);
18 ASSERT (cnt == 1);
21 void f_mkfs (
22 void* work,
23 UINT len
26 const UINT n_fats = 1;
28 BYTE *buf;
29 WORD ss = 1;
30 DWORD szb_buf, sz_buf, sect, nsect, n;
31 DWORD b_fat;
32 DWORD sz_fat;
33 UINT i;
35 b_fat = 1;
36 sz_fat = 0;
39 buf = (BYTE*)work;
40 sz_buf = len / ss;
41 szb_buf = sz_buf * ss;
45 mem_set(buf, 0, (UINT)szb_buf);
46 sect = b_fat;
47 for (i = 0; i < n_fats; i++) {
48 nsect = sz_fat;
49 do {
50 n = (nsect > sz_buf) ? sz_buf : nsect;
51 mem_set(buf, 0, ss);
52 sect += n; nsect -= n;
53 } while (nsect);
58 void testBug(void)
60 f_mkfs (global_buf, 1);