asm! parsing and lowering fixes

This commit is contained in:
Lukas Wirth 2024-09-05 15:06:37 +02:00
parent c075a9980e
commit f74a0c8801
10 changed files with 106 additions and 18 deletions

View file

@ -2004,6 +2004,36 @@ fn main() {
{
return;
}
"#,
)
}
#[test]
fn asm() {
check(
r#"
//- minicore: asm
#[inline]
pub unsafe fn bootstrap() -> ! {
builtin#asm(
"blabla",
"mrs {tmp}, CONTROL",
// ^^^ read
"blabla",
"bics {tmp}, {spsel}",
// ^^^ read
"blabla",
"msr CONTROL, {tmp}",
// ^^^ read
"blabla",
tmp$0 = inout(reg) 0,
// ^^^
aaa = in(reg) 2,
aaa = in(reg) msp,
aaa = in(reg) rv,
options(noreturn, nomem, nostack),
);
}
"#,
)
}