Fix const handling in ATT syntax

This commit is contained in:
Antoni Boucher 2023-09-09 12:50:25 -04:00
parent e39f3a2484
commit cd1644a658
2 changed files with 1 additions and 5 deletions

View File

@ -452,10 +452,6 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
}
InlineAsmOperandRef::Const { ref string } => {
// Const operands get injected directly into the template
if att_dialect {
template_str.push('$');
}
template_str.push_str(string);
}
}

View File

@ -124,7 +124,7 @@ fn main() {
// check const (ATT syntax)
let mut x: u64 = 42;
unsafe {
asm!("add {}, {}",
asm!("add ${}, {}",
const 1,
inout(reg) x,
options(att_syntax)