]> granicus.if.org Git - clang/commitdiff
Added test cases for dumping variadic-like functions; NFC.
authorAaron Ballman <aaron@aaronballman.com>
Wed, 16 Jan 2019 16:12:30 +0000 (16:12 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 16 Jan 2019 16:12:30 +0000 (16:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351355 91177308-0d34-0410-b5e6-96231b3b80d8

test/AST/ast-dump-decl.c
test/AST/ast-dump-expr.cpp
test/AST/ast-dump-funcs.cpp

index e0a8b56f70a59ed900761ebb26628e47c488443c..b58f9bce2b96dcc97c13d272f6afd44896c2d2f2 100644 (file)
@@ -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
 
index 5d668aad4ae976193daeb750f3fa867e4c86af77..915a14bc563971cd50117008ce22f0cd3b017aa0 100644 (file)
@@ -294,6 +294,24 @@ void PrimaryExpressions(Ts... a) {
   // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:8> col:3 implicit __invoke 'auto ()' static inline
   // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:7, col:8>
 
+  [](int a, ...){};
+  // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:18> '(lambda at {{.*}}:[[@LINE-1]]:3)'
+  // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> 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:16, col:18> col:3 operator() 'auto (int, ...) const' inline
+  // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:6, col:10> col:10 a 'int'
+  // CHECK-NEXT: CompoundStmt
+  // CHECK-NEXT: CXXConversionDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit constexpr operator auto (*)(int, ...) 'auto (*() const)(int, ...)' inline
+  // CHECK-NEXT: CXXMethodDecl 0x{{[^ ]*}} <col:3, col:18> col:3 implicit __invoke 'auto (int, ...)' static inline
+  // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:6, col:10> col:10 a 'int'
+  // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:17, col:18>
+
   [a...]{};
   // CHECK: LambdaExpr 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:10> '(lambda at {{.*}}:[[@LINE-1]]:3)'
   // CHECK-NEXT: CXXRecordDecl 0x{{[^ ]*}} <col:3> col:3 implicit class definition
index 62ae9648dde049a412eec9c4c945170ac4de4bcb..62afcc61fc574f16e3dc6d2410607f478f50ef5e 100644 (file)
@@ -118,6 +118,11 @@ void m(int) {}
 // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:8> col:11 'int'
 // CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:13, col:14>
 
+void n(int, ...) {}
+// CHECK: FunctionDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, col:19> col:6 n 'void (int, ...)'
+// CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:8> col:11 'int'
+// CHECK-NEXT: CompoundStmt 0x{{[^ ]*}} <col:18, col:19>
+
 int main() {
   // CHECK: FunctionDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:1, line:[[@LINE+2]]:1> line:[[@LINE-1]]:5 main 'int ()'
   a1(); // Causes this to be marked 'used'