1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify
\r
3 // expected-error@+1{{'is_rov' attribute cannot be applied to a declaration}}
\r
4 [[hlsl::is_rov]] __hlsl_resource_t res0;
\r
6 // expected-error@+1{{HLSL resource needs to have [[hlsl::resource_class()]] attribute}}
\r
7 __hlsl_resource_t [[hlsl::is_rov]] res1;
\r
9 // expected-error@+1{{'is_rov' attribute takes no arguments}}
\r
10 __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov(3)]] res2;
\r
12 // expected-error@+1{{use of undeclared identifier 'gibberish'}}
\r
13 __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov(gibberish)]] res3;
\r
15 // expected-warning@+1{{attribute 'is_rov' is already applied}}
\r
16 __hlsl_resource_t [[hlsl::resource_class(UAV)]] [[hlsl::is_rov]] [[hlsl::is_rov]] res4;
\r
18 // expected-error@+2{{attribute 'resource_class' can be used only on HLSL intangible type '__hlsl_resource_t'}}
\r
19 // expected-error@+1{{attribute 'is_rov' can be used only on HLSL intangible type '__hlsl_resource_t'}}
\r
20 float [[hlsl::resource_class(UAV)]] [[hlsl::is_rov]] res5;
\r