Alexander Kornienko | 4846470 | 2012-08-13 10:50:08 +0000 | [diff] [blame] | 1 | // 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 |
Richard Smith | 0dae729 | 2012-08-16 02:43:29 +0000 | [diff] [blame] | 25 | // |
| 26 | // RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s |
| 27 | // CHECK-ATTR: test_namespace |
Richard Smith | d1420c6 | 2012-08-16 03:56:14 +0000 | [diff] [blame] | 28 | // CHECK-ATTR-NEXT: int n __attribute__((aligned((BinaryOperator |
Alexander Kornienko | 3028038 | 2012-10-31 18:46:31 +0000 | [diff] [blame] | 29 | // |
| 30 | // RUN: clang-check -ast-dump -ast-dump-filter test_namespace::AfterNullNode "%s" -- 2>&1 | FileCheck -check-prefix CHECK-AFTER-NULL %s |
| 31 | // CHECK-AFTER-NULL: class AfterNullNode |
Alexander Kornienko | 4846470 | 2012-08-13 10:50:08 +0000 | [diff] [blame] | 32 | |
| 33 | namespace test_namespace { |
| 34 | |
| 35 | class TheClass { |
| 36 | public: |
| 37 | int theMethod(int x) { |
| 38 | return x + x; |
| 39 | } |
Richard Smith | 0dae729 | 2012-08-16 02:43:29 +0000 | [diff] [blame] | 40 | int n __attribute__((aligned(1+1))); |
Alexander Kornienko | 4846470 | 2012-08-13 10:50:08 +0000 | [diff] [blame] | 41 | }; |
| 42 | |
Alexander Kornienko | a7612ae | 2012-08-17 17:38:39 +0000 | [diff] [blame] | 43 | // Used to fail with -ast-dump-filter X |
| 44 | template<template<typename T> class C> class Z {}; |
| 45 | |
Alexander Kornienko | 3028038 | 2012-10-31 18:46:31 +0000 | [diff] [blame] | 46 | // Check that traversal continues after the previous construct. |
| 47 | class AfterNullNode {}; |
| 48 | |
Alexander Kornienko | 4846470 | 2012-08-13 10:50:08 +0000 | [diff] [blame] | 49 | } |