From b06e94b87a115c5979c728ce13ddf34b80285a9f Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Tue, 3 Jun 2025 12:03:11 +0300 Subject: Fix specialization constants getting incorrectly folded (#7299) --- tests/bugs/gh-7293.slang | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/bugs/gh-7293.slang (limited to 'tests') diff --git a/tests/bugs/gh-7293.slang b/tests/bugs/gh-7293.slang new file mode 100644 index 000000000..d5ca48248 --- /dev/null +++ b/tests/bugs/gh-7293.slang @@ -0,0 +1,15 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +[SpecializationConstant] const int MAX_ITERS = 0; + +RWStructuredBuffer outputBuffer; + +[numthreads(1, 1, 1)] +void computeMain(int3 dispatchThreadID: SV_DispatchThreadID) +{ + for (int i = 0; i < MAX_ITERS; i++) { + outputBuffer[i] = i; + } +} + +// CHECK-NOT: 30505 -- cgit v1.2.3