1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00
cc65/test/val/trampoline-params.c
Greg King 88c6dd2da8 Changed empty parameter lists into (void) lists on functions with asm() statements.
The fix avoids any possible problems with how cc65 will handle old-style (K & R) function declarations, in the future.
2019-07-16 13:16:02 -04:00

33 lines
575 B
C

/*
!!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(void) {
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;
}