Add test for reading slice in extram which is out of bounds

This commit is contained in:
Toby Jaffey 2025-12-13 23:10:49 +00:00
parent 18d787a7b9
commit b083008d7b
3 changed files with 13 additions and 8 deletions

View file

@ -49,7 +49,7 @@ void main(void) {
p[2] = 'l';
p[3] = 'l';
p[4] = 'o';
printbuf(p, 5); // try to print from extram (unterminated)
printbuf(p, 5); // try to print from extram (slice)
} break;
case TEST10: {
uint8_t *p = (uint8_t *)UVM32_EXTRAM_BASE;
@ -69,6 +69,10 @@ void main(void) {
// pass a string beyond end of MMIO region
println((uint32_t)UVM32_EXTRAM_BASE + 8); // extram has been shrunk, this is now out of bounds, or no terminator found
} break;
case TEST13: {
// pass a slice beyond end of extram
printbuf((uint32_t)UVM32_EXTRAM_BASE + 32, 64); // extram has been shrunk, this is now out of bounds,
} break;
}
}