Work around a gas bug. Print '-9223372036854775808' as unsigned.
[oota-llvm.git] / lib / Target / X86 / Printer.cpp
index be1f34d3bbe79b60fd31b69a1e295fab899c0d6a..d71715aa61693a6785a42fe8b0a99650f3350f82 100644 (file)
@@ -144,7 +144,10 @@ void Printer::emitConstantValueOnly(const Constant *CV) {
     assert(CB == ConstantBool::True);
     O << "1";
   } else if (const ConstantSInt *CI = dyn_cast<ConstantSInt>(CV))
-    O << CI->getValue();
+    if (((CI->getValue() << 32) >> 32) == CI->getValue())
+      O << CI->getValue();
+    else
+      O << (unsigned long long)CI->getValue();
   else if (const ConstantUInt *CI = dyn_cast<ConstantUInt>(CV))
     O << CI->getValue();
   else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(CV))