From e52ea8642102c0fea475dbf7e24714c7edf63cd1 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 24 Oct 2026 13:40:53 +0200 Subject: [PATCH] urust: fixed test --- test/cli/testworker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cli/testworker.js b/test/cli/testworker.js index 835954de..db082cd6 100644 --- a/test/cli/testworker.js +++ b/test/cli/testworker.js @@ -415,7 +415,8 @@ describe('Worker', function() { it('should pass include_bytes! files to urust', async function() { if (!haveUrust) return this.skip(); - var code = 'use rs8::reset;\nstatic ART: [u8; 3] = *include_bytes!("art.bin");\nstatic mut OUT: u8 = 0;\n#[reset]\nfn main() {\n unsafe { OUT = ART[1]; }\n}\n'; + // #[keep] stops the optimizer from dropping ART along with the never-read OUT + var code = 'use rs8::reset;\n#[keep] static ART: [u8; 3] = *include_bytes!("art.bin");\nstatic mut OUT: u8 = 0;\n#[reset]\nfn main() {\n unsafe { OUT = ART[1]; }\n}\n'; var msg = {updates:[{path:'main.rs', data:code}, {path:'art.bin', data:new Uint8Array([7,8,9])}], buildsteps:[{path:'main.rs', platform:'devel-6502', tool:'urust', mainfile:true, files:['main.rs','art.bin']}]}; var result = await buildOne(msg);