Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on X86. The %c modifier
authorChris Lattner <sabre@nondot.org>
Thu, 25 Jan 2007 02:53:24 +0000 (02:53 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 25 Jan 2007 02:53:24 +0000 (02:53 +0000)
says that no $ prefix should be emitted on X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33495 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ATTAsmPrinter.cpp

index cd1661329c0669eedbf0a8c619acf090f3529e1b..6a07f90499452d803a0f6ffd260c1555fae34c95 100755 (executable)
@@ -219,7 +219,8 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
   }
 
   case MachineOperand::MO_Immediate:
-    if (!Modifier || strcmp(Modifier, "debug") != 0)
+    if (!Modifier ||
+        (strcmp(Modifier, "debug") && strcmp(Modifier, "mem")))
       O << '$';
     O << MO.getImmedValue();
     return;
@@ -491,7 +492,7 @@ bool X86ATTAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
     
     switch (ExtraCode[0]) {
     default: return true;  // Unknown modifier.
-    case 'c': // Don't print "$" before a global var name.
+    case 'c': // Don't print "$" before a global var name or constant.
       printOperand(MI, OpNo, "mem");
       return false;
     case 'b': // Print QImode register