| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -x hlsl -ast-dump -verify -o - %s |
| 2 |
|
| 3 |
[numthreads(8,8,1)] |
| 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) { |
| 6 |
|
| 7 |
} |
| 8 |
|
| 9 |
struct ST { |
| 10 |
int a; |
| 11 |
float b; |
| 12 |
}; |
| 13 |
[numthreads(8,8,1)] |
| 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) { |
| 16 |
|
| 17 |
} |
| 18 |
|
| 19 |
void foo() { |
| 20 |
// expected-warning@+1 {{'SV_DispatchThreadID' attribute only applies to parameters and non-static data members}} |
| 21 |
uint V : SV_DispatchThreadID; |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
struct ST2 { |
| 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; |
| 29 |
}; |