mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +00:00
added testcase for issue #975
This commit is contained in:
parent
36ff372149
commit
5597b83d04
18
test/misc/bug975.c
Normal file
18
test/misc/bug975.c
Normal file
@ -0,0 +1,18 @@
|
||||
/* bug #975 - Forward array reference fails to compile */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
// this works
|
||||
static const unsigned char array2[3];
|
||||
int test2(void) {
|
||||
return array2[0];
|
||||
}
|
||||
static const unsigned char array2[] = { 0, 1, 2 };
|
||||
|
||||
// this should work, but does not compile
|
||||
static const unsigned char array[];
|
||||
int main() {
|
||||
if (test2() != 0) return EXIT_FAILURE;
|
||||
return array[0];
|
||||
}
|
||||
static const unsigned char array[] = { 0, 1, 2 };
|
Loading…
Reference in New Issue
Block a user