brintos

brintos / llvm-project-archived public Read only

0
0
Text · 960 B · 0f2064f Raw
28 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -emit-llvm-only -disable-llvm-passes -verify2 3// RWBuffer<int>4using handle_t = __hlsl_resource_t5    [[hlsl::resource_class(UAV)]] [[hlsl::contained_type(int)]];6 7void test_args(unsigned 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 'unsigned 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 'unsigned int'}}20  __builtin_hlsl_resource_getpointer(res, "1");21 22  // no error23  __builtin_hlsl_resource_getpointer(res, 0u);24 25  // no error26  __builtin_hlsl_resource_getpointer(res, x);27}28