ack/plat/qemuppc/tests/csa_e.c
David Given d31bc6a3f9 Made csa and csb work with mcg; adjust the libem functions and the
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.
2016-11-19 10:55:41 +01:00

26 lines
456 B
C

#include "test.h"
int csa(int i)
{
switch (i)
{
case 2: return 2;
case 3: return 3;
case 4: return 4;
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(1) == 0);
ASSERT(csa(2) == 2);
ASSERT(csa(3) == 3);
ASSERT(csa(4) == 4);
ASSERT(csa(5) == 0);
ASSERT(csa(6) == 0);
finished();
}