-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add test for class definition AST
- Loading branch information
1 parent
c5b13c8
commit 606acd5
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// RUN: %cxx -verify -ast-dump %s | %filecheck %s --match-full-lines | ||
|
||
class EmptyClass {}; | ||
|
||
class OtherEmptyClass {}; | ||
|
||
class FinalClass final {}; | ||
|
||
class DerivedClass : public EmptyClass {}; | ||
|
||
class DerivedClass2 : public EmptyClass, private OtherEmptyClass {}; | ||
|
||
class DerivedClass3 : virtual public EmptyClass {}; | ||
|
||
// clang-format off | ||
// CHECK:translation-unit | ||
// CHECK-NEXT: declaration-list | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: EmptyClass | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: OtherEmptyClass | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: FinalClass | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: DerivedClass | ||
// CHECK-NEXT: base-clause: base-clause | ||
// CHECK-NEXT: base-specifier-list | ||
// CHECK-NEXT: base-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: EmptyClass | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: DerivedClass2 | ||
// CHECK-NEXT: base-clause: base-clause | ||
// CHECK-NEXT: base-specifier-list | ||
// CHECK-NEXT: base-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: EmptyClass | ||
// CHECK-NEXT: base-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: OtherEmptyClass | ||
// CHECK-NEXT: simple-declaration | ||
// CHECK-NEXT: decl-specifier-list | ||
// CHECK-NEXT: class-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: DerivedClass3 | ||
// CHECK-NEXT: base-clause: base-clause | ||
// CHECK-NEXT: base-specifier-list | ||
// CHECK-NEXT: base-specifier | ||
// CHECK-NEXT: name: simple-name | ||
// CHECK-NEXT: identifier: EmptyClass |