1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -x hlsl -ast-dump -verify -o - %s
4 // expected-error@+1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
5 void CSMain(float ID : SV_DispatchThreadID) {
14 // expected-error@+1 {{attribute 'SV_DispatchThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
15 void CSMain2(ST ID : SV_DispatchThreadID) {
20 // expected-warning@+1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
21 uint V : SV_DispatchThreadID;
26 // expected-warning@+1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}}
27 static uint X : SV_DispatchThreadID;
28 uint s : SV_DispatchThreadID;
32 // expected-error@+1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
33 void CSMain_GID(float ID : SV_GroupID) {
37 // expected-error@+1 {{attribute 'SV_GroupID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
38 void CSMain2_GID(ST GID : SV_GroupID) {
43 // expected-warning@+1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
44 uint GIS : SV_GroupID;
48 // expected-warning@+1 {{'SV_GroupID' attribute only applies to parameters and non-static data members}}
49 static uint GID : SV_GroupID;
50 uint s_gid : SV_GroupID;
54 // expected-error@+1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
55 void CSMain_GThreadID(float ID : SV_GroupThreadID) {
59 // expected-error@+1 {{attribute 'SV_GroupThreadID' only applies to a field or parameter of type 'uint/uint2/uint3'}}
60 void CSMain2_GThreadID(ST GID : SV_GroupThreadID) {
64 void foo_GThreadID() {
65 // expected-warning@+1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
66 uint GThreadIS : SV_GroupThreadID;
69 struct ST2_GThreadID {
70 // expected-warning@+1 {{'SV_GroupThreadID' attribute only applies to parameters and non-static data members}}
71 static uint GThreadID : SV_GroupThreadID;
72 uint s_gthreadid : SV_GroupThreadID;
77 // expected-error@+4 {{attribute 'SV_GroupIndex' is unsupported in 'vertex' shaders, requires compute}}
78 // expected-error@+3 {{attribute 'SV_DispatchThreadID' is unsupported in 'vertex' shaders, requires compute}}
79 // expected-error@+2 {{attribute 'SV_GroupID' is unsupported in 'vertex' shaders, requires compute}}
80 // expected-error@+1 {{attribute 'SV_GroupThreadID' is unsupported in 'vertex' shaders, requires compute}}
81 void vs_main(int GI : SV_GroupIndex, uint ID : SV_DispatchThreadID, uint GID : SV_GroupID, uint GThreadID : SV_GroupThreadID) {}