[compiler-rt] [rtsan][test] Prevent test check from being optimized out in LTO builds (PR #122524)
Chris Apple via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 16:09:32 PST 2025
cjappl wrote:
> @cjappl I guess there's a question here about what's being sanitized: the source program vs the optimized binary. So of the goal of RTsan is to find source level issues, then perhaps it should prevent inlining or other types of optimizations on instrumented functions. If we only care about what makes it into the binary, then the current approach is probably fine, but these and other tests may need to use tricks like this more liberally. We should also probably consider adding a buildbot config that tests LTO'd runtimes once the libunwind CMake patches land.
CC @davidtrevelyan to make sure I'm correctly speaking for us.
IMO we are sanitizing the optimized binary. If a malloc exists in source, but then is optimized out, that binary should be safe to run and should not crash. The sister approach (performance constraints attributes) shines on the source side of things, so I think we should lean in to our strength of testing the final product.
https://github.com/llvm/llvm-project/pull/122524
More information about the llvm-commits
mailing list