blob: 6e03f82d0fe945125910f99c549c048ff443b5b0 [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
Dmitri Gribenko0061fe42012-11-21 10:54:55 +000011// CHECK-FILTER: {{^}}Dumping test_namespace::TheClass::theMethod
12// CHECK-FILTER-NEXT: {{^}}int theMethod(int x) (CompoundStmt
Alexander Kornienko48464702012-08-13 10:50:08 +000013// CHECK-FILTER-NEXT: (ReturnStmt
14// CHECK-FILTER-NEXT: (BinaryOperator
15//
16// RUN: clang-check -ast-print "%s" -- 2>&1 | FileCheck -check-prefix CHECK-PRINT %s
17// CHECK-PRINT: namespace test_namespace
18// CHECK-PRINT: class TheClass
19// CHECK-PRINT: int theMethod(int x)
20//
21// RUN: clang-check -ast-list "%s" -- 2>&1 | FileCheck -check-prefix CHECK-LIST %s
22// CHECK-LIST: test_namespace
23// CHECK-LIST-NEXT: test_namespace::TheClass
24// CHECK-LIST-NEXT: test_namespace::TheClass::theMethod
25// CHECK-LIST-NEXT: x
Richard Smith0dae7292012-08-16 02:43:29 +000026//
27// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s
28// CHECK-ATTR: test_namespace
Richard Smithd1420c62012-08-16 03:56:14 +000029// CHECK-ATTR-NEXT: int n __attribute__((aligned((BinaryOperator
Alexander Kornienko30280382012-10-31 18:46:31 +000030//
31// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::AfterNullNode "%s" -- 2>&1 | FileCheck -check-prefix CHECK-AFTER-NULL %s
32// CHECK-AFTER-NULL: class AfterNullNode
Alexander Kornienko48464702012-08-13 10:50:08 +000033
34namespace test_namespace {
35
36class TheClass {
37public:
38 int theMethod(int x) {
39 return x + x;
40 }
Richard Smith0dae7292012-08-16 02:43:29 +000041 int n __attribute__((aligned(1+1)));
Alexander Kornienko48464702012-08-13 10:50:08 +000042};
43
Alexander Kornienkoa7612ae2012-08-17 17:38:39 +000044// Used to fail with -ast-dump-filter X
45template<template<typename T> class C> class Z {};
46
Alexander Kornienko30280382012-10-31 18:46:31 +000047// Check that traversal continues after the previous construct.
48class AfterNullNode {};
49
Alexander Kornienko48464702012-08-13 10:50:08 +000050}