ispc-lit-tests
Best practices for creating ISPC lit tests. Use when writing regression tests, verifying code generation, or checking compiler diagnostics.
Security Assessment
About ispc-lit-tests
The 'ispc-lit-tests' skill provides best practices for creating lit tests for ISPC (Intel SPMD Program Compiler), ensuring the accuracy and consistency of the compiler's behavior, diagnostics, and code generation. It primarily focuses on facilitating the process of validating compiler output, such as LLVM IR, assembly, and AST, as well as verifying diagnostic messages like warnings and errors. By following this skill, developers can ensure the integrity of their ISPC code and prevent regressions in future compiler versions.
FAQ
When should I use lit tests in ISPC?
Use lit tests when validating compiler output, diagnostics, platform behavior, and regression coverage. They are essential when ensuring compiler correctness and verifying code generation or diagnostics.
What are the requirements for running ISPC lit tests?
ISPC lit tests require the use of specific flags like '--nowrap' for consistent output and '--nostdlib' when not testing library code. Also, the 'REQUIRES' directive is used to handle feature dependencies in target-specific tests.
Can I test platform-specific code using lit tests?
Yes, you can test platform-specific code by specifying the exact target and feature with the '--target' option, including conditional execution using 'REQUIRES' directives for features like 'X86_ENABLED'.
Are there any guidelines for writing portable tests?
When writing portable tests, avoid hardcoding vector widths or variable names. Instead, use named patterns like '[[WIDTH]]' and '[[TYPE]]' to ensure cross-platform compatibility.
What is the recommended format for writing test comments?
Test comments should clearly describe what the test verifies and why it exists. For example, a test might verify that certain intrinsics correctly set or restore flags when specific compiler options are enabled.
Install ispc-lit-tests
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
ispc/ispc