File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
clang/test/SemaHLSL/BuiltIns Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify
2+
3+ // RWBuffer<int>
4+ using handle_t = __hlsl_resource_t
5+ [[hlsl::resource_class (UAV)]] [[hlsl::contained_type (int )]];
6+
7+ void test_args (int x) {
8+ // expected-error@+1 {{too few arguments to function call, expected 2, have 1}}
9+ __builtin_hlsl_resource_getpointer (x);
10+
11+ // expected-error@+1 {{too many arguments to function call, expected 2, have 3}}
12+ __builtin_hlsl_resource_getpointer (x, x, x);
13+
14+ // expected-error@+1 {{used type 'int' where __hlsl_resource_t is required}}
15+ __builtin_hlsl_resource_getpointer (x, x);
16+
17+ handle_t res;
18+
19+ // expected-error@+1 {{passing 'const char *' to parameter of incompatible type 'int'}}
20+ __builtin_hlsl_resource_getpointer (res, "1" );
21+
22+ // no error
23+ __builtin_hlsl_resource_getpointer (res, 0 );
24+
25+ // no error
26+ __builtin_hlsl_resource_getpointer (res, x);
27+ }
You can’t perform that action at this time.
0 commit comments