mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 12:02:08 +00:00
Add tests for purging symbols
This commit is contained in:
13
test/asm/purge-refs.asm
Normal file
13
test/asm/purge-refs.asm
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
SECTION "floating purging", ROM0
|
||||
|
||||
Floating:
|
||||
db Floating
|
||||
PURGE Floating ; This used to cause a use-after-free
|
||||
; To increase the chances of the data being re-allocated, it's not last
|
||||
|
||||
SECTION "fixed purging", ROM0[0]
|
||||
|
||||
Fixed:
|
||||
db Fixed
|
||||
PURGE Fixed ; Can work, it's a constant
|
||||
3
test/asm/purge-refs.err
Normal file
3
test/asm/purge-refs.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: purge-refs.asm(6):
|
||||
Symbol "Floating" is referenced and thus cannot be purged
|
||||
error: Assembly aborted (1 errors)!
|
||||
0
test/asm/purge-refs.out
Normal file
0
test/asm/purge-refs.out
Normal file
13
test/asm/purge.asm
Normal file
13
test/asm/purge.asm
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
SECTION "purging", ROM0
|
||||
|
||||
Label:
|
||||
PURGE Label
|
||||
Label:
|
||||
|
||||
db Referenced
|
||||
PURGE Referenced ; Should fail
|
||||
|
||||
Exported::
|
||||
PURGE Exported
|
||||
Exported::
|
||||
3
test/asm/purge.err
Normal file
3
test/asm/purge.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: purge.asm(9):
|
||||
Symbol "Referenced" is referenced and thus cannot be purged
|
||||
error: Assembly aborted (1 errors)!
|
||||
0
test/asm/purge.out
Normal file
0
test/asm/purge.out
Normal file
Reference in New Issue
Block a user