about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-02-11Auto merge of #3285 - sunfishcode:sunfishcode/mmap64, r=RalfJungbors-14/+25
Implement the `mmap64` foreign item. `mmap64` is like `mmap` but uses a 64-bit integer instead of `off_t` for the offset parameter.
2024-02-10Factor out the redundancy between `test_mmap` and `test_mmap64`.Dan Gohman-127/+24
2024-02-10interpret/write_discriminant: when encoding niched variant, ensure the ↵Ralf Jung-0/+51
stored value matches
2024-02-08fmtThe Miri Conjob Bot-3/+2
2024-02-07Update testsr0cky-0/+12
2024-02-06Rollup merge of #120683 - RalfJung:symbolic-alignment-ice, r=oli-obkMatthias Krüger-1/+48
miri: fix ICE with symbolic alignment check on extern static Fixes https://github.com/rust-lang/miri/issues/3288. Also fixes [this example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=38ee338ff10726be72bdd6efa3386763). This could almost be a Miri PR, except for that typo fix in the validator. I started this as a rustc patch since I thought I need rustc changes, and now it'd be too annoying to turn this into a Miri PR... r? `@oli-obk`
2024-02-06miri: fix ICE with symbolic alignment check on extern staticRalf Jung-1/+48
2024-02-05Auto merge of #117372 - Amanieu:stdarch_update, r=Mark-Simulacrumbors-2/+2
Update stdarch submodule Splits up #27731 into multiple tracking issues. Closes #27731
2024-02-02miri: normalize struct tail in ABI compat checkLukas Markeffsky-0/+20
2024-01-30Implement the `mmap64` foreign item.Dan Gohman-0/+114
`mmap64` is like `mmap` but uses a 64-bit integer instead of `off_t` for the offset parameter.
2024-01-30Update feature names for new stdarchAmanieu d'Antras-2/+2
2024-01-29Auto merge of #120451 - RalfJung:miri, r=RalfJungbors-1/+0
Miri subtree update r? `@ghost`
2024-01-28Auto merge of #3181 - devnexen:stat_calls_fbsd, r=RalfJungbors-1/+0
freebsd add *stat calls interception support
2024-01-26interpret: project_downcast: do not ICE for uninhabited variantsRalf Jung-0/+16
2024-01-25Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obkbors-0/+15
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion. While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests. Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage). Fixes #47234 Resolves #114390 `@Centri3`
2024-01-24Auto merge of #118336 - saethlin:const-to-op-cache, r=RalfJungbors-0/+38
Return a finite number of AllocIds per ConstAllocation in Miri Before this, every evaluation of a const slice would produce a new AllocId. So in Miri, this program used to have unbounded memory use: ```rust fn main() { loop { helper(); } } fn helper() { "ouch"; } ``` Every trip around the loop creates a new AllocId which we need to keep track of a base address for. And the provenance GC can never clean up that AllocId -> u64 mapping, because the AllocId is for a const allocation which will never be deallocated. So this PR moves the logic of producing an AllocId for a ConstAllocation to the Machine trait, and the implementation that Miri provides will only produce 16 AllocIds for each allocation. The cache is also keyed on the Instance that the const is evaluated in, so that equal consts evaluated in two functions will have disjoint base addresses. r? RalfJung
2024-01-22Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin"Oli Scherer-1/+8
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
2024-01-20Rollup merge of #120150 - Jules-Bertholet:stabilize-round-ties-even, r=cuviperMatthias Krüger-1/+0
Stabilize `round_ties_even` Closes #96710 `@rustbot` label -T-libs T-libs-api
2024-01-19Stabilize `round_ties_even`Jules Bertholet-1/+0
2024-01-19Add new intrinsic `is_constant` and optimize `pow`Catherine Flores-0/+15
Fix overflow check Make MIRI choose the path randomly and rename the intrinsic Add back test Add miri test and make it operate on `ptr` Define `llvm.is.constant` for primitives Update MIRI comment and fix test in stage2 Add const eval test Clarify that both branches must have the same side effects guaranteed non guarantee use immediate type instead Co-Authored-By: Ralf Jung <post@ralfj.de>
2024-01-19Rollup merge of #119984 - kpreid:waker-noop, r=dtolnayMatthias Krüger-12/+6
Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`. The advantage of this is that it does not need to be assigned to a variable to be used in a `Context` creation, which is the most common thing to want to do with a noop waker. It also avoids unnecessarily executing the dynamically dispatched drop function when the noop waker is dropped. If an owned noop waker is desired, it can be created by cloning, but the reverse is harder to do since it requires declaring a constant. Alternatively, both versions could be provided, like `futures::task::noop_waker()` and `futures::task::noop_waker_ref()`, but that seems to me to be API clutter for a very small benefit, whereas having the `&'static` reference available is a large reduction in boilerplate. [Previous discussion on the tracking issue starting here](https://github.com/rust-lang/rust/issues/98286#issuecomment-1862159766)
2024-01-19Auto merge of #120121 - matthiaskrgr:rollup-razammh, r=matthiaskrgrbors-2/+2
Rollup of 10 pull requests Successful merges: - #118665 (Consolidate all associated items on the NonZero integer types into a single impl block per type) - #118798 (Use AtomicU8 instead of AtomicUsize in backtrace.rs) - #119062 (Deny braced macro invocations in let-else) - #119138 (Docs: Use non-SeqCst in module example of atomics) - #119907 (Update `fn()` trait implementation docs) - #120083 (Warn when not having a profiler runtime means that coverage tests won't be run/blessed) - #120107 (dead_code treats #[repr(transparent)] the same as #[repr(C)]) - #120110 (Update documentation for Vec::into_boxed_slice to be more clear about excess capacity) - #120113 (Remove myself from review rotation) - #120118 (Fix typo in documentation in base.rs) r? `@ghost` `@rustbot` modify labels: rollup
2024-01-18Remove no-longer-needed `allow(dead_code)` from Miri testsJake Goulding-2/+2
`repr(transparent)` now silences the lint.
2024-01-19Fix typo in munmap_partial.rsIkko Eltociear Ashimine-1/+1
addres -> address
2024-01-17Remove unnecessary `let`s and borrowing from `Waker::noop()` usage.Kevin Reid-12/+6
`Waker::noop()` now returns a `&'static Waker` reference, so it can be passed directly to `Context` creation with no temporary lifetime issue.
2024-01-11std: update miri testsjoboet-28/+28
2024-01-09Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwcoGuillaume Gomez-0/+7
Disallow reference to `static mut` and adding `static_mut_ref` lint Closes #114447 r? `@scottmcm`
2024-01-07Update test for `E0796` and `static_mut_ref` lintObei Sideg-0/+7
2024-01-07Auto merge of #3256 - RalfJung:rounding, r=RalfJungbors-158/+169
implement the rounding intrinsics using apfloat rounding No reason to use host floats for these. Also merge two files that were both testing various float things.
2024-01-06Sometimes return the same AllocId for a ConstAllocationBen Kimock-0/+38
2024-01-06these should be exactRalf Jung-8/+8
2024-01-06merge intrinsics-math into float testsRalf Jung-166/+161
2024-01-06implement the rounding intrinsics using apfloat roundingRalf Jung-1/+17
2024-01-06fmtThe Miri Conjob Bot-2/+11
2024-01-05Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkinbors-23/+23
Merge `unused_tuple_struct_fields` into `dead_code` This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group. [Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)
2024-01-04Rollup merge of #119574 - RalfJung:miri, r=oli-obkMatthias Krüger-80/+286
Miri subtree update r? `@ghost`
2024-01-04miri: do not forward RUSTFLAGS to deps buildRalf Jung-0/+2
2024-01-02Allow unused tuple struct fields in Miri testsJake Goulding-23/+23
Otherwise the newly-detected dead code causes new output
2023-12-30Auto merge of #3239 - beepster4096:windows_sys_tests, r=RalfJungbors-80/+48
Use `windows-sys` in windows tests This PR adds `windows-sys` to `test_dependencies` so that we don't have to write out windows api bindings for each test.
2023-12-29undo some lockfile changes, add explicit types to testsDrMeepster-65/+47
2023-12-28Fix integer overflow ICEs from round_up_to_next_multiple_ofBen Kimock-0/+21
2023-12-28Auto merge of #3244 - RalfJung:nan-nondet, r=RalfJungbors-0/+194
NaN non-determinism for intrinsics and libm functions
2023-12-28don't test unspecified caseRalf Jung-22/+0
2023-12-28NaN non-determinism for SIMD intrinsicsRalf Jung-1/+57
2023-12-28add NaN-nondet to libm functionsRalf Jung-0/+40
2023-12-28make float intrinsics return non-deterministic NaNRalf Jung-0/+98
2023-12-28Support for tempfile crate on UNIX hostsPointerbender-0/+21
Co-authored-by: Jefffrey <22608443+Jefffrey@users.noreply.github.com> Co-authored-by: Ralf Jung <post@ralfj.de>
2023-12-27fast_math: detect non-finite resultsRalf Jung-0/+22
2023-12-26custom mir: make it clear what the return block isRalf Jung-31/+31
2023-12-25have windows tests use windows-sysDrMeepster-100/+86