about summary refs log tree commit diff
path: root/tests/run-make/extern-fn-explicit-align
AgeCommit message (Collapse)AuthorLines
2023-07-14extern-fn-explicit-align test: remove unnecessary derivesErik Desjardins-5/+0
2023-07-13extern fn-explicit-align test: don't use uint128_tErik Desjardins-3/+6
...which seems not to be available on some platforms. Or maybe it is under a different name but I don't want to deal with that Instead, use two u64s. This isn't exactly the same, but we already have some coverage of the packed u128 case in another test, so it's not essential to have it here.
2023-07-10aarch64-linux: properly handle 128bit aligned aggregatesErik Desjardins-4/+25
2023-07-10extern-fn-explicit-align test: add wrapped and lower requested alignment, ↵Erik Desjardins-14/+70
improve assertions
2023-07-10extern-fn-explicit-align test: cleanupErik Desjardins-4/+6
2023-07-10extern-fn-explicit-align test: add MSVC compatible alignment attributeErik Desjardins-1/+10
2023-07-10extern-fn-explicit-align test: use ffi::c_char instead of i8Erik Desjardins-3/+3
2023-07-10add ignore-cross-compile to run-make/extern-fn-explicit-alignErik Desjardins-0/+1
From the test logs, other extern-fn-* tests have this: [run-make] tests/run-make/extern-fn-with-packed-struct ... ignored, ignored when cross-compiling [run-make] tests/run-make/extern-fn-with-union ... ignored, ignored when cross-compiling [run-make] tests/run-make/extern-multiple-copies ... ignored, ignored when cross-compiling [run-make] tests/run-make/extern-multiple-copies2 ... ignored, ignored when cross-compiling [run-make] tests/run-make/extern-overrides-distribution ... ignored, ignored when cross-compiling [run-make] tests/run-make/extra-filename-with-temp-outputs ... ignored, ignored when cross-compiling [run-make] tests/run-make/extern-fn-explicit-align ... FAILED
2023-07-10rustc_target: Add alignment to indirectly-passed by-value types, correcting thePatrick Walton-0/+101
alignment of `byval` on x86 in the process. Commit 88e4d2c2918428d55e34cd57c11279ea839c8822 from five years ago removed support for alignment on indirectly-passed arguments because of problems with the `i686-pc-windows-msvc` target. Unfortunately, the `memcpy` optimizations I recently added to LLVM 16 depend on this to forward `memcpy`s. This commit attempts to fix the problems with `byval` parameters on that target and now correctly adds the `align` attribute. The problem is summarized in [this comment] by @eddyb. Briefly, 32-bit x86 has special alignment rules for `byval` parameters: for the most part, their alignment is forced to 4. This is not well-documented anywhere but in the Clang source. I looked at the logic in Clang `TargetInfo.cpp` and tried to replicate it here. The relevant methods in that file are `X86_32ABIInfo::getIndirectResult()` and `X86_32ABIInfo::getTypeStackAlignInBytes()`. The `align` parameter attribute for `byval` parameters in LLVM must match the platform ABI, or miscompilations will occur. Note that this doesn't use the approach suggested by eddyb, because I felt it was overkill to store the alignment in `on_stack` when special handling is really only needed for 32-bit x86. As a side effect, this should fix #80127, because it will make the `align` parameter attribute for `byval` parameters match the platform ABI on LLVM x86-64. [this comment]: https://github.com/rust-lang/rust/pull/80822#issuecomment-829985417