Commit Graph

40 Commits

Author SHA1 Message Date
bors
3d1d345f8f Auto merge of #2255 - dtolnay-contrib:rustfmt7, r=oli-obk
Format tests with rustfmt (288-299 of 299)

Extracted from #2097.

I'll make a separate PR to enable checking the `tests` directory's formatting in CI. I'll need to rebase that after both this and #2254 have landed, and if any new non-rustfmt-formatted files appear in the meantime, we can include formatting those in the same PR that enables the CI.
2022-06-22 10:04:08 +00:00
David Tolnay
274085cebd
Manual adjustments 2022-06-21 23:52:24 -07:00
David Tolnay
639f660dde
Manual adjustments 2022-06-21 23:21:12 -07:00
David Tolnay
ba23d37b70
Format tests with rustfmt (288-299 of 299) 2022-06-21 22:58:00 -07:00
David Tolnay
7d09004aee
Format tests with rustfmt (276-287 of 299) 2022-06-21 22:57:47 -07:00
bors
cbb649adfe Auto merge of #2249 - dtolnay-contrib:rustfmt3, r=oli-obk
Format tests with rustfmt (151-200 of 300)

Extracted from #2097.

This PR is still only doing the easy cases with no comments involved.

In the next PRs after this, I'll start grouping by common comment patterns, e.g. all the cases resembling https://github.com/rust-lang/miri/pull/2097#discussion_r862436672 together in one PR.
2022-06-21 07:39:16 +00:00
bors
332f2894ed Auto merge of #2246 - dtolnay-contrib:rustfmt1, r=oli-obk
Format tests with rustfmt (51-100 of 300)

Extracted from #2097.

Like #2244, this is intended to be "easy" cases which don't involve comments in the vicinity.
2022-06-21 06:57:41 +00:00
David Tolnay
30376ba709
Manual adjustments 2022-06-20 23:50:45 -07:00
David Tolnay
069f5b6615
Format tests with rustfmt (151-200 of 300) 2022-06-20 23:50:40 -07:00
David Tolnay
8efc049a9f
Manual adjustments 2022-06-20 21:36:11 -07:00
David Tolnay
6b8c371f06
Manual adjustments 2022-06-20 16:09:49 -07:00
David Tolnay
df8d8b655b
Format tests with rustfmt (101-150 of 300) 2022-06-20 16:09:45 -07:00
David Tolnay
fafeccaef7
Bless stdout files after rustfmt 2022-06-20 15:39:50 -07:00
David Tolnay
619813500b
Format tests with rustfmt (51-100 of 300) 2022-06-20 15:39:46 -07:00
David Tolnay
817adda794
Add rustfmt::skip to some files
Five of the files being skipped here are because rustfmt is buggy (see
the error messages below). The others have clearly preferable manual
formatting.

    error[internal]: left behind trailing whitespace
      --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
       |
    18 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
       |
    15 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
     --> tests/fail/erroneous_const2.rs:9:9:1
      |
    9 |
      | ^^^^
      |

    warning: rustfmt has failed to format. See previous 1 errors.
2022-06-19 17:21:57 -07:00
bors
c4dd3f4ef9 Auto merge of #2228 - cbeuw:futex-fix, r=RalfJung
Prevent futex_wait from actually waiting if a concurrent waker was executed before us

Fixes #2223

Two SC fences were placed in `futex_wake` (after the caller has changed `addr`), and in `futex_wait` (before we read `addr`). This guarantees that `futex_wait` sees the value written to `addr` before the last `futex_wake` call, should one exists, and avoid going into sleep with no one else to wake us up.
ada7b72a87/src/concurrency/weak_memory.rs (L324-L326)

Earlier I proposed to use `fetch_add(0)` to read the latest value in MO, though this isn't the proper way to do it and breaks aliasing: syscall caller may pass in a `*const` from a `&` and Miri complains about write to a `SharedReadOnly` location, causing this test to fail.
ada7b72a87/tests/pass/concurrency/linux-futex.rs (L56-L68)
2022-06-18 15:10:56 +00:00
Ralf Jung
d194e9823c rustup 2022-06-16 11:18:09 -07:00
Andy Wang
56a4c132b6
Reduce the number of iterations 2022-06-13 18:24:19 +01:00
Ralf Jung
8ebdad0615 organize more files into folders, and run the weak-mem consistency test as the very first since it is so slow 2022-06-13 09:08:14 -07:00
bors
2bbb70f584 Auto merge of #2203 - RalfJung:deprecate, r=oli-obk
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute

Cc https://github.com/rust-lang/miri/issues/2187 https://github.com/rust-lang/miri/issues/2188
2022-06-13 10:23:42 +00:00
Andy Wang
b6bcbf76fd
Prevent futex_wait from reading outdated value 2022-06-11 20:45:45 +01:00
InfRandomness
3e03054ef0 Add getpid shim 2022-06-11 11:28:50 +02:00
Ralf Jung
2b35dd514e linux-futex test: ensure we join all threads 2022-06-07 17:03:11 -04:00
Ralf Jung
61f5680da0 add stdlib test for TLS dtor order 2022-06-07 07:58:21 -04:00
Ralf Jung
11a8b3a00b bless tests 2022-06-06 20:17:39 -04:00
Ralf Jung
bf372a8fbc remove warning about thread support being experimental 2022-06-06 20:16:02 -04:00
Ralf Jung
b64c9a0a83 make scheduler preemptive, with configurable preemption rate 2022-06-06 20:16:02 -04:00
Ralf Jung
14913e993b deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute 2022-06-06 16:07:30 -04:00
Andy Wang
65f39bd5cf
Move tests to new directories 2022-06-06 19:16:01 +01:00
Andy Wang
6a73dedb36
Update experimental threading warning 2022-06-06 19:15:59 +01:00
Andy Wang
e2002b4c65
Amend experimental thread support warnings 2022-06-06 19:15:55 +01:00
Andy Wang
32627d5abb
Disable weak memory emulation on scheduler-dependent data race tests 2022-06-06 19:15:23 +01:00
Ralf Jung
7f5cfa54d9 port some tests away from flags we want to remove 2022-06-06 11:44:36 -04:00
Ralf Jung
63625b0397 adjust for better provenance control 2022-06-06 11:43:25 -04:00
bors
2eae474673 Auto merge of #2197 - RalfJung:round-robin, r=RalfJung
make Miri's scheduler proper round-robin

When thread N blocks or yields, we activate thread N+1 next, rather than always activating thread 0. This should guarantee that as long as all threads regularly yield, each thread eventually takes a step again.

Fixes the "multiple loops that yield playing ping-pong" part of https://github.com/rust-lang/miri/issues/1388.
`@cbeuw` I hope this doesn't screw up the scheduler-dependent tests you are adding in your PR.
2022-06-05 18:37:07 +00:00
Ralf Jung
34b359be1e more spin-loop-tests 2022-06-05 14:36:49 -04:00
Ralf Jung
47745380cd make Miri's scheduler proper round-robin 2022-06-05 14:22:00 -04:00
Ralf Jung
4a852126b9 do not use int2ptr casts in strict provenance tests 2022-06-05 11:47:39 -04:00
DrMeepster
0b7a148ad9 add test for backtrace with global allocator 2022-06-01 17:32:01 -07:00
Ralf Jung
3d634c975c rename test suite directories 2022-06-01 10:53:38 -04:00