1 // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -fnative-half-type -verify %s
3 // expected-warning@+1{{cannot mix packoffset elements with nonpackoffset elements in a cbuffer}}
6 float4 M1 : packoffset(c0);
8 float M3 : packoffset(c1.y);
11 // expected-warning@+1{{cannot mix packoffset elements with nonpackoffset elements in a cbuffer}}
15 float M5 : packoffset(c1.y);
19 // expected-error@+1{{attribute 'packoffset' only applies to shader constant in a constant buffer}}
20 float4 g : packoffset(c0);
24 // expected-error@+1{{invalid resource class specifier 't2' for packoffset, expected 'c'}}
25 float4 i1 : packoffset(t2);
26 // expected-error@+1{{invalid component 'm' used; expected 'x', 'y', 'z', or 'w'}}
27 float i2 : packoffset(c1.m);
32 float4 o1 : packoffset(c0);
33 // expected-error@+1{{packoffset overlap between 'o2', 'o1'}}
34 float2 o2 : packoffset(c0.z);
39 // expected-error@+1{{packoffset cannot cross register boundary}}
40 float4 c1 : packoffset(c0.y);
41 // expected-error@+1{{packoffset cannot cross register boundary}}
42 float2 c2 : packoffset(c1.w);
51 // expected-error@+1{{packoffset cannot cross register boundary}}
52 ST A1 : packoffset(c0.y);
53 // expected-error@+1{{packoffset cannot cross register boundary}}
54 float A2[2] : packoffset(c1.w);
58 // expected-error@+1{{packoffset at 'y' not match alignment 64 required by 'double'}}
59 double d : packoffset(c.y);
60 // expected-error@+1{{packoffset cannot cross register boundary}}
61 double2 d2 : packoffset(c.z);
62 // expected-error@+1{{packoffset cannot cross register boundary}}
63 double3 d3 : packoffset(c.z);
67 // expected-error@+1{{expected identifier}}
68 float pf0 : packoffset();
69 // expected-error@+1{{expected identifier}}
70 float pf1 : packoffset((c0));
71 // expected-error@+1{{expected ')'}}
72 float pf2 : packoffset(c0, x);
73 // expected-error@+1{{invalid component 'X' used}}
74 float pf3 : packoffset(c.X);
75 // expected-error@+1{{expected '(' after ''}}
76 float pf4 : packoffset;
77 // expected-error@+1{{expected identifier}}
78 float pf5 : packoffset(;
79 // expected-error@+1{{expected '(' after '}}
80 float pf6 : packoffset);
81 // expected-error@+1{{expected '(' after '}}
82 float pf7 : packoffset c0.x;
84 // expected-error@+1{{invalid component 'xy' used}}
85 float pf8 : packoffset(c0.xy);
86 // expected-error@+1{{invalid component 'rg' used}}
87 float pf9 : packoffset(c0.rg);
88 // expected-error@+1{{invalid component 'yes' used}}
89 float pf10 : packoffset(c0.yes);
90 // expected-error@+1{{invalid component 'woo'}}
91 float pf11 : packoffset(c0.woo);
92 // expected-error@+1{{invalid component 'xr' used}}
93 float pf12 : packoffset(c0.xr);
102 float S0 : packoffset(c0.y);
103 ST2 S1[2] : packoffset(c1);
104 // expected-error@+1{{packoffset overlap between 'S2', 'S1'}}
105 half2 S2 : packoffset(c1.w);
106 half2 S3 : packoffset(c2.w);
115 float S20 : packoffset(c0.y);
116 ST2 S21 : packoffset(c1);
117 half2 S22 : packoffset(c2.w);
118 double S23[2] : packoffset(c3);
119 // expected-error@+1{{packoffset overlap between 'S24', 'S23'}}
120 float S24 : packoffset(c3.z);
121 float S25 : packoffset(c4.z);