| 1 |
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++20 -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s |
| 2 |
|
| 3 |
// Test with serialization: |
| 4 |
// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown -emit-pch -o %t %s |
| 5 |
// RUN: %clang_cc1 -x c++ -std=c++20 -triple x86_64-unknown-unknown -include-pch %t \ |
| 6 |
// RUN: -ast-dump-all -ast-dump-filter Foo /dev/null \ |
| 7 |
// RUN: | FileCheck --strict-whitespace %s |
| 8 |
|
| 9 |
namespace Bob { |
| 10 |
enum class Foo { |
| 11 |
Foo_a, |
| 12 |
Foo_b |
| 13 |
}; |
| 14 |
}; // namespace Bob |
| 15 |
|
| 16 |
using enum Bob::Foo; |
| 17 |
|
| 18 |
// CHECK-LABEL: Dumping Bob::Foo |
| 19 |
// CHECK-NEXT: EnumDecl {{.*}} class Foo 'int' |
| 20 |
// CHECK-NEXT: |-EnumConstantDecl {{.*}} Foo_a 'Bob::Foo' |
| 21 |
// CHECK-NEXT: `-EnumConstantDecl {{.*}} Foo_b 'Bob::Foo' |
| 22 |
|
| 23 |
// CHECK-LABEL: Dumping Foo: |
| 24 |
// CHECK-NEXT: UsingEnumDecl {{.*}} <{{.*}}:16:1, col:17> {{.*}} Enum {{.*}} 'Foo' |
| 25 |
|
| 26 |
// CHECK-LABEL: Dumping Foo_a: |
| 27 |
// CHECK-NEXT: UsingShadowDecl {{.*}} implicit EnumConstant {{.*}} 'Foo_a' 'Bob::Foo' |
| 28 |
|
| 29 |
// CHECK-LABEL: Dumping Foo_b: |
| 30 |
// CHECK-NEXT: UsingShadowDecl {{.*}} implicit EnumConstant {{.*}} 'Foo_b' 'Bob::Foo' |