Add two new trampoline test cases
This commit is contained in:
32
test/val/trampoline-params.c
Normal file
32
test/val/trampoline-params.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
!!DESCRIPTION!! wrapped-call pragma w/ many params
|
||||
!!ORIGIN!! cc65 regression tests
|
||||
!!LICENCE!! Public Domain
|
||||
!!AUTHOR!! Lauri Kasanen
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
static unsigned char flag;
|
||||
|
||||
static void trampoline_set() {
|
||||
asm("ldy tmp4");
|
||||
asm("sty %v", flag);
|
||||
asm("jsr callptr4");
|
||||
}
|
||||
|
||||
#pragma wrapped-call(push, trampoline_set, 4)
|
||||
long adder(long in);
|
||||
#pragma wrapped-call(pop)
|
||||
|
||||
long adder(long in) {
|
||||
|
||||
return in + 7;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
flag = 0;
|
||||
|
||||
return adder(70436) == 70436 + 7 && flag == 4 ? 0 : 1;
|
||||
}
|
||||
Reference in New Issue
Block a user