1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-mesh -fsyntax-only -verify %s
3 // Platform shader model, no environment parameter
4 __attribute__((availability(shadermodel, introduced = 6.0)))
7 __attribute__((availability(shadermodel, introduced = 5.1)))
10 __attribute__((availability(shadermodel, introduced = 5.0)))
13 // Platform shader model, environment parameter restricting earlier version,
14 // available in all environments in higher versions
15 __attribute__((availability(shadermodel, introduced = 2.0, environment = pixel)))
16 __attribute__((availability(shadermodel, introduced = 6.0)))
19 __attribute__((availability(shadermodel, introduced = 2.0, environment = pixel)))
20 __attribute__((availability(shadermodel, introduced = 5.0)))
23 // Platform shader model, environment parameter restricting earlier version,
24 // never available in all environments in higher versions
25 __attribute__((availability(shadermodel, introduced = 2.0, environment = pixel)))
26 __attribute__((availability(shadermodel, introduced = 6.0, environment = compute)))
27 __attribute__((availability(shadermodel, introduced = 5.0, environment = mesh)))
30 __attribute__((availability(shadermodel, introduced = 2.0, environment = pixel)))
31 __attribute__((availability(shadermodel, introduced = 6.0, environment = mesh)))
34 __attribute__((availability(shadermodel, introduced = 2.0, environment = pixel)))
35 __attribute__((availability(shadermodel, introduced = 5.0, environment = compute)))
36 __attribute__((availability(shadermodel, introduced = 6.0, environment = mesh)))
41 // expected-error@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
42 // 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}}
43 unsigned A = f1(); // #f1_call
45 // expected-error@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
46 // 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}}
47 unsigned B = f2(); // #f2_call
51 // expected-error@#f4_call {{'f4' is only available on Shader Model 6.0 or newer}}
52 // 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}}
53 unsigned D = f4(); // #f4_call
55 unsigned E = f5(); // #f5_call
57 unsigned F = f6(); // #f6_call
59 // expected-error@#f7_call {{'f7' is only available in mesh environment on Shader Model 6.0 or newer}}
60 // expected-note@#f7 {{'f7' has been marked as being introduced in Shader Model 6.0 in mesh environment here, but the deployment target is Shader Model 5.0 mesh environment}}
61 unsigned G = f7(); // #f7_call
63 // expected-error@#f8_call {{'f8' is only available in mesh environment on Shader Model 6.0 or newer}}
64 // expected-note@#f8 {{'f8' has been marked as being introduced in Shader Model 6.0 in mesh environment here, but the deployment target is Shader Model 5.0 mesh environment}}
65 unsigned H = f8(); // #f8_call