[llvm] ad58d1a - [CodeMoverUtils] Don't dereference nullptr in test

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 16:22:16 PST 2019


Author: Vitaly Buka
Date: 2019-11-26T16:22:06-08:00
New Revision: ad58d1a9d117d46916bfff77aad0c369cee91cea

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

LOG: [CodeMoverUtils] Don't dereference nullptr in test

Added: 
    

Modified: 
    llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp b/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp
index 64c4f796cb81..0bb32a4d9dda 100644
--- a/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp
+++ b/llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp
@@ -142,7 +142,7 @@ TEST(CodeMoverUtils, BasicTest) {
         EXPECT_FALSE(isSafeToMoveBefore(*SI_A5, *Entry->getTerminator(), DT, PDT, DI));
 
         // Moving PHINode is not supported.
-        EXPECT_FALSE(isSafeToMoveBefore(PN, *PN.getPrevNode(), DT, PDT, DI));
+        EXPECT_FALSE(isSafeToMoveBefore(PN, *PN.getNextNode()->getNextNode(), DT, PDT, DI));
 
         // Cannot move non-PHINode before PHINode.
         EXPECT_FALSE(isSafeToMoveBefore(*PN.getNextNode(), PN, DT, PDT, DI));


        


More information about the llvm-commits mailing list