2012-08-13 18:50:08 +08:00
|
|
|
// RUN: clang-check -ast-dump "%s" -- 2>&1 | FileCheck %s
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK: (NamespaceDecl{{.*}}test_namespace
|
|
|
|
// CHECK-NEXT: (CXXRecordDecl{{.*}}TheClass
|
|
|
|
// CHECK: (CXXMethodDecl{{.*}}theMethod
|
|
|
|
// CHECK-NEXT: (ParmVarDecl{{.*}}x
|
|
|
|
// CHECK-NEXT: (CompoundStmt
|
2012-08-13 18:50:08 +08:00
|
|
|
// CHECK-NEXT: (ReturnStmt
|
|
|
|
// CHECK-NEXT: (BinaryOperator
|
|
|
|
//
|
|
|
|
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::theMethod "%s" -- 2>&1 | FileCheck -check-prefix CHECK-FILTER %s
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK-FILTER-NOT: NamespaceDecl
|
|
|
|
// CHECK-FILTER-NOT: CXXRecordDecl
|
2012-11-21 18:54:55 +08:00
|
|
|
// CHECK-FILTER: {{^}}Dumping test_namespace::TheClass::theMethod
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK-FILTER-NEXT: {{^}}(CXXMethodDecl{{.*}}theMethod
|
|
|
|
// CHECK-FILTER-NEXT: (ParmVarDecl{{.*}}x
|
|
|
|
// CHECK-FILTER-NEXT: (CompoundStmt
|
2012-08-13 18:50:08 +08:00
|
|
|
// CHECK-FILTER-NEXT: (ReturnStmt
|
|
|
|
// CHECK-FILTER-NEXT: (BinaryOperator
|
|
|
|
//
|
|
|
|
// RUN: clang-check -ast-print "%s" -- 2>&1 | FileCheck -check-prefix CHECK-PRINT %s
|
|
|
|
// CHECK-PRINT: namespace test_namespace
|
|
|
|
// CHECK-PRINT: class TheClass
|
|
|
|
// CHECK-PRINT: int theMethod(int x)
|
|
|
|
//
|
|
|
|
// RUN: clang-check -ast-list "%s" -- 2>&1 | FileCheck -check-prefix CHECK-LIST %s
|
|
|
|
// CHECK-LIST: test_namespace
|
|
|
|
// CHECK-LIST-NEXT: test_namespace::TheClass
|
|
|
|
// CHECK-LIST-NEXT: test_namespace::TheClass::theMethod
|
|
|
|
// CHECK-LIST-NEXT: x
|
2012-08-16 10:43:29 +08:00
|
|
|
//
|
|
|
|
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s
|
|
|
|
// CHECK-ATTR: test_namespace
|
2012-12-20 10:09:13 +08:00
|
|
|
// CHECK-ATTR-NEXT: (FieldDecl{{.*}}n
|
|
|
|
// FIXME: attribute dumping not implemented yet
|
2012-11-01 02:46:31 +08:00
|
|
|
//
|
|
|
|
// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::AfterNullNode "%s" -- 2>&1 | FileCheck -check-prefix CHECK-AFTER-NULL %s
|
|
|
|
// CHECK-AFTER-NULL: class AfterNullNode
|
2012-08-13 18:50:08 +08:00
|
|
|
|
|
|
|
namespace test_namespace {
|
|
|
|
|
|
|
|
class TheClass {
|
|
|
|
public:
|
|
|
|
int theMethod(int x) {
|
|
|
|
return x + x;
|
|
|
|
}
|
2012-08-16 10:43:29 +08:00
|
|
|
int n __attribute__((aligned(1+1)));
|
2012-08-13 18:50:08 +08:00
|
|
|
};
|
|
|
|
|
2012-08-18 01:38:39 +08:00
|
|
|
// Used to fail with -ast-dump-filter X
|
|
|
|
template<template<typename T> class C> class Z {};
|
|
|
|
|
2012-11-01 02:46:31 +08:00
|
|
|
// Check that traversal continues after the previous construct.
|
|
|
|
class AfterNullNode {};
|
|
|
|
|
2012-08-13 18:50:08 +08:00
|
|
|
}
|