llvm-mc: Fix bugs where bytes were unintentionally being printed as signed.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 14 Aug 2009 19:59:24 +0000 (19:59 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 14 Aug 2009 19:59:24 +0000 (19:59 +0000)
 - We now print all of 403.gcc cleanly (llvm-mc -> 'as' as diffed to 'as'), minus two
   'rep;movsl' instructions (which I missed before).

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

lib/MC/MCAsmStreamer.cpp
test/MC/AsmParser/directive_ascii.s

index 41f88334e2b76440e4c4e3690f63a194a4780268..273b17d3c2cd7e5138c6fd19d031c2aa82bf66c3 100644 (file)
@@ -210,7 +210,7 @@ void MCAsmStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
 void MCAsmStreamer::EmitBytes(const StringRef &Data) {
   assert(CurSection && "Cannot emit contents before setting section!");
   for (unsigned i = 0, e = Data.size(); i != e; ++i)
-    OS << ".byte " << (unsigned) Data[i] << '\n';
+    OS << ".byte " << (unsigned) (unsigned char) Data[i] << '\n';
 }
 
 void MCAsmStreamer::EmitValue(const MCValue &Value, unsigned Size) {
index 68328f51c8b1e79f86385781ea7a219b95014093..cc6d23b751d31e8970eb7b5f74ac3ecb95392471 100644 (file)
@@ -31,9 +31,10 @@ TEST3:
 # CHECK: .byte 1
 # CHECK: .byte 0
 # CHECK: .byte 49
+# CHECK: .byte 128
 # CHECK: .byte 0
 TEST4:  
-        .ascii "\1\01\07\08\001\0001\b\0"
+        .ascii "\1\01\07\08\001\0001\200\0"
         
 # CHECK: TEST5:
 # CHECK: .byte 8