From e44313e0ca7ca3504dd9dc906e2eff8b36bc4ee4 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 14 Aug 2009 19:59:24 +0000 Subject: [PATCH] llvm-mc: Fix bugs where bytes were unintentionally being printed as signed. - 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 | 2 +- test/MC/AsmParser/directive_ascii.s | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 41f88334e2b..273b17d3c2c 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -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) { diff --git a/test/MC/AsmParser/directive_ascii.s b/test/MC/AsmParser/directive_ascii.s index 68328f51c8b..cc6d23b751d 100644 --- a/test/MC/AsmParser/directive_ascii.s +++ b/test/MC/AsmParser/directive_ascii.s @@ -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 -- 2.34.1