about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/intrinsics
AgeCommit message (Collapse)AuthorLines
2025-09-03Add `funnel_sh{l,r}` functions and intrinsicssayantn-0/+44
- Add a fallback implementation for the intrinsics - Add LLVM backend support for funnel shifts Co-Authored-By: folkertdev <folkert@folkertdev.nl>
2025-07-18Show the memory of uninit readsOli Scherer-17/+20
2025-07-17Report the range of uninit bytes in CTFE errorsOli Scherer-6/+21
2025-07-09miri: fix out-of-bounds error for ptrs with negative offsetsRalf Jung-0/+26
2025-07-02miri: improve errors for type validity assertion failuresRalf Jung-55/+16
2025-06-07diagnostics: do not repeat the entire message in the span labelRalf Jung-86/+86
2025-05-20make std::intrinsic functions actually be intrinsicsRalf Jung-16/+10
2025-05-15normalize abort calls in miri testsjoboet-4/+4
2025-05-02Rollup merge of #140521 - RalfJung:oob-error, r=saethlinMatthias Krüger-19/+19
interpret: better error message for out-of-bounds pointer arithmetic and accesses Fixes https://github.com/rust-lang/rust/issues/93881 r? `@saethlin`
2025-05-01Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=workingjubileeGuillaume Gomez-30/+0
simd_select_bitmask: the 'padding' bits in the mask are just ignored Fixes https://github.com/rust-lang/rust/issues/137942: we documented simd_select_bitmask to require the 'padding' bits in the mask (the mask can sometimes be longer than the vector; I am referring to these extra bits as 'padding' here) to be zero, mostly because nobody felt like doing the research for what should be done when they are non-zero. However, codegen is already perfectly happy just ignoring them, so in practice they can have any value. Some of the intrinsic wrappers in stdarch have trouble ensuring that they are zero. So let's just adjust the docs and Miri to permit non-zero 'padding' bits. Cc ````@Amanieu```` ````@workingjubilee````
2025-04-30interpret: better error message for out-of-bounds pointer arithmetic and ↵Ralf Jung-19/+19
accesses
2025-04-19simd_select_bitmask: the 'padding' bits in the mask are just ignoredRalf Jung-30/+0
2025-04-16use std-declared intrinsics rather than copying the declarationRalf Jung-106/+50
2025-03-12intrinsics: remove unnecessary leading underscore from argument namesRalf Jung-27/+27
2025-02-23rename sub_ptr 😅bendn-3/+3
2025-02-17stabilize (const_)ptr_sub_ptrbendn-2/+0
2025-02-04Auto merge of #135760 - scottmcm:disjoint-bitor, r=WaffleLapkinbors-0/+20
Add `unchecked_disjoint_bitor` per ACP373 Following the names from libs-api in https://github.com/rust-lang/libs-team/issues/373#issuecomment-2085686057 Includes a fallback implementation so this doesn't have to update cg_clif or cg_gcc, and overrides it in cg_llvm to use `or disjoint`, which [is available in LLVM 18](https://releases.llvm.org/18.1.0/docs/LangRef.html#or-instruction) so hopefully we don't need any version checks.
2025-02-02miri: improve error when offset_from preconditions are violatedRalf Jung-3/+45
2025-01-31PR feedbackScott McMurray-0/+20
2025-01-23fmtThe Miri Cronjob Bot-3/+0
2025-01-20Updated several files to use rust intrinsic macros instead of the legacy ↵vayunbiyani-81/+57
extern "rust-intrinsic" blocks
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-0/+2
2024-12-30fmtRalf Jung-2/+2
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-12-25swap_typed_nonoverlapping: properly detect overlap even when swapping scalar ↵Ralf Jung-3/+25
values
2024-12-25rename typed_swap → typed_swap_nonoverlappingRalf Jung-12/+12
2024-12-25miri: add test for overlapping typed_swapRalf Jung-0/+28
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-1/+0
2024-09-17ptr_offset_unsigned_overflow: extend testRalf Jung-5/+6
2024-09-16Bump ui testOli Scherer-171/+166
2024-09-11miri: fix overflow detection for unsigned pointer offsetRalf Jung-0/+22
2024-09-09Update the MIRI testsScott McMurray-21/+21
2024-08-29fix wasm testRalf Jung-1/+1
2024-08-24panicking: improve hint for Miri's RUST_BACKTRACE behaviorRalf Jung-2/+2
2024-08-07remove some SSE/SSE2 intrinsics that are no longer used by stdarchRalf Jung-3/+3
2024-08-02Rollup merge of #128453 - RalfJung:raw_eq, r=saethlinMatthias Krüger-25/+0
raw_eq: using it on bytes with provenance is not UB (outside const-eval) The current behavior of raw_eq violates provenance monotonicity. See https://github.com/rust-lang/rust/pull/124921 for an explanation of provenance monotonicity. It is violated in raw_eq because comparing bytes without provenance is well-defined, but adding provenance makes the operation UB. So remove the no-provenance requirement from raw_eq. However, the requirement stays in-place for compile-time invocations of raw_eq, that indeed cannot deal with provenance. Cc `@rust-lang/opsem`
2024-08-01interpret: simplify pointer arithmetic logicRalf Jung-36/+22
2024-08-01on a signed deref check, mention the right pointer in the errorRalf Jung-7/+7
2024-07-31raw_eq: using it on bytes with provenance is not UB (outside const-eval)Ralf Jung-25/+0
2024-07-29Rollup merge of #128333 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-5/+5
Miri subtree update r? `@ghost`
2024-07-27improve dangling/oob errors and make them more uniformRalf Jung-18/+20
2024-07-27miri: fix offset_from behavior on wildcard pointersRalf Jung-6/+7
2024-07-24show warning when Stacked Borrows skips a reborrow due to 'extern type'Ralf Jung-5/+5
2024-06-17Auto merge of #3683 - RalfJung:MIRIFLAGS, r=RalfJungbors-4/+3
tell people how to set miri flags fixes https://github.com/rust-lang/miri/issues/3677
2024-06-17tell people how to set miri flagsRalf Jung-4/+3
2024-06-16std: move `sys_common::backtrace` to `sys`joboet-2/+2
2024-06-03Reformat `mir!` macro invocations to use braces.Nicholas Nethercote-18/+24
The `mir!` macro has multiple parts: - An optional return type annotation. - A sequence of zero or more local declarations. - A mandatory starting anonymous basic block, which is brace-delimited. - A sequence of zero of more additional named basic blocks. Some `mir!` invocations use braces with a "block" style, like so: ``` mir! { let _unit: (); { let non_copy = S(42); let ptr = std::ptr::addr_of_mut!(non_copy); // Inside `callee`, the first argument and `*ptr` are basically // aliasing places! Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { Return() } } ``` Some invocations use parens with a "block" style, like so: ``` mir!( let x: [i32; 2]; let one: i32; { x = [42, 43]; one = 1; x = [one, 2]; RET = Move(x); Return() } ) ``` And some invocations uses parens with a "tighter" style, like so: ``` mir!({ SetDiscriminant(*b, 0); Return() }) ``` This last style is generally used for cases where just the mandatory starting basic block is present. Its braces are placed next to the parens. This commit changes all `mir!` invocations to use braces with a "block" style. Why? - Consistency is good. - The contents of the invocation is a block of code, so it's odd to use parens. They are more normally used for function-like macros. - Most importantly, the next commit will enable rustfmt for `tests/mir-opt/`. rustfmt is more aggressive about formatting macros that use parens than macros that use braces. Without this commit's changes, rustfmt would break a couple of `mir!` macro invocations that use braces within `tests/mir-opt` by inserting an extraneous comma. E.g.: ``` mir!(type RET = (i32, bool);, { // extraneous comma after ';' RET.0 = 1; RET.1 = true; Return() }) ``` Switching those `mir!` invocations to use braces avoids that problem, resulting in this, which is nicer to read as well as being valid syntax: ``` mir! { type RET = (i32, bool); { RET.0 = 1; RET.1 = true; Return() } } ```
2024-05-28Add Miri tests for `PtrMetadata` UBScott McMurray-0/+142
2024-05-23Auto merge of #125359 - RalfJung:interpret-overflowing-ops, r=oli-obkbors-24/+24
interpret: make overflowing binops just normal binops Follow-up to https://github.com/rust-lang/rust/pull/125173 (Cc `@scottmcm)`
2024-05-21interpret: make overflowing binops just normal binopsRalf Jung-24/+24
2024-05-13offset, offset_from: allow zero-byte offset on arbitrary pointersRalf Jung-128/+0