Debian Codegraph @

clang/test/ParserHLSL/hlsl_annotations_on_struct_members.hlsl

raw
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s
2
3 // tests that hlsl annotations are properly parsed when applied on field decls,
4 // and that the annotation gets properly placed on the AST.
5
6 struct Eg9{
7 // CHECK: CXXRecordDecl 0x{{[0-9a-f]+}} <col:1, col:8> col:8 implicit struct Eg9
8 // CHECK: FieldDecl 0x{{[0-9a-f]+}} <line:10:3, col:16> col:16 referenced a 'unsigned int'
9 // CHECK: -HLSLParsedSemanticAttr 0x{{[0-9a-f]+}} <col:20> "SV_DispatchThreadID" 0
10 unsigned int a : SV_DispatchThreadID;
11 };
12 Eg9 e9;
13
14
15 RWBuffer<int> In : register(u1);
16
17
18 [numthreads(1,1,1)]
19 void main() {
20 In[0] = e9.a;
21 }