Add regression tests for duplicate globals with different linkage.
This commit is contained in:
parent
6c3873316b
commit
05d1b8072b
2 changed files with 36 additions and 0 deletions
18
test/err/duplicate-global-static.c
Normal file
18
test/err/duplicate-global-static.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
!!DESCRIPTION!! global duplicated with static variable
|
||||||
|
!!ORIGIN!! cc65 regression tests
|
||||||
|
!!LICENCE!! Public Domain
|
||||||
|
!!AUTHOR!! Piotr Fusik
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
see: https://github.com/cc65/cc65/issues/191
|
||||||
|
*/
|
||||||
|
|
||||||
|
int n = 0;
|
||||||
|
static int n = 0; /* should give an error */
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return n;
|
||||||
|
}
|
18
test/err/duplicate-static-global.c
Normal file
18
test/err/duplicate-static-global.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
!!DESCRIPTION!! static duplicated with global variable
|
||||||
|
!!ORIGIN!! cc65 regression tests
|
||||||
|
!!LICENCE!! Public Domain
|
||||||
|
!!AUTHOR!! Piotr Fusik
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
see: https://github.com/cc65/cc65/issues/191
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int n = 0;
|
||||||
|
int n = 0; /* should give an error */
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
return n;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue