blob: 86533af3e11db55055b5f51bf94abb235859a6fd [file] [log] [blame]
Alexander Kornienko48464702012-08-13 10:50:08 +00001// RUN: clang-check -ast-dump "%s" -- 2>&1 | FileCheck %s
2// CHECK: namespace test_namespace
3// CHECK-NEXT: class TheClass
4// CHECK: int theMethod(int x) (CompoundStmt
5// CHECK-NEXT: (ReturnStmt
6// CHECK-NEXT: (BinaryOperator
7//
8// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::theMethod "%s" -- 2>&1 | FileCheck -check-prefix CHECK-FILTER %s
9// CHECK-FILTER-NOT: namespace test_namespace
10// CHECK-FILTER-NOT: class TheClass
11// CHECK-FILTER: int theMethod(int x) (CompoundStmt
12// CHECK-FILTER-NEXT: (ReturnStmt
13// CHECK-FILTER-NEXT: (BinaryOperator
14//
15// RUN: clang-check -ast-print "%s" -- 2>&1 | FileCheck -check-prefix CHECK-PRINT %s
16// CHECK-PRINT: namespace test_namespace
17// CHECK-PRINT: class TheClass
18// CHECK-PRINT: int theMethod(int x)
19//
20// RUN: clang-check -ast-list "%s" -- 2>&1 | FileCheck -check-prefix CHECK-LIST %s
21// CHECK-LIST: test_namespace
22// CHECK-LIST-NEXT: test_namespace::TheClass
23// CHECK-LIST-NEXT: test_namespace::TheClass::theMethod
24// CHECK-LIST-NEXT: x
25
26namespace test_namespace {
27
28class TheClass {
29public:
30 int theMethod(int x) {
31 return x + x;
32 }
33};
34
35}