[WebAssembly] Use the new offset syntax for memory operands in inline asm.

llvm-svn: 255788
This commit is contained in:
Dan Gohman 2015-12-16 18:14:49 +00:00
parent 88a7a2eac7
commit e2831b4e27
2 changed files with 4 additions and 2 deletions

View File

@ -260,7 +260,9 @@ bool WebAssemblyAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
report_fatal_error("There are no defined alternate asm variants");
if (!ExtraCode) {
OS << regToString(MI->getOperand(OpNo));
// TODO: For now, we just hard-code 0 as the constant offset; teach
// SelectInlineAsmMemoryOperand how to do address mode matching.
OS << "0(" + regToString(MI->getOperand(OpNo)) + ')';
return false;
}

View File

@ -21,7 +21,7 @@ entry:
; CHECK-LABEL: bar:
; CHECK-NEXT: .param i32, i32{{$}}
; CHECK-NEXT: #APP{{$}}
; CHECK-NEXT: # $1 = bbb($0){{$}}
; CHECK-NEXT: # 0($1) = bbb(0($0)){{$}}
; CHECK-NEXT: #NO_APP{{$}}
; CHECK-NEXT: return{{$}}
define void @bar(i32* %r, i32* %s) {