Skip to content

Commit 4e08921

Browse files
committed
Enclose debug prints of tests in LLVM_DEBUG
1 parent 06d5265 commit 4e08921

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/unittests/AsmParser/AsmParserTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "llvm/Support/SourceMgr.h"
2323
#include "gtest/gtest.h"
2424

25+
#define DEBUG_TYPE "Unittest-asm-parser-tests"
26+
2527
using namespace llvm;
2628

2729
namespace {
@@ -486,14 +488,14 @@ TEST(AsmParserTest, DIExpressionBodyAtBeginningWithSlotMappingParsing) {
486488
#define ASSERT_EQ_LOC(Loc1, Loc2) \
487489
do { \
488490
bool AreLocsEqual = Loc1.contains(Loc2) && Loc2.contains(Loc1); \
489-
if (!AreLocsEqual) { \
491+
LLVM_DEBUG(if (!AreLocsEqual) { \
490492
dbgs() << #Loc1 " location: " << Loc1.Start.Line << ":" \
491493
<< Loc1.Start.Col << " - " << Loc1.End.Line << ":" \
492494
<< Loc1.End.Col << "\n"; \
493495
dbgs() << #Loc2 " location: " << Loc2.Start.Line << ":" \
494496
<< Loc2.Start.Col << " - " << Loc2.End.Line << ":" \
495497
<< Loc2.End.Col << "\n"; \
496-
} \
498+
}); \
497499
ASSERT_TRUE(AreLocsEqual); \
498500
} while (false)
499501

0 commit comments

Comments
 (0)