1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-02 04:41:35 +00:00
cc65/test/val/trampoline-params.c

33 lines
571 B
C
Raw Normal View History

2017-05-19 11:20:04 +00:00
/*
!!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() {
2019-02-12 21:50:49 +00:00
asm("ldy tmp4");
asm("sty %v", flag);
asm("jsr callptr4");
2017-05-19 11:20:04 +00:00
}
#pragma wrapped-call(push, trampoline_set, 4)
long adder(long in);
#pragma wrapped-call(pop)
long adder(long in) {
2019-02-12 21:50:49 +00:00
return in + 7;
2017-05-19 11:20:04 +00:00
}
int main() {
2019-02-12 21:50:49 +00:00
flag = 0;
2017-05-19 11:20:04 +00:00
2019-02-12 21:50:49 +00:00
return adder(70436) == 70436 + 7 && flag == 4 ? 0 : 1;
2017-05-19 11:20:04 +00:00
}