brintos

brintos / llvm-project-archived public Read only

0
0
Text · 785 B · b65deed Raw
22 lines · plain
1// RUN: not %clang_cc1 -triple dxil-pc-shadermodel6.3-compute -finclude-default-header --o - %s -verify
2
3// unbounded resource array at a global scope
4RWBuffer<float> unbounded_array[]; // no_error
5
6// expected-error@+1 {{incomplete resource array in a function parameter}}
7void foo(RWBuffer<float> array_arg[]) {}
8
9RWBuffer<float> A, B;
10
11[numthreads(4,1,1)]
12void main() {
13  // expected-error@+1{{definition of variable with array type needs an explicit size or an initializer}}
14  RWBuffer<float> res_local_array1[]; 
15
16  // expected-error@+1{{array initializer must be an initialzer list}}
17  RWBuffer<float> res_local_array2[] = unbounded_array;
18
19  // local incomplete resource array with initializer
20  RWBuffer<float> res_local_array3[] = { A, B }; // no error
21}
22