Skip to content

Commit 6611142

Browse files
authored
Merge pull request #330 from rust-lang/fix/asm-att-const
Fix const handling in ATT syntax
2 parents 15fafe7 + cd1644a commit 6611142

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/asm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,6 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
452452
}
453453

454454
InlineAsmOperandRef::Const { ref string } => {
455-
// Const operands get injected directly into the template
456-
if att_dialect {
457-
template_str.push('$');
458-
}
459455
template_str.push_str(string);
460456
}
461457
}

tests/run/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn main() {
124124
// check const (ATT syntax)
125125
let mut x: u64 = 42;
126126
unsafe {
127-
asm!("add {}, {}",
127+
asm!("add ${}, {}",
128128
const 1,
129129
inout(reg) x,
130130
options(att_syntax)

0 commit comments

Comments
 (0)