| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify |
| 2 |
|
| 3 |
// expected-error@+1{{'hlsl::resource_class' attribute cannot be applied to a declaration}} |
| 4 |
[[hlsl::resource_class(UAV)]] __hlsl_resource_t e0; |
| 5 |
|
| 6 |
// expected-error@+1{{'hlsl::resource_class' attribute takes one argument}} |
| 7 |
__hlsl_resource_t [[hlsl::resource_class()]] e1; |
| 8 |
|
| 9 |
// expected-warning@+1{{ResourceClass attribute argument not supported: gibberish}} |
| 10 |
__hlsl_resource_t [[hlsl::resource_class(gibberish)]] e2; |
| 11 |
|
| 12 |
// expected-warning@+1{{attribute 'hlsl::resource_class' is already applied with different arguments}} |
| 13 |
__hlsl_resource_t [[hlsl::resource_class(SRV)]] [[hlsl::resource_class(UAV)]] e3; |
| 14 |
|
| 15 |
// expected-warning@+1{{attribute 'hlsl::resource_class' is already applied}} |
| 16 |
__hlsl_resource_t [[hlsl::resource_class(SRV)]] [[hlsl::resource_class(SRV)]] e4; |
| 17 |
|
| 18 |
// expected-error@+1{{'hlsl::resource_class' attribute takes one argument}} |
| 19 |
__hlsl_resource_t [[hlsl::resource_class(SRV, "aa")]] e5; |
| 20 |
|
| 21 |
// expected-error@+1{{attribute 'hlsl::resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}} |
| 22 |
float [[hlsl::resource_class(UAV)]] e6; |