[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 10:18:34 PDT 2023


================
@@ -0,0 +1,11 @@
+// RUN: %clang -c %s -### 2>&1 | FileCheck -check-prefix T0 %s
----------------
delcypher wrote:

@nickdesaulniers As @rapidsna said there are multiple reasons:

1. Provides a very convenient way to run **only `-fbounds-safety` tests**.
2. More likely to avoid merge conflicts with our internal code.

Out of those two I think `(1.)` is the bigger problem because it is something I rely on for local development and I think merge conflicts are still unlikely even if we put tests under their proper location under `clang/test` because we mostly created new tests and tried not to touch existing tests. If `lit` had a way of labelling tests and only running tests with a particular label then the location of the tests would be irrelevant and I would be happy for the tests to live in their normal place under `clang/test/` (e.g. `clang/test/Driver`). Unfortunately AFAIK that feature doesn't exist in lit.

To workaround this would this kind of layout be acceptable?

```
test/Driver/BoundsSafety/...
test/Frontend/BoundsSafety/...
test/Sema/BoundsSafety/...
...
```

That way the tests are conforming to Clang's test layout but its still possible to run **only the -fbounds-safety** tests by doing something like:

```
$ bin/llvm-lit -vs tools/clang/test/{Driver,Frontend,Sema}/BoundsSafety
```



https://github.com/llvm/llvm-project/pull/70480


More information about the cfe-commits mailing list