1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-03 10:07:02 +00:00
cc65/test/ref/macro.c

31 lines
589 B
C
Raw Normal View History

2014-09-24 14:45:10 +00:00
/*
!!DESCRIPTION!! macro bug test program
!!ORIGIN!! testsuite
!!LICENCE!! Public Domain
!!AUTHOR!! Groepaz/Hitmen
*/
#include <stdio.h>
#include <stdlib.h>
unsigned long fs=7;
unsigned long fd=5;
unsigned long a=3;
unsigned long _func(unsigned long x,unsigned long y)
{
2019-02-12 21:50:49 +00:00
printf("x:%ld y:%ld\n",x,y);
return 0;
2014-09-24 14:45:10 +00:00
}
2019-02-12 21:50:49 +00:00
#define func(x,y) _func(x,y)
2014-09-24 14:45:10 +00:00
int main(void)
{
2019-02-12 21:50:49 +00:00
fs= func( (fd/a) , func(2,0x0082c90f) );
printf("fs:%ld\n",fs);
fs=_func( (fd/a) , _func(2,0x0082c90f) );
printf("fs:%ld\n",fs);
return 0;
2014-09-24 14:45:10 +00:00
}