1 // RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S -finclude-default-header -fnative-half-type -ast-dump -x hlsl %s | FileCheck %s
4 // CHECK: HLSLBufferDecl {{.*}} cbuffer A
7 // CHECK-NEXT:-HLSLResourceClassAttr {{.*}} <<invalid sloc>> Implicit CBuffer
8 // CHECK-NEXT:-HLSLResourceAttr {{.*}} <<invalid sloc>> Implicit CBuffer
9 // CHECK-NEXT: VarDecl {{.*}} A1 'float4'
10 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 0
11 float4 A1 : packoffset(c);
12 // CHECK-NEXT: VarDecl {{.*}} col:11 A2 'float'
13 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 1 0
14 float A2 : packoffset(c1);
15 // CHECK-NEXT: VarDecl {{.*}} col:11 A3 'float'
16 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 1 1
17 float A3 : packoffset(c1.y);
20 // CHECK: HLSLBufferDecl {{.*}} cbuffer B
23 // CHECK: VarDecl {{.*}} B0 'float'
24 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 1
25 float B0 : packoffset(c0.g);
26 // CHECK-NEXT: VarDecl {{.*}} B1 'double'
27 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 2
28 double B1 : packoffset(c0.b);
29 // CHECK-NEXT: VarDecl {{.*}} B2 'half'
30 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 0
31 half B2 : packoffset(c0.r);
34 // CHECK: HLSLBufferDecl {{.*}} cbuffer C
37 // CHECK: VarDecl {{.*}} C0 'float'
38 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 1
39 float C0 : packoffset(c0.y);
40 // CHECK-NEXT: VarDecl {{.*}} C1 'float2'
41 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 2
42 float2 C1 : packoffset(c0.z);
43 // CHECK-NEXT: VarDecl {{.*}} C2 'half'
44 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0
45 half C2 : packoffset(c0.x);
49 // CHECK: HLSLBufferDecl {{.*}} cbuffer D
52 // CHECK: VarDecl {{.*}} D0 'float'
53 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 1
54 float D0 : packoffset(c0.y);
55 // CHECK-NEXT: VarDecl {{.*}} D1 'float[2]'
56 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 1 0
57 float D1[2] : packoffset(c1.x);
58 // CHECK-NEXT: VarDecl {{.*}} D2 'half3'
59 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 2 1
60 half3 D2 : packoffset(c2.y);
61 // CHECK-NEXT: VarDecl {{.*}} D3 'double'
62 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 2
63 double D3 : packoffset(c0.z);
72 // CHECK: HLSLBufferDecl {{.*}} cbuffer S
74 // CHECK: VarDecl {{.*}} S0 'float'
75 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 1
76 float S0 : packoffset(c0.y);
77 // CHECK: VarDecl {{.*}} S1 'ST'
78 // CHECK: HLSLPackOffsetAttr {{.*}} 1 0
79 ST S1 : packoffset(c1);
80 // CHECK: VarDecl {{.*}} S2 'double2'
81 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 2 0
82 double2 S2 : packoffset(c2);
91 // CHECK: HLSLBufferDecl {{.*}} cbuffer S2
93 // CHECK: VarDecl {{.*}} S20 'float'
94 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 0 3
95 float S20 : packoffset(c0.a);
96 // CHECK: VarDecl {{.*}} S21 'ST2'
97 // CHECK: HLSLPackOffsetAttr {{.*}} 1 0
98 ST2 S21 : packoffset(c1);
99 // CHECK: VarDecl {{.*}} S22 'half'
100 // CHECK-NEXT: HLSLPackOffsetAttr {{.*}} 3 1
101 half S22 : packoffset(c3.y);