[llvm] a5c52ff - [OpenMP][IRBuilder] Handle unexcuted EXPECT_FALSE
Shraiysh Vaishay via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 24 20:38:39 PDT 2022
Author: Shraiysh Vaishay
Date: 2022-04-25T09:08:29+05:30
New Revision: a5c52ff0d47216f4eee53bb95652a799299d7770
URL: https://github.com/llvm/llvm-project/commit/a5c52ff0d47216f4eee53bb95652a799299d7770
DIFF: https://github.com/llvm/llvm-project/commit/a5c52ff0d47216f4eee53bb95652a799299d7770.diff
LOG: [OpenMP][IRBuilder] Handle unexcuted EXPECT_FALSE
This patch addresses the comment about unexecuted test in D122371.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D123920
Added:
Modified:
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index 66ee7238b740a..ca848e986b3ca 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -1209,8 +1209,8 @@ TEST_F(OpenMPIRBuilderTest, ParallelForwardAsPointers) {
Type *Arg2Type = OutlinedFn->getArg(2)->getType();
EXPECT_TRUE(Arg2Type->isPointerTy());
- EXPECT_TRUE(cast<PointerType>(Arg2Type)
- ->isOpaqueOrPointeeTypeMatches(ArgStructTy));
+ EXPECT_TRUE(
+ cast<PointerType>(Arg2Type)->isOpaqueOrPointeeTypeMatches(ArgStructTy));
}
TEST_F(OpenMPIRBuilderTest, CanonicalLoopSimple) {
@@ -3064,12 +3064,17 @@ TEST_F(OpenMPIRBuilderTest, SingleDirectiveNowait) {
EXPECT_TRUE(isa<GlobalVariable>(SingleEndCI->getArgOperand(0)));
EXPECT_EQ(SingleEndCI->getArgOperand(1), SingleEntryCI->getArgOperand(1));
+ CallInst *ExitBarrier = nullptr;
for (auto &FI : *ExitBB) {
Instruction *cur = &FI;
if (auto CI = dyn_cast<CallInst>(cur)) {
- EXPECT_FALSE(CI->getCalledFunction()->getName() == "__kmpc_barrier");
+ if (CI->getCalledFunction()->getName() == "__kmpc_barrier") {
+ ExitBarrier = CI;
+ break;
+ }
}
}
+ EXPECT_EQ(ExitBarrier, nullptr);
}
TEST_F(OpenMPIRBuilderTest, OMPAtomicReadFlt) {
More information about the llvm-commits
mailing list