diff --git a/llvm/test/tools/llvm-readobj/ELF/note-amd.s b/llvm/test/tools/llvm-readobj/ELF/note-amd.s --- a/llvm/test/tools/llvm-readobj/ELF/note-amd.s +++ b/llvm/test/tools/llvm-readobj/ELF/note-amd.s @@ -8,10 +8,11 @@ // GNU-NEXT: Owner Data size Description // GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata) // GNU-NEXT: HSA Metadata: -// GNU-NEXT: {{^ +$}} +// GNU-NEXT: {{^ $}} // GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_ISA (ISA Version) // GNU-NEXT: ISA Version: -// GNU-NEXT: {{^ +$}} +// GNU-NEXT: {{^ $}} +// GNU-EMPTY: // GNU-NEXT: Displaying notes found in: .note.desc // GNU-NEXT: Owner Data size Description // GNU-NEXT: AMD 0x0000000a NT_AMD_AMDGPU_HSA_METADATA (HSA Metadata) @@ -20,9 +21,11 @@ // GNU-NEXT: AMD 0x00000009 NT_AMD_AMDGPU_ISA (ISA Version) // GNU-NEXT: ISA Version: // GNU-NEXT: isa_blah +// GNU-EMPTY: // GNU-NEXT: Displaying notes found in: .note.other // GNU-NEXT: Owner Data size Description // GNU-NEXT: AMD 0x00000000 NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata) +// GNU-EMPTY: // LLVM: Notes [ // LLVM-NEXT: NoteSection { diff --git a/llvm/test/tools/llvm-readobj/ELF/note-amdgpu-invalid.s b/llvm/test/tools/llvm-readobj/ELF/note-amdgpu-invalid.s --- a/llvm/test/tools/llvm-readobj/ELF/note-amdgpu-invalid.s +++ b/llvm/test/tools/llvm-readobj/ELF/note-amdgpu-invalid.s @@ -20,6 +20,7 @@ # GNU-NEXT: .vgpr_count: 7 # GNU-NEXT: .wavefront_size: 5 # GNU-NEXT: ... +# GNU-EMPTY: # LLVM: Notes [ # LLVM-NEXT: NoteSection { diff --git a/llvm/test/tools/llvm-readobj/ELF/note-core-ntfile.test b/llvm/test/tools/llvm-readobj/ELF/note-core-ntfile.test --- a/llvm/test/tools/llvm-readobj/ELF/note-core-ntfile.test +++ b/llvm/test/tools/llvm-readobj/ELF/note-core-ntfile.test @@ -60,7 +60,7 @@ # GNU-NEXT: /path/to/libc.so # GNU-NEXT: 0x0000000000007000 0x0000000000008000 0x0000000000009000 # GNU-NEXT: [stack] -# GNU-NOT: {{.}} +# GNU-EMPTY: # LLVM: Notes [ # LLVM-NEXT: NoteSection { diff --git a/llvm/test/tools/llvm-readobj/ELF/note-core.test b/llvm/test/tools/llvm-readobj/ELF/note-core.test --- a/llvm/test/tools/llvm-readobj/ELF/note-core.test +++ b/llvm/test/tools/llvm-readobj/ELF/note-core.test @@ -252,6 +252,7 @@ # CHECK-GNU: Owner Data size Description # CHECK-GNU-NEXT: CORE 0x00000000 [[DESC]] +# CHECK-GNU-EMPTY: # CHECK-LLVM: Note { # CHECK-LLVM-NEXT: Owner: CORE diff --git a/llvm/test/tools/llvm-readobj/ELF/note-freebsd.s b/llvm/test/tools/llvm-readobj/ELF/note-freebsd.s --- a/llvm/test/tools/llvm-readobj/ELF/note-freebsd.s +++ b/llvm/test/tools/llvm-readobj/ELF/note-freebsd.s @@ -8,13 +8,16 @@ // GNU-NEXT: Owner Data size Description // GNU-NEXT: FreeBSD 0x00000000 NT_THRMISC (thrmisc structure) // GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_PROC (proc data) +// GNU-EMPTY: // GNU-NEXT: Displaying notes found in: .note.bar // GNU-NEXT: Owner Data size Description // GNU-NEXT: FreeBSD 0x00000000 NT_PROCSTAT_FILES (files data) +// GNU-EMPTY: // GNU-NEXT: Displaying notes found in: .note.baz // GNU-NEXT: Owner Data size Description // GNU-NEXT: FreeBSD 0x0000001c Unknown note type: (0x00000003) // GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00 +// GNU-EMPTY: // LLVM: Notes [ // LLVM-NEXT: NoteSection { diff --git a/llvm/test/tools/llvm-readobj/ELF/note-unknown.s b/llvm/test/tools/llvm-readobj/ELF/note-unknown.s --- a/llvm/test/tools/llvm-readobj/ELF/note-unknown.s +++ b/llvm/test/tools/llvm-readobj/ELF/note-unknown.s @@ -7,10 +7,12 @@ // GNU: Displaying notes found in: .note.foo // GNU-NEXT: Owner Data size Description // GNU-NEXT: XYZ 0x00000000 Unknown note type: (0x00000003) +// GNU-EMPTY: // GNU-NEXT: Displaying notes found in: .note.bar // GNU-NEXT: Owner Data size Description // GNU-NEXT: XYZ 0x0000001c Unknown note type: (0x00000003) // GNU-NEXT: description data: 4c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 6f 72 20 73 69 74 20 61 6d 65 74 00 00 +// GNU-EMPTY: // LLVM: Notes [ // LLVM-NEXT: NoteSection { diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -5293,7 +5293,7 @@ return Error::success(); }; - printNotesHelper(*this, PrintHeader, ProcessNote, []() {}); + printNotesHelper(*this, PrintHeader, ProcessNote, [this]() { OS << '\n'; }); } template void GNUELFDumper::printELFLinkerOptions() {