about summary refs log tree commit diff
path: root/tests/codegen/zst-offset.rs
AgeCommit message (Collapse)AuthorLines
2024-03-04use GEP inbounds for ZST and DST field offsetsErik Desjardins-3/+3
For the former, it's fine for `inbounds` offsets to be one-past-the-end, so it's okay even if the ZST is the last field in the layout: > The base pointer has an in bounds address of an allocated object, > which means that it points into an allocated object, or to its end. https://llvm.org/docs/LangRef.html#getelementptr-instruction For the latter, even DST fields must always be inside the layout (or to its end for ZSTs), so using inbounds is also fine there.
2024-02-27use non-inbounds GEP for ZSTs, add fixmesErik Desjardins-3/+3
2024-02-26always use gep inbounds i8 (ptradd) for field offsetsErik Desjardins-2/+2
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-01-02Address review commentsNikita Popov-1/+1
2023-01-17Add more codegen testsNilstrieb-2/+2
2023-01-17Put `noundef` on all scalars that don't allow uninitNilstrieb-1/+1
Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. This function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec. This is hopefully rare enough to not break anything.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+43