diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-01-07 01:35:47 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-07 01:35:47 -0800 |
| commit | 5621ace93b7665051f7e7c8a2fa68ceaf285ff8d (patch) | |
| tree | 0aec6cedaeb888da9bd1cff617359a2775c63921 /tests | |
| parent | a448b7ecd880c4cbe1c0504af3df4ec708f42d48 (diff) | |
Use disassemble API from SPIRV-Tools (#6001)
* Use disassemble API from SPIRV-Tools
This commit uses C API version of SPIRV disassemble function rather than
calling spirv-dis.exe.
This allows us to use a correct version of SPIRV disassble function that
Slangc.exe is using.
The implementation is mostly copied from external/spirv-tools/tools/dis/dis.cpp, which is a source file for building spirv-dis.exe.
This commit also includes a fix for a bug in RPC communication to `test-server`.
When an RPC connection to `test-server.exe` is reused and the second
test abruptly fails due to a compile error or SPIRV validation error,
the output from the first test run was incorrectly reused as the output
for the second test.
This commit resets the RPC result before waiting for the response so
that even when the RPC connection is erratically disconnected, the
result from the previous run will not be reused incorrectly.
Some of the tests appear to be relying on this type of behavior. By
using an option, `-skip-spirv-validation`, the RPC connection will
continue without an interruption.
Diffstat (limited to 'tests')
4 files changed, 7 insertions, 7 deletions
diff --git a/tests/diagnostics/illegal-func-decl.slang b/tests/diagnostics/illegal-func-decl.slang index 0ec73dc27..64199a791 100644 --- a/tests/diagnostics/illegal-func-decl.slang +++ b/tests/diagnostics/illegal-func-decl.slang @@ -6,9 +6,9 @@ //TEST:COMPILE: tests/diagnostics/illegal-func-decl-module.slang -o tests/diagnostics/illegal-func-decl-module.slang-module //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK1): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST1 -target spirv -o illegal-func-decl.spv -//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK2): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST2 -target spirv -o illegal-func-decl.spv +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK2): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST2 -target spirv -o illegal-func-decl.spv -skip-spirv-validation //DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK3): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST3 -target spirv -o illegal-func-decl.spv -//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK4): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST4 -target spirv -o illegal-func-decl.spv +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK4): -r tests/diagnostics/illegal-func-decl-module.slang-module -DTEST4 -target spirv -o illegal-func-decl.spv -skip-spirv-validation #ifdef TEST1 // CHECK1: ([[# @LINE+1]]): error 45001: unresolved external symbol 'libraryFunction'. diff --git a/tests/language-feature/capability/capability3.slang b/tests/language-feature/capability/capability3.slang index 67099a1da..4091b9c93 100644 --- a/tests/language-feature/capability/capability3.slang +++ b/tests/language-feature/capability/capability3.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -entry main -stage compute -//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target spirv -emit-spirv-directly -entry main -stage compute -ignore-capabilities +//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target spirv -emit-spirv-directly -entry main -stage compute -ignore-capabilities -skip-spirv-validation // CHECK_IGNORE_CAPS-NOT: error 36108 // Test that capabilities can be declared on module. @@ -39,4 +39,4 @@ void main() { use1(); use2(); -}
\ No newline at end of file +} diff --git a/tests/language-feature/capability/capability7.slang b/tests/language-feature/capability/capability7.slang index 21f3d68e4..011112a34 100644 --- a/tests/language-feature/capability/capability7.slang +++ b/tests/language-feature/capability/capability7.slang @@ -1,5 +1,5 @@ //TEST:SIMPLE(filecheck=CHECK): -target glsl -entry computeMain -stage compute -profile sm_5_0 -//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target glsl -emit-spirv-directly -entry computeMain -stage compute -profile sm_5_0 -ignore-capabilities +//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target glsl -emit-spirv-directly -entry computeMain -stage compute -profile sm_5_0 -ignore-capabilities -skip-spirv-validation // Test that we diagnose simplified capabilities // CHECK_IGNORE_CAPS-NOT: error 36104 diff --git a/tests/language-feature/capability/conflicting-profile-stage-for-entry-point.slang b/tests/language-feature/capability/conflicting-profile-stage-for-entry-point.slang index 9cc06347f..a888e7cf9 100644 --- a/tests/language-feature/capability/conflicting-profile-stage-for-entry-point.slang +++ b/tests/language-feature/capability/conflicting-profile-stage-for-entry-point.slang @@ -3,7 +3,7 @@ //TEST:SIMPLE(filecheck=CHECK): -target spirv -entry vsmain -profile vs_6_0 //TEST:SIMPLE(filecheck=CHECK): -target spirv -entry psmain -profile vs_6_0 -ignore-capabilities -//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry vsmain -profile ps_6_0 -ignore-capabilities +//TEST:SIMPLE(filecheck=CHECK): -target spirv -entry vsmain -profile ps_6_0 -ignore-capabilities -skip-spirv-validation // CHECK_ERROR: warning 36112 // CHECK-NOT: warning 36112 @@ -33,4 +33,4 @@ VSOutput vsmain(float3 PositionOS : POSITION, float3 Color : COLOR0) float4 psmain(VSOutput input) : SV_TARGET { return float4(input.Color, 1); -}
\ No newline at end of file +} |
