summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/structuredbuffer-with-unbounded.slang
blob: 7c2a3bd4756a23c6bd421ebf02a15eebf63f81de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that StructuredBuffer of struct with unbounded array is not allowed

//TEST:SIMPLE(filecheck=CHECK): -target spirv -allow-glsl -stage compute -entry computeMain

// Struct containing unbounded array (must be last member)
struct StructWithUnbounded
{
    float value;
    int data[];  // Unbounded array must be last member
}

// StructuredBuffer of struct with unbounded array - should error
//CHECK: ([[# @LINE+1]]): error 30028
StructuredBuffer<StructWithUnbounded> myBuffer;

[numthreads(1, 1, 1)]
void computeMain()
{
    // Empty - we're just testing the declarations
}