diff options
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/arrow-operator.slang | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/diagnostics/arrow-operator.slang b/tests/diagnostics/arrow-operator.slang new file mode 100644 index 000000000..8c370cf67 --- /dev/null +++ b/tests/diagnostics/arrow-operator.slang @@ -0,0 +1,25 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly + +struct Type +{ + int member; +} + +struct CB +{ + Type* ptr; +} +ConstantBuffer<CB> cb; + +[numthreads(1,1,1)] +void main() +{ + Type val; + + // CHECK: ([[# @LINE+1]]): error 30101 + val->member = 2; // Error. + + // CHECK-NOT: error + let a = cb->ptr->member; // OK. + +}
\ No newline at end of file |
