Merge pull request #411 from pfusik/bss-name-regression

Fix regression of #pragma bss-name
This commit is contained in:
Oliver Schmidt
2017-03-22 13:44:48 +01:00
committed by GitHub
8 changed files with 87 additions and 11 deletions

22
test/val/bss-name-decl.c Normal file
View File

@@ -0,0 +1,22 @@
/*
!!DESCRIPTION!! bss-name pragma not affecting declarations
!!ORIGIN!! cc65 regression tests
!!LICENCE!! Public Domain
!!AUTHOR!! Piotr Fusik
*/
/*
see: https://github.com/cc65/cc65/issues/409
*/
#pragma bss-name (push,"ZEROPAGE")
char n; /* only a declaration because followed by definition */
char n = 1; /* not BSS */
#pragma bss-name (pop)
int main(void)
{
return (unsigned) &n >= 0x100 ? 0 : 1;
}

21
test/val/bss-name.c Normal file
View File

@@ -0,0 +1,21 @@
/*
!!DESCRIPTION!! bss-name pragma
!!ORIGIN!! cc65 regression tests
!!LICENCE!! Public Domain
!!AUTHOR!! Piotr Fusik
*/
/*
see: https://github.com/cc65/cc65/issues/409
*/
#pragma bss-name (push,"ZEROPAGE")
char zp_var;
#pragma bss-name (pop)
int main(void)
{
return (unsigned) &zp_var < 0x100 ? 0 : 1;
}