Skip to content

Commit

Permalink
Merge pull request #330 from rust-lang/fix/asm-att-const
Browse files Browse the repository at this point in the history
Fix const handling in ATT syntax
  • Loading branch information
antoyo authored Sep 9, 2023
2 parents 15fafe7 + cd1644a commit 6611142
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/run/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6611142

Please sign in to comment.