1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library \
\r
2 // RUN: -fsyntax-only -verify %s
\r
4 __attribute__((availability(shadermodel, introduced = 6.5)))
\r
5 float fx(float); // #fx
\r
7 __attribute__((availability(shadermodel, introduced = 5.0, environment = pixel)))
\r
8 __attribute__((availability(shadermodel, introduced = 6.5, environment = compute)))
\r
9 float fy(float); // #fy
\r
11 __attribute__((availability(shadermodel, introduced = 5.0, environment = compute)))
\r
12 float fz(float); // #fz
\r
16 // Make sure we only get this error once, even though this function is scanned twice - once
\r
17 // in compute shader context and once in pixel shader context.
\r
18 // expected-error@#fx_call {{'fx' is only available on Shader Model 6.5 or newer}}
\r
19 // expected-note@#fx {{fx' has been marked as being introduced in Shader Model 6.5 here, but the deployment target is Shader Model 6.0}}
\r
20 float A = fx(f); // #fx_call
\r
22 // expected-error@#fy_call {{'fy' is only available in compute environment on Shader Model 6.5 or newer}}
\r
23 // expected-note@#fy {{'fy' has been marked as being introduced in Shader Model 6.5 in compute environment here, but the deployment target is Shader Model 6.0 compute environment}}
\r
24 float B = fy(f); // #fy_call
\r
26 // expected-error@#fz_call {{'fz' is unavailable}}
\r
27 // expected-note@#fz {{'fz' has been marked as being introduced in Shader Model 5.0 in compute environment here, but the deployment target is Shader Model 6.0 pixel environment}}
\r
28 float X = fz(f); // #fz_call
\r
31 void deadCode(float f) {
\r
32 // no diagnostics expected under default diagnostic mode
\r
44 // First Compute shader
\r
47 void mainCompute1() {
\r
51 // Second compute shader to make sure we do not get duplicate messages if F is called
\r
52 // from multiple entry points.
\r
55 void mainCompute2() {
\r