about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2023-11-16actually all the 'env' tests work on FreeBSD, as well as posix_memalignRalf Jung-1/+1
2023-11-16move reallocarray test into libc-miscRalf Jung-17/+18
2023-11-16make libc-misc pass under FreeBSDRalf Jung-1/+8
2023-11-16split thread test into synchronization primitives and threadnameRalf Jung-61/+52
2023-11-16Auto merge of #3166 - devnexen:reallocarray, r=RalfJungbors-1/+48
reallocarray shim linux/freebsd support proposal.
2023-11-16reallocarray shim linux/freebsd support proposal.David Carlier-1/+48
2023-11-16Auto merge of #3168 - RalfJung:set_var, r=RalfJungbors-5/+5
get rid of our last uses of set_var Fixes https://github.com/rust-lang/miri/issues/2783
2023-11-16get rid of our last uses of set_varRalf Jung-5/+5
2023-11-16Merge from rustcRalf Jung-29/+39
2023-11-16Preparing for merge from rustcRalf Jung-1/+1
2023-11-15Auto merge of #3164 - devnexen:fbsd_upd3, r=RalfJungbors-2/+20
freebsd adding getrandom interception. note that os support was added in same time as getentropy.
2023-11-15freebsd adding getrandom interception.David Carlier-2/+20
note that os support was added in same time as getentropy.
2023-11-15Auto merge of #117814 - RalfJung:rustc-logger-without-set-var, r=TaKO8Kibors-29/+39
rustc_log: provide a way to init logging based on the values, not names, of the env vars Miri wants to affect how rustc does logging. So far this required setting environment variables before calling `rustc_driver::init_rustc_env_logger`. However, `set_var` is a function one should really [avoid calling](https://github.com/rust-lang/rust/issues/90308), so this adds the necessary APIs to rustc such that Miri can just pass it the *values* of all the log-relevant environment variables, rather than having to change the global environment.
2023-11-15Merge from rustcThe Miri Conjob Bot-31/+31
2023-11-15Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-11-14Auto merge of #117330 - tmiasko:custom-mir-cleanup-blocks, r=cjgillotbors-31/+31
Custom MIR: Support cleanup blocks Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-14Custom MIR: Support cleanup blocksTomasz Miąsko-31/+31
Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-13don't expose all the borrow tracker stuff to the entire crateRalf Jung-41/+47
2023-11-13share getentropy shim across various unixesRalf Jung-36/+48
2023-11-13organize pass-dep tests more by the crate they testRalf Jung-14/+18
2023-11-13freebsd adding getentropy interception supportDavid Carlier-1/+29
2023-11-12Auto merge of #3159 - eduardosm:sse41-round, r=RalfJungbors-96/+372
Implement round.ps and round.pd SSE4.1 intrinsics I had forgotten them. I also increased the coverage of rounding tests to make sure the rounding direction is working as expected (e.g. test `1.25`, `1.5`, `1.75`...).
2023-11-12Improve SSE4.1 rounding tests coverageEduardo Sánchez Muñoz-137/+305
To make sure the rounding direction is working as expected
2023-11-12more consistent naming for TLS testsRalf Jung-10/+13
2023-11-12Auto merge of #2931 - max-heller:issue-2881, r=RalfJungbors-10/+148
Treat thread-local statics on main thread as static roots for leakage analysis Miri currently treats allocations as leaked if they're only referenced in thread-local statics. For threads other than the main thread, this is correct, since the thread can terminate before the program does, but references in the main thread's locals should be treated as living for the duration of the program since the thread lives for the duration of the program. This PR adds thread-local statics and TLS keys as "static roots" for leakage analysis, but does not yet bless the example program from #2881. See https://github.com/rust-lang/miri/issues/2881#issuecomment-1585666652 Closes #2881
2023-11-12allow allocations referenced by main thread TLS to leakmax-heller-10/+148
2023-11-12Implement roundps and roundpd SSE4.1 intrinsicsEduardo Sánchez Muñoz-16/+124
2023-11-12better error when calling pthread shims on unsupported unixesRalf Jung-0/+70
2023-11-12tweak commentsRalf Jung-9/+5
2023-11-12interpret: simplify handling of shifts by no longer trying to handle signed ↵Ralf Jung-0/+24
and unsigned shift amounts in the same branch
2023-11-12freebsd interceptions update proposalDavid Carlier-7/+45
2023-11-11Miri: use new init_logger function, avoid calling env::set_varRalf Jung-29/+39
2023-11-10data_race: link to docs for 'unusual' race conditionsRalf Jung-1/+8
2023-11-04Auto merge of #3145 - RalfJung:data-race-error, r=RalfJungbors-166/+233
give some more help for the unusual data races Fixes https://github.com/rust-lang/miri/issues/3142
2023-11-04fmtThe Miri Conjob Bot-7/+3
2023-11-04Merge from rustcThe Miri Conjob Bot-2/+2
2023-11-04Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-2/+2
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-11-02Merge from rustcThe Miri Conjob Bot-231/+11
2023-11-02Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-11-01Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomccMatthias Krüger-2/+2
Clean up unchecked_math, separate out unchecked_shifts Tracking issue: #85122 Changes: 1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised. 2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result. 3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO. The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-10-30make sure we catch UB with _ pattern in various syntactic positionsRalf Jung-16/+87
2023-10-29Auto merge of #116270 - cjgillot:gvn-aggregate, r=oli-obk,RalfJungbors-3/+2
See through aggregates in GVN This PR is extracted from https://github.com/rust-lang/rust/pull/111344 The first 2 commit are cleanups to avoid repeated work. I propose to stop removing useless assignments as part of this pass, and let a later `SimplifyLocals` do it. This makes tests easier to read (among others). The next 3 commits add a constant folding mechanism to the GVN pass, presented in https://github.com/rust-lang/rust/pull/116012. ~This pass is designed to only use global allocations, to avoid any risk of accidental modification of the stored state.~ The following commits implement opportunistic simplifications, in particular: - projections of aggregates: `MyStruct { x: a }.x` gets replaced by `a`, works with enums too; - projections of arrays: `[a, b][0]` becomes `a`; - projections of repeat expressions: `[a; N][x]` becomes `a`; - transform arrays of equal operands into a repeat rvalue. Fixes https://github.com/rust-lang/miri/issues/3090 r? `@oli-obk`
2023-10-28Remove asmjs from miriJubilee Young-1/+1
2023-10-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-226/+7
Bump stdarch submodule and remove special handling for LLVM intrinsics that are no longer needed Bumps stdarch to pull https://github.com/rust-lang/stdarch/pull/1477, which reimplemented some functions with portable SIMD intrinsics instead of arch specific LLVM intrinsics. Handling of those LLVM intrinsics is removed from cranelift codegen and miri. cc `@RalfJung` `@bjorn3`
2023-10-28Auto merge of #3149 - RalfJung:atomic-readonly-loads, r=RalfJungbors-62/+135
accept some atomic loads from read-only memory matches https://github.com/rust-lang/rust/pull/115577
2023-10-28accept some atomic loads from read-only memoryRalf Jung-48/+121
2023-10-28add some tests specifically for validity checks arising from match bindersRalf Jung-0/+59
2023-10-28consolidate and extend testing for _ patterns discarding the placeRalf Jung-31/+76
2023-10-28atomic_op → atomic_rmw_opRalf Jung-14/+14