Skip to content

Commit ab8b8af

Browse files
committed
fixup: tests
1 parent f1e1312 commit ab8b8af

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

0 commit comments

Comments
 (0)