Skip to content

Commit

Permalink
Update tests - the warning is now error and no fix-it note for HLSL
Browse files Browse the repository at this point in the history
  • Loading branch information
hekota committed May 19, 2024
1 parent 7481763 commit 6fc4628
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 24 deletions.
15 changes: 5 additions & 10 deletions clang/test/SemaHLSL/Availability/attr-availability-compute.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,28 @@ unsigned f8();

[numthreads(4,1,1)]
int main() {
// expected-warning@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-error@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-note@#f1 {{'f1' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f1_call {{enclose 'f1' in a __builtin_available check to silence this warning}}
unsigned A = f1(); // #f1_call

// expected-warning@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-error@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-note@#f2 {{'f2' has been marked as being introduced in Shader Model 5.1 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f2_call {{enclose 'f2' in a __builtin_available check to silence this warning}}
unsigned B = f2(); // #f2_call

unsigned C = f3();

// expected-warning@#f4_call {{'f4' is only available on Shader Model 6.0 or newer}}
// expected-error@#f4_call {{'f4' is only available on Shader Model 6.0 or newer}}
// expected-note@#f4 {{'f4' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f4_call {{enclose 'f4' in a __builtin_available check to silence this warning}}
unsigned D = f4(); // #f4_call

unsigned E = f5();

// expected-warning@#f6_call {{'f6' is only available in compute shader environment on Shader Model 6.0 or newer}}
// expected-error@#f6_call {{'f6' is only available in compute shader environment on Shader Model 6.0 or newer}}
// expected-note@#f6 {{'f6' has been marked as being introduced in Shader Model 6.0 in compute shader environment here, but the deployment target is Shader Model 5.0}}
// expected-note@#f6_call {{enclose 'f6' in a __builtin_available check to silence this warning}}
unsigned F = f6(); // #f6_call

// expected-warning@#f7_call {{'f7' is unavailable}}
// expected-error@#f7_call {{'f7' is unavailable}}
// expected-note@#f7 {{'f7' has been marked as being introduced in Shader Model 6.0 in mesh shader environment here, but the deployment target is Shader Model 5.0 compute shader environment}}
// expected-note@#f7_call {{enclose 'f7' in a __builtin_available check to silence this warning}}
unsigned G = f7(); // #f7_call

unsigned H = f8();
Expand Down
15 changes: 5 additions & 10 deletions clang/test/SemaHLSL/Availability/attr-availability-mesh.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,30 @@ unsigned f8(); // #f8

[numthreads(4,1,1)]
int main() {
// expected-warning@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-error@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-note@#f1 {{'f1' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f1_call {{enclose 'f1' in a __builtin_available check to silence this warning}}
unsigned A = f1(); // #f1_call

// expected-warning@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-error@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-note@#f2 {{'f2' has been marked as being introduced in Shader Model 5.1 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f2_call {{enclose 'f2' in a __builtin_available check to silence this warning}}
unsigned B = f2(); // #f2_call

unsigned C = f3();

// expected-warning@#f4_call {{'f4' is only available on Shader Model 6.0 or newer}}
// expected-error@#f4_call {{'f4' is only available on Shader Model 6.0 or newer}}
// expected-note@#f4 {{'f4' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f4_call {{enclose 'f4' in a __builtin_available check to silence this warning}}
unsigned D = f4(); // #f4_call

unsigned E = f5(); // #f5_call

unsigned F = f6(); // #f6_call

// expected-warning@#f7_call {{'f7' is only available in mesh shader environment on Shader Model 6.0 or newer}}
// expected-error@#f7_call {{'f7' is only available in mesh shader environment on Shader Model 6.0 or newer}}
// expected-note@#f7 {{'f7' has been marked as being introduced in Shader Model 6.0 in mesh shader environment here, but the deployment target is Shader Model 5.0 mesh shader environment}}
// expected-note@#f7_call {{enclose 'f7' in a __builtin_available check to silence this warning}}
unsigned G = f7(); // #f7_call

// expected-warning@#f8_call {{'f8' is only available in mesh shader environment on Shader Model 6.0 or newer}}
// expected-error@#f8_call {{'f8' is only available in mesh shader environment on Shader Model 6.0 or newer}}
// expected-note@#f8 {{'f8' has been marked as being introduced in Shader Model 6.0 in mesh shader environment here, but the deployment target is Shader Model 5.0 mesh shader environment}}
// expected-note@#f8_call {{enclose 'f8' in a __builtin_available check to silence this warning}}
unsigned H = f8(); // #f8_call

return 0;
Expand Down
6 changes: 2 additions & 4 deletions clang/test/SemaHLSL/Availability/attr-availability-pixel.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ __attribute__((availability(shadermodel, introduced = 6.0, environment = mesh)))
unsigned f8();

int main() {
// expected-warning@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-error@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
// expected-note@#f1 {{'f1' has been marked as being introduced in Shader Model 6.0 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f1_call {{enclose 'f1' in a __builtin_available check to silence this warning}}
unsigned A = f1(); // #f1_call

// expected-warning@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-error@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
// expected-note@#f2 {{'f2' has been marked as being introduced in Shader Model 5.1 here, but the deployment target is Shader Model 5.0}}
// expected-note@#f2_call {{enclose 'f2' in a __builtin_available check to silence this warning}}
unsigned B = f2(); // #f2_call

unsigned C = f3();
Expand Down

0 comments on commit 6fc4628

Please sign in to comment.