From 3c686e3561fe4b6232c0d411a1f183ae099a6b53 Mon Sep 17 00:00:00 2001 From: Nick Kledzik Date: Thu, 7 Nov 2013 01:27:47 +0000 Subject: [PATCH] add debug logging to help figure out why some tests fail on some build bots llvm-svn: 194186 --- .../MachONormalizedFileBinaryWriterTests.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lld/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp b/lld/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp index 67b81dde0dd8..64da315584e5 100644 --- a/lld/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp +++ b/lld/unittests/MachOTests/MachONormalizedFileBinaryWriterTests.cpp @@ -275,6 +275,12 @@ TEST(BinaryWriterTest, obj_relocs_x86) { EXPECT_EQ(N_UNDF, barUndef.type); EXPECT_EQ(SymbolScope(N_EXT), barUndef.scope); const Symbol& tbarUndef = f2->undefinedSymbols[1]; + // BEGIN debug + if (!tbarUndef.name.equals("_tbar")) { + llvm::errs() << "obj_relocs_x86 _tbar is actually '" + << tbarUndef.name << "'\n"; + } + // END debug EXPECT_TRUE(tbarUndef.name.equals("_tbar")); EXPECT_EQ(N_UNDF, tbarUndef.type); EXPECT_EQ(SymbolScope(N_EXT), tbarUndef.scope); @@ -282,7 +288,19 @@ TEST(BinaryWriterTest, obj_relocs_x86) { EXPECT_EQ(1UL, f2->sections.size()); const Section& text = f2->sections[0]; EXPECT_TRUE(text.segmentName.equals("__TEXT")); + // BEGIN debug + if (!text.segmentName.equals("__TEXT")) { + llvm::errs() << "obj_relocs_x86 __TEXT is actually '" + << text.segmentName << "'\n"; + } + // END debug EXPECT_TRUE(text.sectionName.equals("__text")); + // BEGIN debug + if (!text.sectionName.equals("__text")) { + llvm::errs() << "obj_relocs_x86 __text is actually '" + << text.sectionName << "'\n"; + } + // END debug EXPECT_EQ(S_REGULAR, text.type); EXPECT_EQ(text.attributes,SectionAttr(S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS));