about summary refs log tree commit diff
path: root/tests/codegen/sanitizer
AgeCommit message (Collapse)AuthorLines
2024-04-24Fix tests and blessGary Guo-1/+1
2024-04-06Rollup merge of #123525 - maurer:no-id-dyn2, r=compiler-errorsMatthias Krüger-21/+21
CFI: Don't rewrite ty::Dynamic directly Now that we're using a type folder, the arguments in predicates are processed automatically - we don't need to descend manually. We also want to keep projection clauses around, and this does so. r? `@compiler-errors`
2024-04-05CFI: Don't rewrite ty::Dynamic directlyMatthew Maurer-21/+21
Now that we're using a type folder, the arguments in predicates are processed automatically - we don't need to descend manually. We also want to keep projection clauses around, and this does so.
2024-04-04CFI: Restore typeid_for_instance default behaviorRamon de C Valle-2/+2
Restore typeid_for_instance default behavior of performing self type erasure, since it's the most common case and what it does most of the time. Using concrete self (or not performing self type erasure) is for assigning a secondary type id, and secondary type ids are only assigned when they're unique and to methods, and also are only tested for when methods are used as function pointers.
2024-04-02CFI: Switch sense of type erasure flagMatthew Maurer-2/+2
Previously, we had `NO_SELF_TYPE_ERASURE`, a negative configuration. Now we have `ERASE_SELF_TYPE`, a positive configuration.
2024-03-29Auto merge of #123071 - rcvalle:rust-cfi-fix-method-fn-ptr-cast, ↵bors-0/+22
r=compiler-errors CFI: Fix methods as function pointer cast Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers. This was split off from #116404. cc `@compiler-errors` `@workingjubilee`
2024-03-27CFI: Fix methods as function pointer castRamon de C Valle-0/+22
Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers.
2024-03-27CFI: Fix drop and drop_in_placeRamon de C Valle-0/+29
Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into Drop trait objects.
2024-03-22CFI: Support self_cell-like recursionMatthew Maurer-0/+16
Current `transform_ty` attempts to avoid cycles when normalizing `#[repr(transparent)]` types to their interior, but runs afoul of this pattern used in `self_cell`: ``` struct X<T> { x: u8, p: PhantomData<T>, } #[repr(transparent)] struct Y(X<Y>); ``` When attempting to normalize Y, it will still cycle indefinitely. By using a types-visited list, this will instead get expanded exactly one layer deep to X<Y>, and then stop, not attempting to normalize `Y` any further.
2024-03-21CFI: Skip non-passed argumentsMatthew Maurer-32/+32
Rust will occasionally rely on fn((), X) -> Y being compatible with fn(X) -> Y, since () is a non-passed argument. Relax CFI by choosing not to encode non-passed arguments.
2024-03-14CFI: Break tests into smaller filesRamon de C Valle-606/+759
Break type metadata identifiers tests into smaller set of tests/files, and move CFI (and KCFI) codegen tests to a cfi (and kcfi) subdirectory.
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+10
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-02-27CFI: Don't compress user-defined builtin typesRamon de C Valle-0/+25
Doesn't compress user-defined builtin types (see https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin and https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-compression).
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-123/+123
2023-12-07CFI: Add char to CFI integer normalizationRamon de C Valle-57/+20
Adds char to CFI integer normalization to conform to #118032 for cross-language CFI support.
2023-11-21Update the minimum external LLVM to 16.Dario Nieuwenhuis-2/+0
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-8/+8
2023-09-22Fix test on targets with crt-static defaultTomasz Miąsko-10/+14
2023-09-11Use no_core for KCFI tests to exercise them in CITomasz Miąsko-1/+12
2023-08-29Preserve `___asan_globals_registered` symbol during LTO.Lukasz Anforowicz-0/+43
Fixes https://github.com/rust-lang/rust/issues/113404
2023-08-24Fix CFI: f32 and f64 are encoded incorrectly for cRamon de C Valle-6/+6
Fix #115150 by encoding f32 and f64 correctly for cross-language CFI. I missed changing the encoding for f32 and f64 when I introduced the integer normalization option in #105452 as integer normalization does not include floating point. `f32` and `f64` should be always encoded as `f` and `d` since they are both FFI safe when their representation are the same (i.e., IEEE 754) for both the Rust compiler and Clang.
2023-07-29Fix sanitizer tests depending on filenameJubilee Young-54/+54
In the basic case, simply do the string substitution. For one case with many instances, capture the Itanium- mangled filename and assert its reuse instead.
2023-07-29tests/codegen/sanitizer{-,_}* -> sanitizer/*Jubilee Young-0/+1756