summary refs log tree commit diff
path: root/tests/codegen/dst-offset.rs
AgeCommit message (Collapse)AuthorLines
2024-03-10use ptradd for vtable indexingErik Desjardins-2/+2
Like field offsets, these are always constant.
2024-03-06add test for extern typeErik Desjardins-0/+15
2024-03-04use GEP inbounds for ZST and DST field offsetsErik Desjardins-0/+69
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.