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