summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-06-11 22:33:16 -0700
committerGitHub <noreply@github.com>2025-06-12 05:33:16 +0000
commit7dad68f869502e5c0ab32c12cbf8db866e020713 (patch)
tree1df62f9536639f06706bd1a14031c6d5b62f78a3 /tests/diagnostics
parentc83a6d5b83a0b12f7029fd17fc8037beddb79834 (diff)
Fix intermittent debug failures with Debug build (#7369)
This PR replaces enable/disable style C function calls with C++ RAII style code. In debug build, when an assertion failed in between enable and disable functions, an exception is thrown and the disable function is not called. RAII style code is safer for an exception
Diffstat (limited to 'tests/diagnostics')
-rw-r--r--tests/diagnostics/missing-return-target.slang16
-rw-r--r--tests/diagnostics/recursive-import.slang2
-rw-r--r--tests/diagnostics/unbound-loop.slang4
-rw-r--r--tests/diagnostics/uninitialized-resource-type.slang4
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/diagnostics/missing-return-target.slang b/tests/diagnostics/missing-return-target.slang
index fba1b9089..8fc65efd1 100644
--- a/tests/diagnostics/missing-return-target.slang
+++ b/tests/diagnostics/missing-return-target.slang
@@ -1,12 +1,12 @@
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target spirv
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target glsl
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target wgsl
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target spirv
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target glsl
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_NOT_SUPP): -entry computeMain -stage compute -target wgsl
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP):
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target hlsl
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target metal
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target cpp
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target cuda
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP):
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target hlsl
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target metal
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target cpp
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK_SUPP): -entry computeMain -stage compute -target cuda
// Some compilation targets allow missing returns while some do not.
// This test ensures that either errors and warnings are emitted appropriately.
diff --git a/tests/diagnostics/recursive-import.slang b/tests/diagnostics/recursive-import.slang
index 017e2a2fc..312c579cf 100644
--- a/tests/diagnostics/recursive-import.slang
+++ b/tests/diagnostics/recursive-import.slang
@@ -1,4 +1,4 @@
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
+//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
// A file that recursively imports itself
// (including transitive cases) should be diagnosed.
diff --git a/tests/diagnostics/unbound-loop.slang b/tests/diagnostics/unbound-loop.slang
index c0e67d9d4..5e85c3c66 100644
--- a/tests/diagnostics/unbound-loop.slang
+++ b/tests/diagnostics/unbound-loop.slang
@@ -1,4 +1,4 @@
-//DISABLE_TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target hlsl -profile cs_6_5
+//TEST:SIMPLE(filecheck=CHECK): -entry computeMain -target hlsl -profile cs_6_5
RWStructuredBuffer<float> outputBuffer;
@@ -40,4 +40,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
__bwd_diff(test_loop_with_continue)(dpa, 1.0f);
outputBuffer[1] = dpa.d; // Expect: 0.0131072
}
-}
+} \ No newline at end of file
diff --git a/tests/diagnostics/uninitialized-resource-type.slang b/tests/diagnostics/uninitialized-resource-type.slang
index 5763a1abd..4d5b8f5b3 100644
--- a/tests/diagnostics/uninitialized-resource-type.slang
+++ b/tests/diagnostics/uninitialized-resource-type.slang
@@ -1,5 +1,5 @@
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE: -target hlsl -DTEST_1
-//DISABLE_DIAGNOSTIC_TEST:SIMPLE: -target hlsl -DTEST_2
+//DIAGNOSTIC_TEST:SIMPLE: -target hlsl -DTEST_1
+//DIAGNOSTIC_TEST:SIMPLE: -target hlsl -DTEST_2
SamplerState sampler;