1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s
\r
3 // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}} struct MyBuffer definition
\r
4 // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 3]]:3, col:51> col:51 h '__hlsl_resource_t
\r
5 // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
\r
7 __hlsl_resource_t [[hlsl::resource_class(UAV)]] h;
\r
10 // CHECK: VarDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 2]]:1, col:49> col:49 res '__hlsl_resource_t
\r
11 // CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]]
\r
12 __hlsl_resource_t [[hlsl::resource_class(SRV)]] res;
\r
14 // CHECK: FunctionDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 3]]:1, line:[[# @LINE + 5]]:1> line:[[# @LINE + 3]]:6 f 'void ()
\r
15 // CHECK: VarDecl 0x{{[0-9a-f]+}} <col:3, col:55> col:55 r '__hlsl_resource_t
\r
16 // CHECK-SAME{LITERAL}: [[hlsl::resource_class(Sampler)]]
\r
18 __hlsl_resource_t [[hlsl::resource_class(Sampler)]] r;
\r
21 // CHECK: ClassTemplateDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 6]]:1, line:[[# @LINE + 8]]:1> line:[[# @LINE + 6]]:29 MyBuffer2
\r
22 // CHECK: TemplateTypeParmDecl 0x{{[0-9a-f]+}} <col:10, col:19> col:19 typename depth 0 index 0 T
\r
23 // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} <col:22, line:[[# @LINE + 6]]:1> line:[[# @LINE + 4]]:29 struct MyBuffer2 definition
\r
24 // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} <col:22, col:29> col:29 implicit struct MyBuffer2
\r
25 // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:[[# @LINE + 3]]:3, col:51> col:51 h '__hlsl_resource_t
\r
26 // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
\r
27 template<typename T> struct MyBuffer2 {
\r
28 __hlsl_resource_t [[hlsl::resource_class(UAV)]] h;
\r
31 // CHECK: ClassTemplateSpecializationDecl 0x{{[0-9a-f]+}} <line:[[# @LINE - 4]]:1, line:[[# @LINE - 2]]:1> line:[[# @LINE - 4]]:29 struct MyBuffer2 definition implicit_instantiation
\r
32 // CHECK: TemplateArgument type 'float'
\r
33 // CHECK: BuiltinType 0x{{[0-9a-f]+}} 'float'
\r
34 // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} <col:22, col:29> col:29 implicit struct MyBuffer2
\r
35 // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:[[# @LINE - 7]]:3, col:51> col:51 h '__hlsl_resource_t
\r
36 // CHECK-SAME{LITERAL}: [[hlsl::resource_class(UAV)]]
\r
37 MyBuffer2<float> myBuffer2;
\r