about summary refs log tree commit diff
path: root/tests/codegen/cffi
AgeCommit message (Collapse)AuthorLines
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-203/+0
2025-04-20stabilize `naked_functions`Folkert de Vries-1/+0
2025-04-19Make `#[naked]` an unsafe attributeFolkert de Vries-4/+2
2025-04-13error on unsafe attributes in pre-2024 editionsFolkert de Vries-2/+2
the `no_mangle`, `link_section` and `export_name` attributes are exceptions, and can still be used without an unsafe in earlier editions
2025-04-05Update the minimum external LLVM to 19Josh Stone-5/+2
2025-03-31PassWrapper: adapt for ↵Augie Fackler-1/+1
llvm/llvm-project@94122d58fc77079a291a3d008914006cb509d9db We also have to remove the LLVM argument in cast-target-abi.rs for LLVM 21. I'm not really sure what the best approach here is since that test already uses revisions. We could also fork the test into a copy for LLVM 19-20 and another for LLVM 21, but what I did for now was drop the lint-abort-on-error flag to LLVM figuring that some coverage was better than none, but I'm happy to change this if that was a bad direction. The above also applies for ffi-out-of-bounds-loads.rs. r? dianqk @rustbot label llvm-main
2025-02-24tests: use minicore moreDavid Wood-6/+3
minicore makes it much easier to add new language items to all of the existing `no_core` tests.
2024-10-06more `asm!` -> `naked_asm!` in testsFolkert de Vries-2/+1
2024-08-29Add `-Zlint-llvm-ir`DianQK-1/+2
2024-07-02Use the aligned size for alloca at args when the pass mode is cast.DianQK-2/+2
The `load` and `store` instructions in LLVM access the aligned size.
2024-06-19Remove c_unwind from tests and fix testsGary Guo-1/+0
2024-05-31Run rustfmt on `tests/codegen/`.Nicholas Nethercote-7/+16
Except for `simd-intrinsic/`, which has a lot of files containing multiple types like `u8x64` which really are better when hand-formatted. There is a surprising amount of two-space indenting in this directory. Non-trivial changes: - `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the test. - `rustfmt::skip` used in a few places where hand-formatting read more nicely: `enum/enum-match.rs` - Line number adjustments needed for the expected output of `debug-column.rs` and `coroutine-debug.rs`.
2024-04-24Auto merge of #122053 - erikdesjardins:alloca, r=nikicbors-1/+1
Stop using LLVM struct types for alloca The alloca type has no semantic meaning, only the size (and alignment, but we specify it explicitly) matter. Using `[N x i8]` is a more direct way to specify that we want `N` bytes, and avoids relying on LLVM's struct layout. It is likely that a future LLVM version will change to an untyped alloca representation. Split out from #121577. r? `@ghost`
2024-04-12Rollup merge of #123249 - goolmoos:naked_variadics, r=pnkfelixMatthias Krüger-0/+19
do not add prolog for variadic naked functions fixes #99858
2024-04-12do not add prolog for variadic naked functionsGuy Shefy-0/+19
fixes #99858
2024-04-11use [N x i8] for alloca typesErik Desjardins-1/+1
2024-03-17add tests for PassMode::Cast fixesErik Desjardins-6/+22
Tests added in cast-target-abi.rs, covering the single element, array, and prefix cases in `CastTarget::llvm_type`, and the Rust-is-larger/smaller cases in the Rust<->ABI copying code. ffi-out-of-bounds-loads.rs was overhauled to be runnable on any platform. Its alignment also increases due to the removal of a `min` in the previous commit; this was probably an insufficient workaround for this issue or similar. The higher alignment is fine, since the alloca is actually aligned to 8 bytes, as the test checks now confirm.
2024-03-06compiletest: Add a `//@ needs-threads` directiveAlex Crichton-1/+1
This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-8/+8
2024-01-30Remove `ffi_returns_twice` featureclubby789-11/+0
2023-07-29tests/codegen/c-variadic* -> cffi/c-variadic*Jubilee Young-0/+118
2023-07-29tests/codegen/ffi-* -> cffi/ffi-*Jubilee Young-0/+62