From: Aaron Ballman Date: Wed, 16 Jan 2019 16:12:30 +0000 (+0000) Subject: Added test cases for dumping variadic-like functions; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d29cf5253337e8f4ca87a0bdffacc056f17175cc;p=clang Added test cases for dumping variadic-like functions; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351355 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/AST/ast-dump-decl.c b/test/AST/ast-dump-decl.c index e0a8b56f70..b58f9bce2b 100644 --- a/test/AST/ast-dump-decl.c +++ b/test/AST/ast-dump-decl.c @@ -128,6 +128,9 @@ int TestFunctionDeclProto(int x); // CHECK: FunctionDecl{{.*}} TestFunctionDeclProto 'int (int)' // CHECK-NEXT: ParmVarDecl{{.*}} x +void TestFunctionDeclNoProto(); +// CHECK: FunctionDecl{{.*}} TestFunctionDeclNoProto 'void ()' + extern int TestFunctionDeclSC(); // CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int ()' extern diff --git a/test/AST/ast-dump-expr.cpp b/test/AST/ast-dump-expr.cpp index 5d668aad4a..915a14bc56 100644 --- a/test/AST/ast-dump-expr.cpp +++ b/test/AST/ast-dump-expr.cpp @@ -294,6 +294,24 @@ void PrimaryExpressions(Ts... a) { // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} col:3 implicit __invoke 'auto ()' static inline // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} + [](int a, ...){}; + // CHECK: LambdaExpr 0x{{[^ ]*}} '(lambda at {{.*}}:[[@LINE-1]]:3)' + // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} col:3 implicit class definition + // CHECK-NEXT: DefinitionData lambda + // CHECK-NEXT: DefaultConstructor + // CHECK-NEXT: CopyConstructor + // CHECK-NEXT: MoveConstructor + // CHECK-NEXT: CopyAssignment + // CHECK-NEXT: MoveAssignment + // CHECK-NEXT: Destructor + // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} col:3 operator() 'auto (int, ...) const' inline + // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:10 a 'int' + // CHECK-NEXT: CompoundStmt + // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} col:3 implicit constexpr operator auto (*)(int, ...) 'auto (*() const)(int, ...)' inline + // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} col:3 implicit __invoke 'auto (int, ...)' static inline + // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:10 a 'int' + // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} + [a...]{}; // CHECK: LambdaExpr 0x{{[^ ]*}} '(lambda at {{.*}}:[[@LINE-1]]:3)' // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} col:3 implicit class definition diff --git a/test/AST/ast-dump-funcs.cpp b/test/AST/ast-dump-funcs.cpp index 62ae9648dd..62afcc61fc 100644 --- a/test/AST/ast-dump-funcs.cpp +++ b/test/AST/ast-dump-funcs.cpp @@ -118,6 +118,11 @@ void m(int) {} // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:11 'int' // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} +void n(int, ...) {} +// CHECK: FunctionDecl 0x{{[^ ]*}} col:6 n 'void (int, ...)' +// CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} col:11 'int' +// CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} + int main() { // CHECK: FunctionDecl 0x{{[^ ]*}} line:[[@LINE-1]]:5 main 'int ()' a1(); // Causes this to be marked 'used'