Skip to content

Commit d6db52d

Browse files
committed
Merge 98701 from mainline.
Fix death tests in -Assert builds. llvm-svn: 99906
1 parent 2db982c commit d6db52d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

llvm/unittests/ADT/APFloatTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ TEST(APFloatTest, makeNaN) {
374374
}
375375

376376
#ifdef GTEST_HAS_DEATH_TEST
377+
#ifndef NDEBUG
377378
TEST(APFloatTest, SemanticsDeath) {
378379
EXPECT_DEATH(APFloat(APFloat::IEEEsingle, 0.0f).convertToDouble(), "Float semantics are not IEEEdouble");
379380
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, 0.0 ).convertToFloat(), "Float semantics are not IEEEsingle");
@@ -573,5 +574,6 @@ TEST(APFloatTest, StringHexadecimalExponentDeath) {
573574
EXPECT_DEATH(APFloat(APFloat::IEEEdouble, "-0x1.1p-"), "Exponent has no digits");
574575
}
575576
#endif
577+
#endif
576578

577579
}

llvm/unittests/ADT/APIntTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ TEST(APIntTest, Log2) {
328328
}
329329

330330
#ifdef GTEST_HAS_DEATH_TEST
331+
#ifndef NDEBUG
331332
TEST(APIntTest, StringDeath) {
332333
EXPECT_DEATH(APInt(0, "", 0), "Bitwidth too small");
333334
EXPECT_DEATH(APInt(32, "", 0), "Invalid string length");
@@ -340,5 +341,6 @@ TEST(APIntTest, StringDeath) {
340341
EXPECT_DEATH(APInt(32, "1L", 10), "Invalid character in digit string");
341342
}
342343
#endif
344+
#endif
343345

344346
}

llvm/unittests/Support/LeakDetectorTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ using namespace llvm;
1515
namespace {
1616

1717
#ifdef GTEST_HAS_DEATH_TEST
18+
#ifndef NDEBUG
1819
TEST(LeakDetector, Death1) {
1920
LeakDetector::addGarbageObject((void*) 1);
2021
LeakDetector::addGarbageObject((void*) 2);
@@ -25,5 +26,6 @@ TEST(LeakDetector, Death1) {
2526
"Cache != o && \"Object already in set!\"");
2627
}
2728
#endif
29+
#endif
2830

2931
}

0 commit comments

Comments
 (0)