Cleanup and test X86AsmPrinter::printPCRelImm.

It is only used for asm printing.

On X86 we put basic block addresses on register before passing them to inline
asm, so the MO_MachineBasicBlock case was dead.

MO_ExternalSymbol was dead since any symbol being passed to inline asm
is represented as MO_GlobalAddress.

The MO_GlobalAddress and MO_Register cases were not tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195824 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2013-11-27 06:53:13 +00:00
parent e50e160348
commit ef8a810cd7
2 changed files with 15 additions and 4 deletions

View File

@ -220,11 +220,7 @@ void X86AsmPrinter::printPCRelImm(const MachineInstr *MI, unsigned OpNo,
case MachineOperand::MO_Immediate:
O << MO.getImm();
return;
case MachineOperand::MO_MachineBasicBlock:
O << *MO.getMBB()->getSymbol();
return;
case MachineOperand::MO_GlobalAddress:
case MachineOperand::MO_ExternalSymbol:
printSymbolOperand(MO, O);
return;
}

View File

@ -59,3 +59,18 @@ entry:
%asm = tail call i32 asm sideeffect "", "={ax},i,~{eax},~{flags},~{rax}"(i64 61) nounwind
ret i32 %asm
}
@test8_v = global i32 42
define void @test8() {
call void asm sideeffect "${0:P}", "i"( i32* @test8_v )
ret void
}
define void @test9() {
call void asm sideeffect "${0:P}", "X"( i8* blockaddress(@test9, %bb) )
br label %bb
bb:
ret void
}