[llvm-branch-commits] [clang] [LifetimeSafety] Add loan expiry analysis (PR #148712)
Utkarsh Saxena via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jul 16 05:59:37 PDT 2025
usx95 wrote:
> Looks good, but what's the plan for tests?
Good question :) I think adding tests for each analyses to the current [llvm-lit tests](https://github.com/llvm/llvm-project/blob/main/clang/test/Sema/warn-lifetime-safety-dataflow.cpp) is quite a pain for the eyes at this point. Also I want to test things at specific program points (is loan expired here, does origin contain loan here, etc). I am exploring a couple of options, primarily https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Testing/TestAST.h, https://github.com/llvm/llvm-project/blob/main/clang/unittests/Analysis/FlowSensitive/TestingSupport.h and something like https://github.com/llvm/llvm-project/blob/main/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp#L874-L900
This will likely take some more time. Happy to hold this off until I add something like this for unit tests!
I would still rely on llvm-lit tests for final diagnostic reporting (or maybe that also can be done through unit testing)
https://github.com/llvm/llvm-project/pull/148712
More information about the llvm-branch-commits
mailing list