[Clang][Driver][Test] No negative tests for unsupported options in different drivers
#119,190 创建于 2024年12月9日
仓库指标
- Star
- (26,378 star)
- PR 合并指标
- (平均合并 1天 2小时) (30 天内合并 1,000 个 PR)
描述
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.