d31bc6a3f9
corresponding invocation in the ncg table so the same helpers can be used for both mcg and ncg. Add a new IR opcode, FARJUMP, which jumps to a helper function but saves volatile registers.
26 lines
486 B
C
26 lines
486 B
C
#include "test.h"
|
|
|
|
int csa(int i)
|
|
{
|
|
switch (i)
|
|
{
|
|
case 200: return 200;
|
|
case 300: return 300;
|
|
case 400: return 400;
|
|
default: return 0;
|
|
}
|
|
}
|
|
|
|
/* Bypasses the CRT, so there's no stdio or BSS initialisation. */
|
|
void _m_a_i_n(void)
|
|
{
|
|
ASSERT(csa(0) == 0);
|
|
ASSERT(csa(100) == 0);
|
|
ASSERT(csa(200) == 200);
|
|
ASSERT(csa(300) == 300);
|
|
ASSERT(csa(400) == 400);
|
|
ASSERT(csa(500) == 0);
|
|
ASSERT(csa(600) == 0);
|
|
|
|
finished();
|
|
} |