1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-pixel -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)))
40 // expected-error@#f1_call {{'f1' is only available on Shader Model 6.0 or newer}}
41 // 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}}
42 unsigned A = f1(); // #f1_call
44 // expected-error@#f2_call {{'f2' is only available on Shader Model 5.1 or newer}}
45 // 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}}
46 unsigned B = f2(); // #f2_call
50 unsigned D = f4(); // #f4_call
54 unsigned F = f6(); // #f6_call
56 unsigned G = f7(); // #f7_call