Merge branch 'master' into sane_makefile_output
This commit is contained in:
@@ -47,10 +47,11 @@ _Pragma _Pragma (
|
||||
#pragma bss-name("BSS")
|
||||
{
|
||||
extern int y;
|
||||
#pragma bss-name("BSS2")
|
||||
#pragma bss-name("BSS") // used to be BSS2, but fix for #2608 means
|
||||
// that now causes ld65 to fail, so we use BSS instead
|
||||
static
|
||||
#pragma zpsym ("y")
|
||||
int x; // TODO: currently in "BSS", but supposed to be in "BSS2"?
|
||||
int x;
|
||||
x = 0;
|
||||
|
||||
if (memcmp(str, "aBC", 3))
|
||||
|
||||
40
test/val/bug2608.c
Normal file
40
test/val/bug2608.c
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
/* bug #2608: "zp_bss" is placed in BSS and NOT placed in ZEROPAGE as expected. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int err = 0;
|
||||
|
||||
int is_zeropage(void *p)
|
||||
{
|
||||
if (/*(p >= ((void*)0)) &&*/
|
||||
(p <= ((void*)0xff))) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void foo(void) {
|
||||
#pragma bss-name(push,"ZEROPAGE")
|
||||
#pragma data-name(push,"ZEROPAGE")
|
||||
static int zp_data = 5;
|
||||
static char zp_bss;
|
||||
#pragma bss-name(pop)
|
||||
#pragma data-name(pop)
|
||||
printf("zp_data at 0x%04x (%szp)\n", &zp_data, is_zeropage(&zp_data) ? "" : "NOT ");
|
||||
printf("zp_bss at 0x%04x (%szp)\n", &zp_bss, is_zeropage(&zp_bss) ? "" : "NOT ");
|
||||
if (!is_zeropage(&zp_data)) {
|
||||
err++;
|
||||
}
|
||||
if (!is_zeropage(&zp_bss)) {
|
||||
err++;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
foo();
|
||||
printf("errors: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
Reference in New Issue
Block a user