aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/MI
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-06-06 19:00:54 +0000
committerMatthias Braun <matze@braunis.de>2017-06-06 19:00:54 +0000
commit49220fb6a132a17278337f770c0de91d37d889d4 (patch)
treef622942560ee15c2091469d74d97e15be8895541 /llvm/unittests/MI
parentdd7c68bc7867adabc34bfe07c1a85c4cb955e088 (diff)
downloadllvm-49220fb6a132a17278337f770c0de91d37d889d4.zip
llvm-49220fb6a132a17278337f770c0de91d37d889d4.tar.gz
llvm-49220fb6a132a17278337f770c0de91d37d889d4.tar.bz2
UnitTests: Do not use assert() for error checking
Use `if (!X) report_fatal_error()` instead of `assert()` for the ad-hoc error handling in two unittests. This reduces unnecessary differences between release and debug builds (motivated by unused variable warnings triggered in release builds). llvm-svn: 304814
Diffstat (limited to 'llvm/unittests/MI')
-rw-r--r--llvm/unittests/MI/LiveIntervalTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp
index 0b9510e..7118a43 100644
--- a/llvm/unittests/MI/LiveIntervalTest.cpp
+++ b/llvm/unittests/MI/LiveIntervalTest.cpp
@@ -151,7 +151,8 @@ body: |
std::unique_ptr<MIRParser> MIR;
std::unique_ptr<Module> M = parseMIR(Context, PM, MIR, *TM, MIRString,
"func");
- assert(M && "MIR parsing successfull");
+ if (!M)
+ report_fatal_error("Could not parse MIR code\n");
PM.add(new TestPass(T));