1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 00:29:31 +00:00

Add regression tests for duplicate global/static variables detected by the compiler.

This commit is contained in:
Piotr Fusik 2017-03-09 20:49:20 +01:00
parent ce0cf85386
commit 6c3873316b
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
/*
!!DESCRIPTION!! duplicate globals
!!ORIGIN!! cc65 regression tests
!!LICENCE!! Public Domain
!!AUTHOR!! Piotr Fusik
*/
/*
see: https://github.com/cc65/cc65/issues/191
*/
#pragma warn(error, on)
int n = 0;
int n = 0; /* should give an error */
int main(void)
{
return n;
}

View File

@ -0,0 +1,20 @@
/*
!!DESCRIPTION!! duplicate static variables
!!ORIGIN!! cc65 regression tests
!!LICENCE!! Public Domain
!!AUTHOR!! Piotr Fusik
*/
/*
see: https://github.com/cc65/cc65/issues/191
*/
#pragma warn(error, on)
static int n = 0;
static int n = 0; /* should give an error */
int main(void)
{
return n;
}