[flang-commits] [flang] 5371968 - [fir][NFC] Add two negative tests for needExternalNameMangling

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Tue Oct 12 00:25:30 PDT 2021


Author: Valentin Clement
Date: 2021-10-12T09:25:23+02:00
New Revision: 5371968e4817cc0deda82aa462820b678ff5b05a

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

LOG: [fir][NFC] Add two negative tests for needExternalNameMangling

Add two test for needExternalNameMangling.
- One varibale in a function
- One namelist in a module

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: schweitz

Differential Revision: https://reviews.llvm.org/D111544

Added: 
    

Modified: 
    flang/unittests/Optimizer/InternalNamesTest.cpp

Removed: 
    


################################################################################
diff  --git a/flang/unittests/Optimizer/InternalNamesTest.cpp b/flang/unittests/Optimizer/InternalNamesTest.cpp
index c434874494524..3453c5e4836cc 100644
--- a/flang/unittests/Optimizer/InternalNamesTest.cpp
+++ b/flang/unittests/Optimizer/InternalNamesTest.cpp
@@ -30,10 +30,10 @@ struct DeconstructedName {
   }
 
 private:
-  llvm::SmallVector<std::string, 2> modules;
+  llvm::SmallVector<std::string> modules;
   llvm::Optional<std::string> host;
   std::string name;
-  llvm::SmallVector<std::int64_t, 4> kinds;
+  llvm::SmallVector<std::int64_t> kinds;
 };
 
 void validateDeconstructedName(
@@ -228,6 +228,8 @@ TEST(InternalNamesTest, needExternalNameMangling) {
   ASSERT_FALSE(NameUniquer::needExternalNameMangling(""));
   ASSERT_FALSE(NameUniquer::needExternalNameMangling("_QDTmytypeK2K8K18"));
   ASSERT_FALSE(NameUniquer::needExternalNameMangling("exit_"));
+  ASSERT_FALSE(NameUniquer::needExternalNameMangling("_QFfooEx"));
+  ASSERT_FALSE(NameUniquer::needExternalNameMangling("_QFmstartGmpitop"));
   ASSERT_TRUE(NameUniquer::needExternalNameMangling("_QPfoo"));
   ASSERT_TRUE(NameUniquer::needExternalNameMangling("_QPbar"));
   ASSERT_TRUE(NameUniquer::needExternalNameMangling("_QBa"));


        


More information about the flang-commits mailing list