mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-22 12:08:26 +00:00
f5898c18e7
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281560 91177308-0d34-0410-b5e6-96231b3b80d8
50 lines
2.7 KiB
C++
50 lines
2.7 KiB
C++
//===- ErrorChecking.h - Helpers for verifying llvm::Errors -----*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_UNITTESTS_DEBUGINFO_PDB_ERRORCHECKING_H
|
|
#define LLVM_UNITTESTS_DEBUGINFO_PDB_ERRORCHECKING_H
|
|
|
|
#define EXPECT_NO_ERROR(Err) \
|
|
{ \
|
|
auto E = Err; \
|
|
EXPECT_FALSE(static_cast<bool>(E)); \
|
|
if (E) \
|
|
consumeError(std::move(E)); \
|
|
}
|
|
|
|
#define EXPECT_ERROR(Err) \
|
|
{ \
|
|
auto E = Err; \
|
|
EXPECT_TRUE(static_cast<bool>(E)); \
|
|
if (E) \
|
|
consumeError(std::move(E)); \
|
|
}
|
|
|
|
#define EXPECT_EXPECTED(Exp) \
|
|
{ \
|
|
auto E = Exp.takeError(); \
|
|
EXPECT_FALSE(static_cast<bool>(E)); \
|
|
if (E) { \
|
|
consumeError(std::move(E)); \
|
|
return; \
|
|
} \
|
|
}
|
|
|
|
#define EXPECT_UNEXPECTED(Exp) \
|
|
{ \
|
|
auto E = Exp.takeError(); \
|
|
EXPECT_TRUE(static_cast<bool>(E)); \
|
|
if (E) { \
|
|
consumeError(std::move(E)); \
|
|
return; \
|
|
} \
|
|
}
|
|
|
|
#endif
|