[Lldb-commits] [lldb] r344809 - [PDB] Test variadic function type in PDB

Aaron Smith via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 19 12:30:59 PDT 2018


Author: asmith
Date: Fri Oct 19 12:30:59 2018
New Revision: 344809

URL: http://llvm.org/viewvc/llvm-project?rev=344809&view=rev
Log:
[PDB] Test variadic function type in PDB

This adds back the test case reverted in commit: d260a269200824c5c1c8c6de531fd5aa63db9c35

Modified:
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb
    lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Modified: lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp?rev=344809&r1=344808&r2=344809&view=diff
==============================================================================
--- lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp Fri Oct 19 12:30:59 2018
@@ -34,7 +34,7 @@ class NSClass {
   float f;
   double d;
 };
-}
+} // namespace NS
 
 class Class {
 public:
@@ -48,6 +48,10 @@ int test_func(int a, int b) { return a +
 
 typedef Class ClassTypedef;
 typedef NS::NSClass NSClassTypedef;
+typedef int (*FuncPointerTypedef)();
+typedef int (*VariadicFuncPointerTypedef)(char, ...);
+FuncPointerTypedef GlobalFunc;
+VariadicFuncPointerTypedef GlobalVariadicFunc;
 int GlobalArray[10];
 
 static const int sizeof_NSClass = sizeof(NS::NSClass);
@@ -57,6 +61,9 @@ static const int sizeof_Enum = sizeof(En
 static const int sizeof_ShortEnum = sizeof(ShortEnum);
 static const int sizeof_ClassTypedef = sizeof(ClassTypedef);
 static const int sizeof_NSClassTypedef = sizeof(NSClassTypedef);
+static const int sizeof_FuncPointerTypedef = sizeof(FuncPointerTypedef);
+static const int sizeof_VariadicFuncPointerTypedef =
+    sizeof(VariadicFuncPointerTypedef);
 static const int sizeof_GlobalArray = sizeof(GlobalArray);
 
 int main(int argc, char **argv) {

Modified: lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe?rev=344809&r1=344808&r2=344809&view=diff
==============================================================================
Binary files lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe (original) and lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.exe Fri Oct 19 12:30:59 2018 differ

Modified: lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb?rev=344809&r1=344808&r2=344809&view=diff
==============================================================================
Binary files lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb (original) and lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.pdb Fri Oct 19 12:30:59 2018 differ

Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=344809&r1=344808&r2=344809&view=diff
==============================================================================
--- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original)
+++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Fri Oct 19 12:30:59 2018
@@ -200,8 +200,7 @@ TEST_F(SymbolFilePDBTests, TestResolveSy
   EXPECT_TRUE(ContainsCompileUnit(sc_list, header_spec));
 }
 
-TEST_F(SymbolFilePDBTests,
-       TestLookupOfHeaderFileWithInlines) {
+TEST_F(SymbolFilePDBTests, TestLookupOfHeaderFileWithInlines) {
   // Test that when looking up a header file via ResolveSymbolContext (i.e. a
   // file that was not by itself
   // compiled, but only contributes to the combined code of other source files),
@@ -531,7 +530,9 @@ TEST_F(SymbolFilePDBTests, TestTypedefs)
   llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
 
-  const char *TypedefsToCheck[] = {"ClassTypedef", "NSClassTypedef"};
+  const char *TypedefsToCheck[] = {"ClassTypedef", "NSClassTypedef",
+                                   "FuncPointerTypedef",
+                                   "VariadicFuncPointerTypedef"};
   for (auto Typedef : TypedefsToCheck) {
     TypeMap results;
     EXPECT_EQ(1u, symfile->FindTypes(sc, ConstString(Typedef), nullptr, false,
@@ -561,7 +562,7 @@ TEST_F(SymbolFilePDBTests, TestRegexName
   SymbolFilePDB *symfile =
       static_cast<SymbolFilePDB *>(plugin->GetSymbolFile());
   TypeMap results;
-   
+
   symfile->FindTypesByRegex(RegularExpression(".*"), 0, results);
   EXPECT_GT(results.GetSize(), 1u);
 
@@ -583,8 +584,8 @@ TEST_F(SymbolFilePDBTests, TestMaxMatche
   llvm::DenseSet<SymbolFile *> searched_files;
   TypeMap results;
   const ConstString name("ClassTypedef");
-  uint32_t num_results = symfile->FindTypes(sc, name, nullptr,
-                                            false, 0, searched_files, results);
+  uint32_t num_results =
+      symfile->FindTypes(sc, name, nullptr, false, 0, searched_files, results);
   // Try to limit ourselves from 1 to 10 results, otherwise we could be doing
   // this thousands of times.
   // The idea is just to make sure that for a variety of values, the number of




More information about the lldb-commits mailing list