Skip to content

[BoundsSafety] Fix update_cc_test_checks.py to correctly regenerate CodeGen tests #10627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025

Conversation

delcypher
Copy link

When rdar://148623233 (#10619) landed the BoundsSafety test directories now have compiler flags implicitly passed when using the %clang_cc1 substitution. This is done using the lit.local.cfg.py files under clang/test/BoundsSafety and clang/test/BoundsSafety-legacy-checks.

However, the update_cc_test_checks.py script doesn't know anything about the llvm-lit configuration. Instead, it hardcodes what %clang_cc1 expands to. This can cause problems when using the script because the script invokes clang differently to how llvm-lit will do it.

To avoid these problems the following changes are made

  • Tests under clang/test/BoundsSafety have -fbounds-safety-bringup-missing-checks=batch_0 implicitly passed
  • Tests under clang/test/BoundsSafety-legacy-checks have -fno-bounds-safety-bringup-missing-checks=all passed

We can remove this entirely once support for the legacy bounds safety checks are removed.

rdar://150800853

… CodeGen tests

When rdar://148623233 (swiftlang#10619) landed the BoundsSafety test directories
now have compiler flags implicitly passed when using the `%clang_cc1`
substitution. This is done using the `lit.local.cfg.py` files under
`clang/test/BoundsSafety` and `clang/test/BoundsSafety-legacy-checks`.

However, the `update_cc_test_checks.py` script doesn't know anything
about the `llvm-lit` configuration. Instead, it hardcodes what `%clang_cc1`
expands to. This can cause problems when using the script because the
script invokes clang differently to how `llvm-lit` will do it.

To avoid these problems the following changes are made

* Tests under `clang/test/BoundsSafety` have
  `-fbounds-safety-bringup-missing-checks=batch_0` implicitly passed
* Tests under `clang/test/BoundsSafety-legacy-checks` have
  `-fno-bounds-safety-bringup-missing-checks=all` passed

We can remove this entirely once support for the legacy bounds safety
checks are removed.

rdar://150800853
@delcypher delcypher self-assigned this May 6, 2025
@delcypher delcypher added the clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang label May 6, 2025
@delcypher delcypher merged commit 90007d9 into swiftlang:next May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang
1 participant