about summary refs log tree commit diff
path: root/tests/codegen/sanitizer/kcfi
AgeCommit message (Collapse)AuthorLines
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-496/+0
2025-07-16add `codegen_instance_attrs` queryFolkert de Vries-6/+6
and use it for naked functions
2025-07-16fix `-Zsanitizer=kcfi` on `#[naked]` functionsFolkert de Vries-0/+47
And more broadly only codegen `InstanceKind::Item` using the naked function codegen code. Other instance kinds should follow the normal path.
2025-04-05KCFI: Add KCFI arity indicator supportRamon de C Valle-0/+19
Adds KCFI arity indicator support to the Rust compiler (see rust-lang/rust#138311, https://github.com/llvm/llvm-project/pull/121070, and https://lore.kernel.org/lkml/CANiq72=3ghFxy8E=AU9p+0imFxKr5iU3sd0hVUXed5BA+KjdNQ@mail.gmail.com/).
2025-02-24tests: use minicore moreDavid Wood-71/+30
minicore makes it much easier to add new language items to all of the existing `no_core` tests.
2024-10-22Rename Receiver -> LegacyReceiverAdrian Taylor-2/+2
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
2024-08-21Add missing module flags for CFI and KCFI sanitizersSami Tolvanen-0/+42
Set the cfi-normalize-integers and kcfi-offset module flags when Control-Flow Integrity sanitizers are used, so functions generated by the LLVM backend use the same CFI/KCFI options as rustc. cfi-normalize-integers tells LLVM to also use integer normalization for generated functions when -Zsanitizer-cfi-normalize-integers is used. kcfi-offset specifies the number of prefix nops between the KCFI type hash and the function entry when -Z patchable-function-entry is used. Note that LLVM assumes all indirectly callable functions use the same number of prefix NOPs with -Zsanitizer=kcfi.
2024-07-25Let InstCombine remove Clone shims inside Clone shimsBen Kimock-0/+1
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-05-31Run rustfmt on `tests/codegen/`.Nicholas Nethercote-62/+59
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-03-27CFI: Fix drop and drop_in_placeRamon de C Valle-0/+2
Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into Drop trait objects.
2024-03-14CFI: Break tests into smaller filesRamon de C Valle-0/+429
Break type metadata identifiers tests into smaller set of tests/files, and move CFI (and KCFI) codegen tests to a cfi (and kcfi) subdirectory.