about summary refs log tree commit diff
path: root/tests/codegen/transmute-scalar.rs
AgeCommit message (Collapse)AuthorLines
2023-07-27Update the minimum external LLVM to 15Josh Stone-1/+0
2023-07-08Always name the return place.Camille GILLOT-10/+10
2023-04-13`assume` value ranges in `transmute`Scott McMurray-7/+7
Fixes #109958
2023-04-04Allow `transmute`s to produce `OperandValue`s instead of always using `alloca`sScott McMurray-27/+17
LLVM can usually optimize these away, but especially for things like transmutes of newtypes it's silly to generate the `alloc`+`store`+`load` at all when it's actually a nop at LLVM level.
2023-03-22Add `CastKind::Transmute` to MIRScott McMurray-27/+14
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic. Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-01-17Put `noundef` on all scalars that don't allow uninitNilstrieb-5/+5
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/+81