summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-27 13:21:20 -0800
committerGitHub <noreply@github.com>2025-02-27 13:21:20 -0800
commit90b3817498d9cf664346f04dcea71f48ce81993e (patch)
treec5efa3424b9dff520e090e98c245a8b518c0b51e /tests
parent6cf15f4ea1fe044d8227440dcc30ac712334568e (diff)
Make capability diagnostic message more friendly. (#6474)
* Make capability diagnostic message more friendly. * Fix. * Fix. * Fix. * Fix test. * Update expected fail setting for aarch64/linux * Fix.
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics/discard-in-rt.slang24
-rw-r--r--tests/language-feature/capability/capabilitySimplification1.slang2
-rw-r--r--tests/language-feature/capability/capabilitySimplification3.slang2
-rw-r--r--tests/language-feature/capability/explicit-shader-stage-2.slang2
4 files changed, 27 insertions, 3 deletions
diff --git a/tests/diagnostics/discard-in-rt.slang b/tests/diagnostics/discard-in-rt.slang
new file mode 100644
index 000000000..93c3d1038
--- /dev/null
+++ b/tests/diagnostics/discard-in-rt.slang
@@ -0,0 +1,24 @@
+//TEST:SIMPLE(filecheck=CHECK): -target spirv
+
+// CHECK: 'closestHit' uses features that are not available in 'closesthit' stage.
+// CHECK: see using of 'discard'
+
+struct PrimaryRayPayload{}
+[require(spvRayTracingKHR)]
+[shader("closesthit")]
+void closestHit(
+ inout PrimaryRayPayload rayData : SV_RayPayload,
+ BuiltInTriangleIntersectionAttributes attribs : SV_IntersectionAttributes)
+{
+ discard;
+}
+
+// CHECK: 'closestHit1' uses features that are not available in 'closesthit' stage
+// CHECK: see using of 'discard'
+[shader("closesthit")]
+void closestHit1(
+ inout PrimaryRayPayload rayData : SV_RayPayload,
+ BuiltInTriangleIntersectionAttributes attribs : SV_IntersectionAttributes)
+{
+ discard;
+}
diff --git a/tests/language-feature/capability/capabilitySimplification1.slang b/tests/language-feature/capability/capabilitySimplification1.slang
index 1d781a45e..440ac1ced 100644
--- a/tests/language-feature/capability/capabilitySimplification1.slang
+++ b/tests/language-feature/capability/capabilitySimplification1.slang
@@ -5,7 +5,7 @@
// CHECK_IGNORE_CAPS-NOT: error 36107
// CHECK: error 36107
-// CHECK-SAME: entrypoint 'computeMain' does not support compilation target 'glsl' with stage 'compute'
+// CHECK-SAME: entrypoint 'computeMain' uses features that are not available in 'compute' stage for 'glsl' target.
// CHECK: capabilitySimplification1.slang(21): note: see using of 'WaveMultiPrefixCountBits'
// CHECK-NOT: see using of 'WaveMultiPrefixCountBits'
// CHECK: {{.*}}.meta.slang({{.*}}): note: see definition of 'WaveMultiPrefixCountBits'
diff --git a/tests/language-feature/capability/capabilitySimplification3.slang b/tests/language-feature/capability/capabilitySimplification3.slang
index 808c19bf6..150f926a9 100644
--- a/tests/language-feature/capability/capabilitySimplification3.slang
+++ b/tests/language-feature/capability/capabilitySimplification3.slang
@@ -4,7 +4,7 @@
// CHECK_IGNORE_CAPS-NOT: error 36107
-// CHECK: error 36107: entrypoint 'computeMain' does not support compilation target 'glsl' with stage 'compute'
+// CHECK: error 36107: entrypoint 'computeMain' uses features that are not available in 'compute' stage for 'glsl' target.
// CHECK: capabilitySimplification3.slang(16): note: see using of 'WaveMultiPrefixCountBits'
// CHECK-NOT: see using of 'WaveMultiPrefixCountBits'
// CHECK: {{.*}}.meta.slang({{.*}}): note: see definition of 'WaveMultiPrefixCountBits'
diff --git a/tests/language-feature/capability/explicit-shader-stage-2.slang b/tests/language-feature/capability/explicit-shader-stage-2.slang
index b4c6d3cfe..a01cff7c2 100644
--- a/tests/language-feature/capability/explicit-shader-stage-2.slang
+++ b/tests/language-feature/capability/explicit-shader-stage-2.slang
@@ -1,7 +1,7 @@
//TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry main -allow-glsl -profile sm_5_0
//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target hlsl -entry main -allow-glsl -profile sm_5_0 -ignore-capabilities
-//CHECK: error 36107: entrypoint 'main' does not support compilation target 'hlsl' with stage 'fragment'
+//CHECK: error 36107: entrypoint 'main' uses features that are not available in 'fragment' stage for 'hlsl' target.
//CHECK_IGNORE_CAPS-NOT: error 36100
[shader("fragment")]
float4 main()