]> git.sur5r.net Git - cc65/blob - test/ref/cc65090124.c
fef22268f00bea6a8818d231c4e245f08a6eec56
[cc65] / test / ref / cc65090124.c
1 /*
2   !!DESCRIPTION!! 
3   !!ORIGIN!!      testsuite
4   !!LICENCE!!     Public Domain
5   !!AUTHOR!!
6 */
7
8 /*
9 there is a bug in the preprocessor (i think) ... the following works 
10 (compiles) correctly:
11
12 unsigned long fs,fd,a;
13
14 unsigned long _func(unsigned long x,unsigned long y)
15 {
16         return 0;
17 }
18
19 int main(void)
20 {
21         fs=(_func((fd/a),(_func(2,0x0082c90f))));
22 }
23
24 now if i wrap _func into a macro like this:
25
26 #define func(x,y)       _func(x,y)
27
28 int main(void)
29 {
30         fs=(func((fd/a),(func(2,0x0082c90f))));
31 }
32
33 i get "Error: `)' expected" on that line. (this is with the snapshot, freshly 
34 compiled 5 minutes ago)
35 */
36
37 unsigned long fs,fd,a;
38
39 unsigned long _func1(unsigned long x,unsigned long y)
40 {
41         return 0;
42 }
43
44 int test1(void)
45 {
46         fs=(_func1((fd/a),(_func1(2,0x0082c90f))));
47 }
48
49 #define func(x,y)       _func1(x,y)
50
51 int test2(void)
52 {
53         fs=(func((fd/a),(func(2,0x0082c90f))));
54 }
55
56 int main(void)
57 {
58     printf("it works :)\n");
59
60     return 0;
61 }