[llvm] 2461aee - [OpenMPIRBuilderTest] Avoid pointer element type access

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 26 02:02:50 PST 2022


Author: Nikita Popov
Date: 2022-01-26T11:02:43+01:00
New Revision: 2461aee6dbc5b2bb9027e1e86b940a2d0220cd54

URL: https://github.com/llvm/llvm-project/commit/2461aee6dbc5b2bb9027e1e86b940a2d0220cd54
DIFF: https://github.com/llvm/llvm-project/commit/2461aee6dbc5b2bb9027e1e86b940a2d0220cd54.diff

LOG: [OpenMPIRBuilderTest] Avoid pointer element type access

This was reintroduced by D110114.

Added: 
    

Modified: 
    llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
index 00aa25e8330d5..143b053c9e61d 100644
--- a/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+++ b/llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
@@ -1158,7 +1158,8 @@ TEST_F(OpenMPIRBuilderTest, ParallelForwardAsPointers) {
 
   Type *Arg2Type = OutlinedFn->getArg(2)->getType();
   EXPECT_TRUE(Arg2Type->isPointerTy());
-  EXPECT_EQ(Arg2Type->getPointerElementType(), ArgStructTy);
+  EXPECT_TRUE(cast<PointerType>(Arg2Type)
+                  ->isOpaqueOrPointeeTypeMatches(ArgStructTy));
 }
 
 TEST_F(OpenMPIRBuilderTest, CanonicalLoopSimple) {


        


More information about the llvm-commits mailing list