X-Git-Url: http://git.joshuawise.com/firearm.git/blobdiff_plain/392d1bec43dcfb806fbdf77380c334f2cdc84778..b45b7b7cecfef2b61eb74a6047c6994a100299be:/tests/testbench.c diff --git a/tests/testbench.c b/tests/testbench.c index ff9f96c..0c1cb77 100644 --- a/tests/testbench.c +++ b/tests/testbench.c @@ -19,6 +19,7 @@ void puthex(unsigned int x) #include "ack.c" #include "j4cbo.c" #include "corecurse.c" +#include "miniblarg.c" int fact(int n) { @@ -43,7 +44,10 @@ struct tests { extern int ldm_bonehead(); -__asm__( +#ifndef X86 +int shnasto() +{ +__asm__ volatile( ".globl ldm_bonehead\n" "ldm_bonehead:;" "mov r3, lr;" @@ -59,8 +63,9 @@ __asm__( "nop;" "mov pc, r3\n;" "1:\n" -"ldr r2, =0x00002FE0;" -"ldr r1, =0x0000004C;" +"mov r2, #0x00002F00;" +"orr r2, r2, #0x000000E0;" +"mov r1, #0x0000004C;" "mov ip, sp;" "stmdb sp!, {fp, ip, lr, pc};" "mov r0, #0x00880000;" @@ -69,10 +74,16 @@ __asm__( "nop;" "nop;\n" ); +} +#endif void ldm_tester() { +#ifdef X86 + int x = 0x00880000; +#else int x = ldm_bonehead(); +#endif if (x != 0x00880000) { puts("FAIL: result was "); @@ -87,6 +98,7 @@ struct tests tlist[] = { {"fact", facttest}, {"j4cbo", j4cbo}, {"ack", acktest}, + {"miniblarg", testmain}, {"corecurse", corecurse}, {0, 0}};