1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00

testcase for issue #1357

This commit is contained in:
mrdudz 2021-05-24 13:53:14 +02:00
parent 0db23a8951
commit adda9438d2
2 changed files with 36 additions and 0 deletions

View File

@ -106,6 +106,12 @@ $(WORKDIR)/bug1263.$1.$2.prg: bug1263.c | $(WORKDIR)
$(if $(QUIET),echo misc/bug1263.$1.$2.prg)
$(NOT) $(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
# should compile, but gives an error
$(WORKDIR)/bug1357.$1.$2.prg: bug1357.c | $(WORKDIR)
@echo "FIXME: " $$@ "currently does not compile."
$(if $(QUIET),echo misc/bug1357.$1.$2.prg)
$(NOT) $(CC65) -t sim$2 -$1 -o $$@ $$< $(NULLERR)
# this one requires --std=c89, it fails with --std=c99
$(WORKDIR)/bug1265.$1.$2.prg: bug1265.c | $(WORKDIR)
$(if $(QUIET),echo misc/bug1265.$1.$2.prg)

30
test/misc/bug1357.c Normal file
View File

@ -0,0 +1,30 @@
/* issue #1357 - X Macros don't work with C preprocessor */
#define OPCODES(X) \
X(PUSHNIL) \
X(PUSHTRUE) \
X(PUSHFALSE)
enum {
#define X(op) op,
OPCODES(X)
#undef X
N_OPS
};
/* cc65 -E bug1357.c -o bug1357.c.pre
should produce something like this:
enum {
PUSHNIL,
PUSHTRUE,
PUSHFALSE,
N_OPS
};
*/
int main(void)
{
return 0;
}