about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-07-08implement support for multiple TLS destructors on macOSjoboet-0/+50
2024-07-08Rollup merge of #127355 - aceArt-GmbH:126475, r=oli-obkMatthias Krüger-8/+8
Mark format! with must_use hint Uses unstable feature https://github.com/rust-lang/rust/issues/94745 Part of #126475 First contribution to rust, please let me know if the blessing of tests is correct Thanks `@bjorn3` for the help
2024-07-08Auto merge of #113128 - WaffleLapkin:become_trully_unuwuable, r=oli-obk,RalfJungbors-0/+108
Support tail calls in mir via `TerminatorKind::TailCall` This is one of the interesting bits in tail call implementation — MIR support. This adds a new `TerminatorKind` which represents a tail call: ```rust TailCall { func: Operand<'tcx>, args: Vec<Operand<'tcx>>, fn_span: Span, }, ``` *Structurally* this is very similar to a normal `Call` but is missing a few fields: - `destination` — tail calls don't write to destination, instead they pass caller's destination to the callee (such that eventual `return` will write to the caller of the function that used tail call) - `target` — similarly to `destination` tail calls pass the caller's return address to the callee, so there is nothing to do - `unwind` — I _think_ this is applicable too, although it's a bit confusing - `call_source` — `become` forbids operators and is not created as a lowering of something else; tail calls always come from HIR (at least for now) It might be helpful to read the interpreter implementation to understand what `TailCall` means exactly, although I've tried documenting it too. ----- There are a few `FIXME`-questions still left, ideally we'd be able to answer them during review ':) ----- r? `@oli-obk` cc `@scottmcm` `@DrMeepster` `@JakobDegen`
2024-07-07Fixup a typo in a comment in a testMaybe Lapkin-1/+1
2024-07-07Fix conflicts after rebaseMaybe Lapkin-2/+2
- r-l/r 126784 - r-l/r 127113 - r-l/miri 3562
2024-07-07add miri tests and a fixmeMaybe Waffle-0/+108
2024-07-06offset_from intrinsic: always allow pointers to point to the same addressRalf Jung-3/+0
2024-07-06Mark format! with must_use hintlukas-8/+8
2024-07-06`sched_setaffinity`: adjust test on BE systemsFolkert-2/+7
2024-07-06`sched_setaffinity`: test `cpusetsize == 0`Folkert-0/+19
2024-07-05implement `libc::sched_getaffinity` and `libc::sched_setaffinity`Folkert-0/+231
2024-07-05Merge from rustcThe Miri Cronjob Bot-1/+3
2024-07-04Auto merge of #123781 - RalfJung:miri-fn-identity, r=oli-obkbors-1/+3
Miri function identity hack: account for possible inlining Having a non-lifetime generic is not the only reason a function can be duplicated. Another possibility is that the function may be eligible for cross-crate inlining. So also take into account the inlining attribute in this Miri hack for function pointer identity. That said, `cross_crate_inlinable` will still sometimes return true even for `inline(never)` functions: - when they are `DefKind::Ctor(..) | DefKind::Closure` -- I assume those cannot be `InlineAttr::Never` anyway? - when `cross_crate_inline_threshold == InliningThreshold::Always` so maybe this is still not quite the right criterion to use for function pointer identity.
2024-07-04Add casting tests for `f16` and `f128`Trevor Gross-0/+66
2024-07-04Refactor float casting testsTrevor Gross-186/+390
This is an attempt to remove the magic from a lot of the numbers tested, which should make things easier when it is time to add `f16` and `f128`. A nice side effect is that these tests now cover all int <-> float conversions with the same amount of tests. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-07-04Auto merge of #3732 - JoJoDeveloping:tree-borrows-protector-end-write, ↵bors-0/+62
r=RalfJung TB: Refine protector end semantics Tree Borrows has protector end tag semantics, namely that protectors ending cause a [special implicit read](https://perso.crans.org/vanille/treebor/diff.0.html) on all locations protected by that protector that have actually been accessed. See also #3067. While this is enough for ensuring protectors allow adding/reordering reads, it does not prove that one can reorder writes. For this, we need to make this stronger, by making this implicit read be a write in cases when there was a write to the location protected by that protector, i.e. if the permission is `Active`. There is a test that shows why this behavior is necessary, see `tests/fail/tree_borrows/protector-write-lazy.rs`.
2024-07-04Add UI test for protector end write semanticsJohannes Hostert-0/+62
2024-07-04Merge from rustcThe Miri Cronjob Bot-9/+18
2024-07-03Auto merge of #3726 - TDecking:vzero, r=RalfJungbors-0/+5
Implement the `_mm256_zeroupper` and `_mm256_zeroall` intrinsics These two intrinsics were missing from the original implementation of the AVX intrinsics. Fortunately their implementation is trivial.
2024-07-03Implement the `_mm256_zeroupper` and `_mm256_zeroall` intrinsicsTobias Decking-0/+5
2024-07-02Miri function identity hack: account for possible inliningRalf Jung-1/+3
2024-07-01add syscall `dup()`Adwin White-0/+26
2024-06-29Fix FnMut/Fn shim for coroutine-closures that capture referencesMichael Goulet-9/+18
2024-06-29iter_exported_symbols: also walk used statics in local crateRalf Jung-0/+17
2024-06-29Merge from rustcThe Miri Cronjob Bot-17/+0
2024-06-28Revert "Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors"Rémy Rakic-17/+0
This reverts commit 5c4ede88c61e746ed5c852d7a7e38ab1a824ae52, reversing changes made to 95332b89187bb6a0c910574cfeff1933b619565a.
2024-06-27Merge from rustcThe Miri Cronjob Bot-0/+17
2024-06-25Merge from rustcBen Kimock-3/+3
2024-06-25miri: make sure we can find link_section statics even for the local crateRalf Jung-0/+17
2024-06-24Auto merge of #126523 - joboet:the_great_big_tls_refactor, r=Mark-Simulacrumbors-3/+3
std: refactor the TLS implementation As discovered by Mara in #110897, our TLS implementation is a total mess. In the past months, I have simplified the actual macros and their expansions, but the majority of the complexity comes from the platform-specific support code needed to create keys and register destructors. In keeping with #117276, I have therefore moved all of the `thread_local_key`/`thread_local_dtor` modules to the `thread_local` module in `sys` and merged them into a new structure, so that future porters of `std` can simply mix-and-match the existing code instead of having to copy the same (bad) implementation everywhere. The new structure should become obvious when looking at `sys/thread_local/mod.rs`. Unfortunately, the documentation changes associated with the refactoring have made this PR rather large. That said, this contains no functional changes except for two small ones: * the key-based destructor fallback now, by virtue of sharing the implementation used by macOS and others, stores its list in a `#[thread_local]` static instead of in the key, eliminating one indirection layer and drastically simplifying its code. * I've switched over ZKVM (tier 3) to use the same implementation as WebAssembly, as the implementation was just a way worse version of that Please let me know if I can make this easier to review! I know these large PRs aren't optimal, but I couldn't think of any good intermediate steps. `@rustbot` label +A-thread-locals
2024-06-24Auto merge of #3708 - RalfJung:tls-dtor-in-dtor, r=RalfJungbors-58/+91
tests for when a thread-local gets initialized in a tls dtor
2024-06-24tests for when a thread-local gets initialized in a tls dtorRalf Jung-58/+91
2024-06-24Merge from rustcThe Miri Cronjob Bot-2/+2
2024-06-23Rollup merge of #126833 - RalfJung:extern-type-field-ice, r=compiler-errorsMatthias Krüger-2/+2
don't ICE when encountering an extern type field during validation "extern type" is a pain that keeps on giving... Fixes https://github.com/rust-lang/rust/issues/126814 r? ```@oli-obk```
2024-06-23Merge from rustcThe Miri Cronjob Bot-1/+1
2024-06-22don't ICE when encountering an extern type field during validationRalf Jung-2/+2
2024-06-22Auto merge of #3690 - TDecking:adx, r=RalfJungbors-0/+70
Implement LLVM x86 adx intrinsics See title. It also explots a small opportunity to deduplicate a bit of intrinsics code.
2024-06-22Make `effects` an incomplete featureDeadbeef-1/+1
2024-06-21Implement LLVM x86 adx intrinsicsTobias Decking-0/+70
2024-06-21Auto merge of #3689 - adwinwhite:lseek64, r=RalfJungbors-0/+21
Fix ICE caused by seeking past `i64::MAX` Make Miri behave the same as standard library on file seeking offset. Fixes #3680.
2024-06-21Merge from rustcThe Miri Cronjob Bot-10/+63
2024-06-20Fix ICE caused by seeking past `i64::MAX`Adwin White-0/+21
2024-06-20Auto merge of #3674 - TDecking:bmi, r=RalfJungbors-0/+216
Implement LLVM x86 bmi intrinsics This implements the intrinsics for both the bmi1 and bmi2 ISA extensions. All of these intrinsics live inside the same namespace as far as LLVM is concerned, which is why it is arguably better to bundle the implementations of these two extensions.
2024-06-20Auto merge of #116088 - nbdd0121:unwind, r=Amanieu,RalfJungbors-10/+2
Stabilise `c_unwind` Fix #74990 Fix #115285 (that's also where FCP is happening) Marking as draft PR for now due to `compiler_builtins` issues r? `@Amanieu`
2024-06-20Implement LLVM x86 bmi intrinsicsTobias Decking-0/+216
2024-06-19Remove c_unwind from tests and fix testsGary Guo-10/+2
2024-06-19Rollup merge of #126154 - RalfJung:storage-live, r=compiler-errorsLeón Orell Valerian Liehr-0/+61
StorageLive: refresh storage (instead of UB) when local is already live Blocked on [this FCP](https://github.com/rust-lang/rust/issues/99160#issuecomment-2155924538), which also contains the motivation. Fixes https://github.com/rust-lang/rust/issues/99160 Fixes https://github.com/rust-lang/rust/issues/98896 (by declaring it not-a-bug) Fixes https://github.com/rust-lang/rust/issues/119366 Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/129
2024-06-17Auto merge of #3683 - RalfJung:MIRIFLAGS, r=RalfJungbors-57/+30
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-57/+30
2024-06-17Auto merge of #3681 - rust-lang:rustup-2024-06-17, r=RalfJungbors-115/+68
Automatic Rustup