annotate clang/test/SemaHLSL/AvailabilityMarkup.hlsl @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-library -verify %s
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
2
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
3 __attribute__((availability(shadermodel, introduced = 6.0)))
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
4 unsigned fn6_0(); // #fn6_0
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
5
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
6 __attribute__((availability(shadermodel, introduced = 5.1)))
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
7 unsigned fn5_1(); // #fn5_1
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
8
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
9 __attribute__((availability(shadermodel, introduced = 5.0)))
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
10 unsigned fn5_0();
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
11
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
12 void fn() {
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
13 // expected-warning@#fn6_0_site {{'fn6_0' is only available on HLSL ShaderModel 6.0 or newer}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
14 // expected-note@#fn6_0 {{'fn6_0' has been marked as being introduced in HLSL ShaderModel 6.0 here, but the deployment target is HLSL ShaderModel 5.0}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
15 // expected-note@#fn6_0_site {{enclose 'fn6_0' in a __builtin_available check to silence this warning}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
16 unsigned A = fn6_0(); // #fn6_0_site
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
17
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
18 // expected-warning@#fn5_1_site {{'fn5_1' is only available on HLSL ShaderModel 5.1 or newer}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
19 // expected-note@#fn5_1 {{'fn5_1' has been marked as being introduced in HLSL ShaderModel 5.1 here, but the deployment target is HLSL ShaderModel 5.0}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
20 // expected-note@#fn5_1_site {{enclose 'fn5_1' in a __builtin_available check to silence this warning}}
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
21 unsigned B = fn5_1(); // #fn5_1_site
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
22
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
23 unsigned C = fn5_0();
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
24 }
c4bab56944e8 LLVM 16
kono
parents:
diff changeset
25