about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-10-11intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semanticsJed Brown-0/+62
Add intrinsics `fmuladd{f16,f32,f64,f128}`. This computes `(a * b) + c`, to be fused if the code generator determines that (i) the target instruction set has support for a fused operation, and (ii) that the fused operation is more efficient than the equivalent, separate pair of `mul` and `add` instructions. https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic MIRI support is included for f32 and f64. The codegen_cranelift uses the `fma` function from libc, which is a correct implementation, but without the desired performance semantic. I think this requires an update to cranelift to expose a suitable instruction in its IR. I have not tested with codegen_gcc, but it should behave the same way (using `fma` from libc).
2024-10-11simplify Tree Borrows write-during-2phase exampleRalf Jung-13/+15
2024-10-11rename RcBox in other places tooJonathan Dönszelmann-2/+2
2024-10-10Auto merge of #3960 - tiif:smallchange, r=RalfJungbors-5/+26
Pipe minor changes: diagnostics, flag support and comments This PR: - Add the exact syscall names to the blocking not supported diagnostic - Added support for ``pipe2`` ``O_NONBLOCK`` - Fix minor comment error in ``tests/pass-dep/libc/libc-epoll-blocking.rs`` Fixes #3912
2024-10-10Pipe minor changes: diagnostics, flag support and commentstiif-5/+26
2024-10-10remove -Zmiri-panic-on-unsupported flagRalf Jung-16/+0
2024-10-10remove handle_unsupported_foreign_item helperRalf Jung-13/+0
2024-10-09syscall/eventfd2: add supportFrank Rehwinkel-29/+9
2024-10-09syscall/eventfd2: add failing testFrank Rehwinkel-0/+29
The shim syscall logic doesn't support ID 290, SYS_eventfd2.
2024-10-09Auto merge of #3946 - FrankReh:fix-over-synchronization-of-epoll, r=RalfJungbors-0/+117
Fix over synchronization of epoll Fixes #3944. The clock used by epoll is now per event generated, rather than by the `epoll's` ready_list. The same epoll tests that existed before are unchanged and still pass. Also the `tokio` test case we had worked on last week still passes with this change. This change does beg the question of how the epoll event states should change. Perhaps rather than expose public crate bool fields, so setters should be provided that include a clock parameter or an optional clock parameter. Also should all the epoll event possibilities have their clock sync tested the way these commit lay out testing. In this first go around, only the pipe's EPOLLIN is tested. The EPOLLOUT might deserve testing too, as would the eventfd. Any future source of epoll events would also fit into that category.
2024-10-09epoll: change clock to be per eventFrank Rehwinkel-17/+30
2024-10-09Fixed pthread_getname_np impl for glibcYoh Deadfall-17/+61
2024-10-08epoll: test case showing too much clock syncFrank Rehwinkel-0/+104
2024-10-08fix behavior of release_clock()Ralf Jung-0/+51
2024-10-05Fix up testsMichael Goulet-2/+49
2024-10-05avoid pthread_attr_t in testsRalf Jung-18/+24
2024-10-05Auto merge of #3943 - RalfJung:pthread-mutex-reentrant, r=RalfJungbors-14/+48
pthread mutex: better error in reentrant-locking-UB Also test reentrant locking of PTHREAD_MUTEX_INITIALIZER
2024-10-05pthread mutex: better error in reentrant-locking-UB, also test ↵Ralf Jung-14/+48
PTHREAD_MUTEX_INITIALIZER
2024-10-04Implement LLVM x86 gfni intrinsicsTobias Decking-0/+518
2024-10-04Merge from rustcThe Miri Cronjob Bot-7/+7
2024-10-03make sure we also detect mixed-size races that begin at different addressesRalf Jung-1/+47
2024-10-03fmtRalf Jung-2/+2
2024-10-03Merge from rustcRalf Jung-245/+229
2024-10-02epoll: add vector clock to the epoll ready_listFrank Rehwinkel-109/+40
This adds a VClock to the epoll implementation's ready_list and has this VClock synced from the thread that updates an event in the ready_list and then has the VClocks of any threads being made runnable again, out of the calls to epoll_wait, synced from it.
2024-10-02epoll: add data_race testFrank Rehwinkel-0/+108
This test demonstrates the need to synchronize the clock of the thread waking up from an epoll_wait from the thread that issued the epoll awake event.
2024-10-02bless miri testsjoboet-7/+7
2024-09-30Auto merge of #131036 - RalfJung:miri-sync, r=RalfJungbors-121/+285
Miri subtree update r? `@ghost`
2024-09-29let rustfmt format importsRalf Jung-87/+64
2024-09-29skip old getrandom crate on SolarisRalf Jung-0/+5
2024-09-28Auto merge of #3918 - devnexen:solaris_arc4random_buf, r=RalfJungbors-0/+13
implements arc4random_buf shim for freebsd/solarish platforms. close #3914
2024-09-28implements arc4random_buf shim for freebsd/solarish platforms.David Carlier-0/+13
close #3914
2024-09-28add tests for validity of Box with custom allocatorRalf Jung-0/+99
2024-09-28Further clarificarion for atomic and UnsafeCell docs:Ralf Jung-0/+17
- UnsafeCell: mention the term "data race", and reference the data race definition - atomic: failing RMWs are just reads, reorder and reword docs
2024-09-28allow mixed-size atomic readsRalf Jung-140/+175
2024-09-28miri: no longer complain about read-read racesRalf Jung-105/+37
2024-09-25Auto merge of #3915 - RalfJung:target-json-test, r=RalfJungbors-25/+24
switch custom target JSON test to a less exotic target We used to test an AVR target here, but while it is nice to test a 16bit target, it is also currently the case that rustc CI does not even check that libcore builds on a 16bit target -- and we don't want Miri to be in the game of maintaining that support. (See https://github.com/rust-lang/rust/issues/130818.) So let's use a tier 2 target as the basis for testing a custom JSON target. (FWIW, we also test wasm32-wasip2 which is tier 3, but I expect it will become tier 2 Soon-ish.)
2024-09-25switch custom target JSON test to a less exotic targetRalf Jung-25/+24
2024-09-25Android: Fixed tests for libc time APIYoh Deadfall-5/+25
2024-09-25avoid using HashMap in fs testRalf Jung-3/+3
2024-09-25add test for std::randomRalf Jung-0/+5
2024-09-25fmtThe Miri Cronjob Bot-1/+3
2024-09-25Merge from rustcThe Miri Cronjob Bot-8/+48
2024-09-24be even more precise about "cast" vs "coercion"Lukas Markeffsky-1/+1
2024-09-23Rollup merge of #130727 - compiler-errors:objects, r=RalfJungMichael Goulet-8/+41
Check vtable projections for validity in miri Currently, miri does not catch when we transmute `dyn Trait<Assoc = A>` to `dyn Trait<Assoc = B>`. This PR implements such a check, and fixes https://github.com/rust-lang/miri/issues/3905. To do this, we modify `GlobalAlloc::VTable` to contain the *whole* list of `PolyExistentialPredicate`, and then modify `check_vtable_for_type` to validate the `PolyExistentialProjection`s of the vtable, along with the principal trait that was already being validated. cc ``@RalfJung`` r? ``@lcnr`` or types I also tweaked the diagnostics a bit. --- **Open question:** We don't validate the auto traits. You can transmute `dyn Foo` into `dyn Foo + Send`. Should we check that? We currently have a test that *exercises* this as not being UB: https://github.com/rust-lang/rust/blob/6c6d210089e4589afee37271862b9f88ba1d7755/src/tools/miri/tests/pass/dyn-upcast.rs#L14-L20 I'm not actually sure if we ever decided that's actually UB or not 🤔 We could perhaps still check that the underlying type of the object (i.e. the concrete type that was unsized) implements the auto traits, to catch UB like: ```rust fn main() { let x: &dyn Trait = &std::ptr::null_mut::<()>(); let _: &(dyn Trait + Send) = std::mem::transmute(x); //~^ this vtable is not allocated for a type that is `Send`! } ```
2024-09-23Check vtable projections for validity in miriMichael Goulet-8/+41
2024-09-23add test for new abort_unwind functionRalf Jung-0/+44
2024-09-23update miri testjoboet-1/+1
2024-09-23miri: shim `CCRandomGenerateBytes`joboet-0/+7
2024-09-22Merge from rustcRalf Jung-2/+2
2024-09-21Auto merge of #127546 - workingjubilee:5-level-paging-exists, r=saethlinbors-2/+2
Correct outdated object size limit The comment here about 48 bit addresses being enough was written in 2016 but was made incorrect in 2019 by 5-level paging, and then persisted for another 5 years before being noticed and corrected. The bolding of the "exclusive" part is merely to call attention to something I missed when reading it and doublechecking the math. try-job: i686-msvc try-job: test-various