Index: lld/COFF/SymbolTable.cpp =================================================================== --- lld/COFF/SymbolTable.cpp +++ lld/COFF/SymbolTable.cpp @@ -109,7 +109,7 @@ } if (Locations.empty()) - return "\n>>> referenced by " + toString(File) + "\n"; + return "\n>>> referenced by " + toString(File); std::string Out; llvm::raw_string_ostream OS(Out); @@ -122,7 +122,6 @@ if (!Loc.SymName.empty()) OS << ":(" << Loc.SymName << ')'; } - OS << '\n'; return OS.str(); } Index: lld/test/COFF/undefined-symbol-cv.s =================================================================== --- lld/test/COFF/undefined-symbol-cv.s +++ lld/test/COFF/undefined-symbol-cv.s @@ -7,14 +7,14 @@ # CHECK-NEXT: >>> {{.*}}.obj:(main) # CHECK-NEXT: >>> referenced by file1.cpp:2 # CHECK-NEXT: >>> {{.*}}.obj:(main) - -# CHECK: error: undefined symbol: ?bar@@YAHXZ +# CHECK-EMPTY: +# CHECK-NEXT: error: undefined symbol: ?bar@@YAHXZ # CHECK-NEXT: >>> referenced by file2.cpp:3 # CHECK-NEXT: >>> {{.*}}.obj:(main) # CHECK-NEXT: >>> referenced by file1.cpp:4 # CHECK-NEXT: >>> {{.*}}.obj:(f1) - -# CHECK: error: undefined symbol: ?baz@@YAHXZ +# CHECK-EMPTY: +# CHECK-NEXT: error: undefined symbol: ?baz@@YAHXZ # CHECK-NEXT: >>> referenced by file1.cpp:5 # CHECK-NEXT: >>> {{.*}}.obj:(f2) Index: lld/test/COFF/undefined-symbol.s =================================================================== --- lld/test/COFF/undefined-symbol.s +++ lld/test/COFF/undefined-symbol.s @@ -5,12 +5,12 @@ # CHECK: error: undefined symbol: ?foo@@YAHXZ # CHECK-NEXT: >>> referenced by {{.*}}.obj:(main) # CHECK-NEXT: >>> referenced by {{.*}}.obj:(main) - -# CHECK: error: undefined symbol: ?bar@@YAHXZ +# CHECK-EMPTY: +# CHECK-NEXT: error: undefined symbol: ?bar@@YAHXZ # CHECK-NEXT: >>> referenced by {{.*}}.obj:(main) # CHECK-NEXT: >>> referenced by {{.*}}.obj:(f1) - -# CHECK: error: undefined symbol: ?baz@@YAHXZ +# CHECK-EMPTY: +# CHECK-NEXT: error: undefined symbol: ?baz@@YAHXZ # CHECK-NEXT: >>> referenced by {{.*}}.obj:(f2) .section .text,"xr",one_only,main