Files
clang-p2996/llvm/test/tools/llvm-pdbdump/Inputs/PrettyFuncDumperTest.cpp
Aaron Smith 53a1a1616c Fix pretty printing the unspecified param of a variadic function
Summary:
 - Fix a bug in PrettyBuiltinDumper that returns "void" as the name for
  an unspecified builtin type. Since the unspecified param of a variadic
  function is considered a builtin of unspecified type in PDBs, we set
  "..." for its name.

  - Provide a method to determine if a PDBSymbolFunc is variadic in
  PrettyFunctionDumper since PDBSymbolFunc::getArgument() doesn't return the
  last unspecified-type param.

  - Add a pretty-func-dumper.test to test pretty dumping of variadic
  functions.

Reviewers: zturner, llvm-commits

Reviewed By: zturner

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

llvm-svn: 322608
2018-01-17 01:22:03 +00:00

50 lines
914 B
C++

// Compile for x86 (FPO disabled)
// Compile with "cl /c /Zi /GR- PrettyFuncDumperTest.cpp"
// Link with "link PrettyFuncDumperTest.obj /debug /nodefaultlib /entry:main"
typedef void (*FuncPtrA)();
FuncPtrA FuncVarA;
typedef float (*FuncPtrB)(void);
FuncPtrB FuncVarB;
typedef int(*VariadicFuncPtrTypedef)(char, double, ...);
VariadicFuncPtrTypedef VariadicFuncVar;
void Func(int array[]) { return; }
template <int N=1, class ...T>
void TemplateFunc(T ...Arg) {
return;
}
namespace {
void Func(int& a, const double b, volatile bool c) { return; }
}
namespace NS {
void Func(char a, int b, ...) {
return;
}
}
namespace MemberFuncsTest {
class A {
public:
int FuncA() { return 1; }
void FuncB(int a, ...) {}
};
}
int main() {
MemberFuncsTest::A v1;
v1.FuncA();
v1.FuncB(9, 10, 20);
NS::Func('c', 2, 10, 100);
TemplateFunc(10);
TemplateFunc(10, 11, 88);
return 0;
}