about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2023-11-12Auto merge of #3159 - eduardosm:sse41-round, r=RalfJungbors-80/+308
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-0/+119
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-0/+119
2023-11-12Implement roundps and roundpd SSE4.1 intrinsicsEduardo Sánchez Muñoz-0/+60
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-3/+31
2023-11-10data_race: link to docs for 'unusual' race conditionsRalf Jung-0/+6
2023-11-04Auto merge of #3145 - RalfJung:data-race-error, r=RalfJungbors-106/+112
give some more help for the unusual data races Fixes https://github.com/rust-lang/miri/issues/3142
2023-11-02Merge from rustcThe Miri Conjob Bot-11/+10
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-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-6/+6
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-31/+74
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-31/+74
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-28fmtThe Miri Conjob Bot-1/+0
2023-10-27Auto merge of #103208 - cjgillot:match-fake-read, r=oli-obk,RalfJungbors-0/+89
Allow partially moved values in match This PR attempts to unify the behaviour between `let _ = PLACE`, `let _: TY = PLACE;` and `match PLACE { _ => {} }`. The logical conclusion is that the `match` version should not check for uninitialised places nor check that borrows are still live. The `match PLACE {}` case is handled by keeping a `FakeRead` in the unreachable fallback case to verify that `PLACE` has a legal value. Schematically, `match PLACE { arms }` in surface rust becomes in MIR: ```rust PlaceMention(PLACE) match PLACE { // Decision tree for the explicit arms arms, // An extra fallback arm _ => { FakeRead(ForMatchedPlace, PLACE); unreachable } } ``` `match *borrow { _ => {} }` continues to check that `*borrow` is live, but does not read the value. `match *borrow {}` both checks that `*borrow` is live, and fake-reads the value. Continuation of ~https://github.com/rust-lang/rust/pull/102256~ ~https://github.com/rust-lang/rust/pull/104844~ Fixes https://github.com/rust-lang/rust/issues/99180 https://github.com/rust-lang/rust/issues/53114
2023-10-27give some more help for the unusual data racesRalf Jung-12/+18
2023-10-27data-race: preserve structured access information longer, and don't ↵Ralf Jung-104/+104
upper-case access types
2023-10-25Stabilize `[const_]pointer_byte_offsets`Maybe Waffle-5/+0
2023-10-25Typo.Camille GILLOT-1/+1
2023-10-25Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJungbors-1/+1
Automatic Rustup
2023-10-25CLOCK_UPTIME_RAW exists on all macos targets, not just the ARM onesRalf Jung-1/+1
2023-10-25Do not merge fn pointer casts.Camille GILLOT-3/+2
2023-10-25add some more gamma function testsRalf Jung-3/+2
2023-10-24Test match underscore on void from union.Camille GILLOT-0/+18
2023-10-24Add miri test matching on `!`.Camille GILLOT-0/+25
2023-10-24Add miri tests.Camille GILLOT-0/+46
2023-10-24Auto merge of #3137 - RalfJung:data-race, r=oli-obkbors-65/+239
Detect mixed-size and mixed-atomicity non-synchronized accesses Fixes https://github.com/rust-lang/miri/issues/2303
2023-10-24futex text: avoid spurious non-atomic readsRalf Jung-13/+13
2023-10-24fix error read-read reporting when there's also an unsynchronized non-atomic ↵Ralf Jung-0/+28
read (which is fine)
2023-10-23don't talk about 'Data race' when both accesses are atomicRalf Jung-10/+10
2023-10-23clean up imperfect overlap detection in weak-mem emulationRalf Jung-12/+24
2023-10-23detect mixed-size atomic accessesRalf Jung-40/+90
2023-10-23data_race: detect races between atomic and non-atomic accesses, even if both ↵Ralf Jung-0/+84
are reads
2023-10-22use visibility to check unused imports and delete some stmtsbohan-0/+1
2023-10-21Merge from rustcThe Miri Conjob Bot-98/+98
2023-10-20bless miriOli Scherer-8/+8
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-0/+0
2023-10-20s/generator/coroutine/Oli Scherer-37/+37
2023-10-20s/Generator/Coroutine/Oli Scherer-28/+28
2023-10-17Auto merge of #3124 - eduardosm:fix-sse41-round, r=RalfJungbors-0/+50
Fix rounding mode check in SSE4.1 round functions Now it masks out the correct bit and adds some explanatory comments. Also extends the tests.
2023-10-17Fix rounding mode check in SSE4.1 round functionsEduardo Sánchez Muñoz-0/+50
Now it masks out the correct bit and adds some explanatory comments. Also extends the tests.
2023-10-17fmtThe Miri Conjob Bot-3/+3
2023-10-17Merge from rustcThe Miri Conjob Bot-243/+370