diff options
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/static-const-init-expr-with-interface-1.slang | 15 | ||||
| -rw-r--r-- | tests/bugs/static-const-init-expr-with-interface-2.slang | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs/static-const-init-expr-with-interface-1.slang b/tests/bugs/static-const-init-expr-with-interface-1.slang new file mode 100644 index 000000000..bab63c167 --- /dev/null +++ b/tests/bugs/static-const-init-expr-with-interface-1.slang @@ -0,0 +1,15 @@ +//TEST:LANG_SERVER(filecheck=CHECK): + +//HOVER:7,25 +//CHECK:Bug.badVar = 0 +interface Bug +{ + static const int badVar = 0; +} + +RWStructuredBuffer<int> b; +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) +{ + b[0] = Bug::badVar; +} diff --git a/tests/bugs/static-const-init-expr-with-interface-2.slang b/tests/bugs/static-const-init-expr-with-interface-2.slang new file mode 100644 index 000000000..6976f1303 --- /dev/null +++ b/tests/bugs/static-const-init-expr-with-interface-2.slang @@ -0,0 +1,15 @@ +//TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target spirv + +//CHECK: error 30623 + +interface Bug +{ + static const int badVar = 0; +} + +RWStructuredBuffer<int> b; +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) +{ + b[0] = Bug::badVar; +} |
