diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-07-18 11:24:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-18 18:24:06 +0000 |
| commit | 70273599e2bb8a8e2b0f7b5e7ad47fe2f00b2b40 (patch) | |
| tree | 29d18f4b20c00bfbe684978d35d02da77713a4ae /tests | |
| parent | c901338e3b443be4c72308f4f473892404b73268 (diff) | |
Fix debug info generation for let variables in SPIR-V output (#7743)
* Initial plan
* Fix debug info for let variables
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Fix parameter count for emitDebugVar function call
Fixed regression where let variable debug info generation was missing the optional argIndex parameter in emitDebugVar call.
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Add location validity check for debug info generation
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
* Don't insert debug value for nondebuggable types.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/language-feature/let-debug-info.slang | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/language-feature/let-debug-info.slang b/tests/language-feature/let-debug-info.slang new file mode 100644 index 000000000..206f234cc --- /dev/null +++ b/tests/language-feature/let-debug-info.slang @@ -0,0 +1,21 @@ +//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type + +//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4) +RWStructuredBuffer<float> outputBuffer; + +[numthreads(1, 1, 1)] +void computeMain() +{ + let x = float(2); // Let variable should generate debug info + var y = float(3); // Var variable for comparison + float z = float(4); // Regular variable declaration + + // Use the variables so they don't get optimized away + float result = x + y + z; + + // CHECK: 9.0 + outputBuffer[0] = result; +} + +// This test verifies that 'let' variables now generate debug information +// Previously, 'let' variables did not generate debug info, causing issues with debuggers
\ No newline at end of file |
