brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · bd9ae5f Raw
59 lines · cpp
1// RUN: clang-check -ast-dump "%s" -- 2>&1 | FileCheck %s2// CHECK: NamespaceDecl{{.*}}test_namespace3// CHECK-NEXT: CXXRecordDecl{{.*}}TheClass4// CHECK: CXXMethodDecl{{.*}}theMethod5// CHECK-NEXT: ParmVarDecl{{.*}}x6// CHECK-NEXT: CompoundStmt7// CHECK-NEXT:   ReturnStmt8// CHECK-NEXT:     BinaryOperator9//10// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::theMethod "%s" -- 2>&1 | FileCheck -check-prefix CHECK-FILTER %s11// CHECK-FILTER-NOT: NamespaceDecl12// CHECK-FILTER-NOT: CXXRecordDecl13// CHECK-FILTER: {{^}}Dumping test_namespace::TheClass::theMethod14// CHECK-FILTER-NEXT: {{^}}CXXMethodDecl{{.*}}theMethod15// CHECK-FILTER-NEXT: ParmVarDecl{{.*}}x16// CHECK-FILTER-NEXT: CompoundStmt17// CHECK-FILTER-NEXT:   ReturnStmt18// CHECK-FILTER-NEXT:     BinaryOperator19//20// RUN: clang-check -ast-print "%s" -- 2>&1 | FileCheck -check-prefix CHECK-PRINT %s21// CHECK-PRINT: namespace test_namespace22// CHECK-PRINT: class TheClass23// CHECK-PRINT: int theMethod(int x)24//25// RUN: clang-check -ast-list "%s" -- 2>&1 | FileCheck -check-prefix CHECK-LIST %s26// CHECK-LIST: test_namespace27// CHECK-LIST-NEXT: test_namespace::TheClass28// CHECK-LIST-NEXT: test_namespace::TheClass::theMethod29// CHECK-LIST-NEXT: x30//31// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::TheClass::n "%s" -- 2>&1 | FileCheck -check-prefix CHECK-ATTR %s32// CHECK-ATTR: test_namespace33// CHECK-ATTR-NEXT: FieldDecl{{.*}}n34// CHECK-ATTR-NEXT:   AlignedAttr35// CHECK-ATTR-NEXT:     ConstantExpr36// CHECK-ATTR-NEXT:       value: Int 237// CHECK-ATTR-NEXT:       BinaryOperator38//39// RUN: clang-check -ast-dump -ast-dump-filter test_namespace::AfterNullNode "%s" -- 2>&1 | FileCheck -check-prefix CHECK-AFTER-NULL %s40// CHECK-AFTER-NULL: class AfterNullNode41 42namespace test_namespace {43 44class TheClass {45public:46  int theMethod(int x) {47    return x + x;48  }49  int n __attribute__((aligned(1+1)));50};51 52// Used to fail with -ast-dump-filter X53template<template<typename T> class C> class Z {};54 55// Check that traversal continues after the previous construct.56class AfterNullNode {};57 58}59