Index: test/tools/llvm-objdump/X86/bytes.test =================================================================== --- /dev/null +++ test/tools/llvm-objdump/X86/bytes.test @@ -0,0 +1,18 @@ +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o -| \ +# RUN: llvm-objdump -d - | FileCheck %s + +.globl foo +.type foo, @object + +foo: +.byte 't','h','i', 's',' ','i','s',' ' +.byte 'a',' ','t','e','s','t' +# .byte 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20 +# .byte 0x61, 0x20, 0x74, 0x65, 0x73, 0x74 + +.size foo, . - foo + +# CHECK: foo: +# CHECK: 0: 74 68 69 73 20 69 73 20 this is +# CHECK: 8: 61 20 74 65 73 74 a test + Index: tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- tools/llvm-objdump/llvm-objdump.cpp +++ tools/llvm-objdump/llvm-objdump.cpp @@ -1265,7 +1265,7 @@ // Indent the space for less than 8 bytes data. // 2 spaces for byte and one for space between bytes IndentOffset = 3 * (8 - NumBytes); - for (int Excess = 8 - NumBytes; Excess < 8; Excess++) + for (int Excess = NumBytes; Excess < 8; Excess++) AsciiData[Excess] = '\0'; NumBytes = 8; }