[PATCH] D123920: [OpenMP][IRBuilder] Handle unexcuted EXPECT_FALSE

Shraiysh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 24 20:38:40 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa5c52ff0d472: [OpenMP][IRBuilder] Handle unexcuted EXPECT_FALSE (authored by shraiysh).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123920/new/

https://reviews.llvm.org/D123920

Files:
  llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp


Index: llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
===================================================================
--- llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -1209,8 +1209,8 @@
 
   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 @@
   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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123920.424812.patch
Type: text/x-patch
Size: 1220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220425/872d4678/attachment.bin>


More information about the llvm-commits mailing list