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:
parent
ce0cf85386
commit
6c3873316b
20
test/err/duplicate-global.c
Normal file
20
test/err/duplicate-global.c
Normal 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;
|
||||
}
|
20
test/err/duplicate-static.c
Normal file
20
test/err/duplicate-static.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user