[Clang][Driver][Test] No negative tests for unsupported options in different drivers
#119.190 aperta il 9 dic 2024
Metriche repository
- Star
- (26.378 star)
- Metriche merge PR
- (Merge medio 1g 2h) (1000 PR mergiate in 30 g)
Descrizione
Recently while exposing more options to the Fortran flang driver, some options were accidentally exposed to clang-cl and clang-dxc too. This was not caught by the test-suite because there are generally no tests to verify which options are not supported by specific drivers.
Exposing options accidentally might be a problem because configure scripts can it and change their behavior based on it. When an option is accidentally exposed it means there are no tests, and it might not even work or regress later without notice.
It should be possible to automatically generate a test that tests each unsupported option + driver flavor. Checking in the generated tests to version control would then allow for checking that only intended changes to option visibility is present during code-review.
From a high level look creating such a script should be fairly straightforward by parsing the tablegen json output of Options.td.