4 static const char *_maps
[] =
7 "immedvala", "#0x%02X",
10 "stdlibpath", "{basepath}/lib/{port}",
11 "stdlibname", "{port}.lib",
12 "portouttypeflag", "-i",
13 "srcfilename", "fish",
15 "crt0name", "{stdlibpath}/crt0{portobjext}",
17 "otherobjfiles", "none",
18 "basepath", "/home/michaelh/sdcc",
23 _populateHash(const char **pin
)
29 printf("Adding %s -> %s\n", pin
[0], pin
[1]);
30 shash_add (&pret
, pin
[0], pin
[1]);
39 _testEval(hTab
*ph
, const char *pin
, const char *pexpect
, ...)
44 va_start(ap
, pexpect
);
46 pgot
= mvsprintf(ph
, pin
, ap
);
48 if (strcmp(pgot
, pexpect
) != 0)
50 printf("Fail: expected: %s, got %s\n", pexpect
, pgot
);
54 printf("%s -> %s\n", pin
, pgot
);
63 hTab
*ph
= _populateHash(_maps
);
65 _testEval(ph
, "{immedzero}", "#0");
66 _testEval(ph
, "{immedvala}", "#0x23", 0x23);
67 _testEval(ph
, "{stra}", "#0", "{immedzero}");
69 printf("Link command:\n%s\n",
71 "link-{port} -n -c -- -b_CODE=0x%04X -b_DATA=0x%04X"
72 " -m -j -k{stdlibpath} -l{stdlibname} {portouttypeflag}"
73 " {srcfilename}{portoutext} {crt0name} {srcfilename}{portobjext} {otherobjfiles}",