Samrat Man Singh
ae9796b9d8
Fix shim_arg_size test for 32-bit machines
2020-04-27 10:00:35 +05:30
Samrat Man Singh
da86c81e39
Add test to verify arg size mismatch throws UB
...
Also: bump up `rust-version`
2020-04-27 09:37:31 +05:30
Ralf Jung
c46668c556
fix exit code on rustc errors
2020-04-25 11:12:50 +02:00
David Cook
7f92eab3c4
Add test to exercise InvalidUndefBytes
2020-04-23 20:00:25 -05:00
Ralf Jung
73772fede6
adjust for Weak::as_raw -> as_ptr rename
2020-04-20 10:04:17 +02:00
Ralf Jung
70c828b761
test some more extreme cast cases
2020-04-19 09:34:54 +02:00
bors
45113eb6a4
Auto merge of #1325 - RalfJung:float_to_int_unchecked, r=RalfJung
...
implement float_to_int_unchecked
@hanna-kruppe would be great if you could have a look at this.
`float.rs` tests legal casts. `test_cast` checks that both `as` casts and unchecked casts work (i.e., these are not saturating). The `compile-fail` tests should ensure that illegal casts via the intrinsic are detected as such.
Fixes https://github.com/rust-lang/miri/issues/1264
2020-04-18 08:13:24 +00:00
Ralf Jung
bb38ab4340
use u128::MAX symbolic name
2020-04-18 10:11:45 +02:00
Ralf Jung
0345ee42da
some UB gets masked by optimizations
2020-04-18 09:15:59 +02:00
Ralf Jung
c6ab27577b
test that we check dynamic actual size of object
2020-04-18 02:06:36 +02:00
Ralf Jung
521e77d712
test that we properly check dynamic alignment
2020-04-17 20:43:54 +02:00
Ralf Jung
e6822d60b3
make sure we find some things without validation or stacked borrows, respectively
2020-04-14 10:23:47 +02:00
Ralf Jung
179e78d0ad
make sure our disable flags do not miss all bugs; move type-assert intrinsic tests to their folder
2020-04-14 10:23:47 +02:00
Ralf Jung
f4a15444cf
fix comment in alignment test
2020-04-14 09:50:20 +02:00
Ralf Jung
fd8beaf5c4
add option to disable alignment checks
2020-04-13 17:58:03 +02:00
Ralf Jung
17c52d47e7
add tests for invalid float-to-int casts
2020-04-12 12:01:20 +02:00
Ralf Jung
30d07c8616
move error-pattern to inline annotation where possible
2020-04-12 12:01:20 +02:00
Ralf Jung
b2bf4ec2f5
organize compile-fail tests in folders
2020-04-11 11:36:55 +02:00
Ralf Jung
d276d952ff
fix unused warnings in tests
2020-04-10 10:27:59 +02:00
bors
325682ad56
Auto merge of #1301 - RalfJung:global-leaks, r=RalfJung
...
memory reachable through globals is not a leak
Blocked on https://github.com/rust-lang/rust/pull/70762
Fixes https://github.com/rust-lang/miri/issues/940
2020-04-07 17:33:24 +00:00
Ralf Jung
7841f44593
rustup
2020-04-07 19:33:03 +02:00
David Cook
134d6a2faa
Add tests, improve test coverage
2020-04-05 14:55:57 -05:00
David Cook
d5d5a56926
Add tests
2020-04-05 13:25:49 -05:00
Ralf Jung
cd132f563e
port compile-fail allocator tests to stable API
2020-04-02 13:33:59 +02:00
Ralf Jung
5130aa55a2
adjust stacktrace printing to rustc changes
2020-04-02 09:14:17 +02:00
bors
f4308a0728
Auto merge of #1267 - RalfJung:macos-dtors, r=RalfJung
...
implement TLS cleanup for macOS
Now that I can run macOS interpretation locally, this was not that hard to fix. ;)
Fixes https://github.com/rust-lang/miri/issues/443
2020-03-28 07:55:42 +00:00
Ralf Jung
c5ef8a656f
enable leak tests on macOS
2020-03-27 19:39:35 +01:00
JOE1994
ea836eeb0d
remove or update 'ignore-windows' annotations in some tests
2020-03-27 14:18:19 -04:00
Ralf Jung
47b91e619a
test unreachable intrinsic
2020-03-25 09:32:15 +01:00
Ralf Jung
d85f09c4e4
platform -> target
2020-03-22 08:55:39 +01:00
Ralf Jung
238ed49a07
detect UB: overflow in copy/write_bytes
2020-03-21 17:54:33 +01:00
Ralf Jung
8acfafe186
test for zero-sized write_bytes to NULL
2020-03-21 17:54:18 +01:00
Ralf Jung
e890d4d5e1
call error location was fixed by rustup
2020-03-21 12:52:23 +01:00
Ralf Jung
5c09047411
fix tests
2020-03-21 10:54:56 +01:00
Ralf Jung
bde3111c61
test windows panic message
2020-03-21 10:17:57 +01:00
Ralf Jung
49051e05ea
rustup, and some final message adjustments
2020-03-19 08:41:01 +01:00
Ralf Jung
e1e158e103
adjust error messages for lower-case start
2020-03-19 08:26:08 +01:00
Ralf Jung
77cc0cddd9
add test for validation finding use-after-free
2020-03-19 08:25:08 +01:00
Ralf Jung
1103a10e2c
adjust for error reform
2020-03-19 08:25:08 +01:00
Elichai Turkel
0826899ca0
Remove uninhabit/zeroed tests to a new test file for abort checking
2020-03-18 14:14:23 +02:00
Ralf Jung
8a26a288c2
rustup
2020-03-16 21:32:57 +01:00
Ralf Jung
497fbcbf44
rustup, fix for intrinsic rename and transmute error change
2020-03-14 09:27:35 +01:00
Ralf Jung
5531a79f4c
rustup, test Abort terminator
2020-03-12 20:48:04 +01:00
Ralf Jung
5ef48593fb
adjust error
2020-03-09 17:03:39 +01:00
Christian Poveda
8392a0c589
only expose environ on linux
2020-03-08 10:16:31 -05:00
Christian Poveda
18a71ef7b3
minor corrections
2020-03-07 11:35:00 -05:00
Christian Poveda
6eccc809f2
test that environ
gets deallocated on changes
2020-03-07 09:39:55 -05:00
Ralf Jung
148269dd4b
finally stop using min/max_value and the integer modules
2020-03-04 13:01:06 +01:00
Ralf Jung
db0d03229c
fix allocator tests
2020-03-04 10:19:35 +01:00
Ralf Jung
88c45f9891
adjust for rustc changes
2020-03-02 13:51:08 +01:00
Ralf Jung
274ae0438f
add an option to disable Stacked Borrows
2020-02-24 16:22:02 +01:00
Ralf Jung
8acf52b3ca
fix compile-fail tests to avoid libstd debug assertions
2020-02-16 14:01:00 +01:00
Ralf Jung
d208a5fe3b
rustup; fix generator test
2020-02-07 14:02:27 +01:00
Ralf Jung
5d2caef3ce
also test div-by-minus-1
2020-02-06 11:24:38 +01:00
Ralf Jung
4b6a0d7a8e
bump rustc; adjust tests
2020-02-06 11:20:28 +01:00
Ralf Jung
e0adfe4d45
new compile-fail test involving non-reborrowing-cast-to-raw
2020-01-30 12:22:15 +01:00
Tim Diekmann
3d8bf92a11
Rename Alloc
to AllocRef
...
Required to land https://github.com/rust-lang/rust/pull/68529 . Please see that PR for details. The CI is expected to fail until the PR is landed.
2020-01-29 04:10:33 +01:00
Ralf Jung
e952e37a39
compile-fail tests work with optimizations now
2019-12-29 12:38:40 +01:00
Oliver Scherer
d9859c83fc
Rustup to rustc 1.42.0-nightly ( 9ff30a781
2019-12-21)
2019-12-21 11:45:09 +01:00
Ralf Jung
74ef63ff0a
the never type got de-stabilized again; adjust tests
2019-12-15 12:23:43 +01:00
Ralf Jung
f0d43872ad
add test for sketchy vtable
2019-12-13 13:19:48 +01:00
Ralf Jung
cefc592273
bump Rust, fix error messages
2019-12-08 01:45:41 +01:00
Ralf Jung
6d8e87111b
bump Rust for exact_div fix
2019-12-03 17:37:42 +01:00
Ralf Jung
ae53b1222a
fix and expand panic tests
2019-12-02 16:04:31 +01:00
Ralf Jung
dcdd68b936
also indicate abort via new MachineStop variant
2019-12-02 09:13:58 +01:00
Ralf Jung
6941caf1df
typo
2019-11-22 18:12:10 +01:00
Ralf Jung
6888555ca9
rustup for never stabilization
2019-11-22 09:50:22 +01:00
Ralf Jung
5cef4666e6
rename panic=abort tests to panic_abort
2019-11-19 22:44:07 +01:00
Aaron Hill
b06d99b8a0
Ignore '-C panic=abort' tests for now
...
We are currently building `libpanic_abort` with the wrong panic
strategy, due to Xargo missing a hack used by `bootstrap`.
2019-11-17 08:40:34 -05:00
Aaron Hill
08d3fbc76b
Support unwinding after a panic
...
Fixes #658
This commit adds support for unwinding after a panic. It requires a
companion rustc PR to be merged, in order for the necessary hooks to
work properly.
Currently implemented:
* Selecting between unwind/abort mode based on the rustc Session
* Properly popping off stack frames, unwinding back the caller
* Running 'unwind' blocks in Mir terminators
Not yet implemented:
* 'Abort' terminators
This PR was getting fairly large, so I decided to open it for review without
implementing 'Abort' terminator support. This could either be added on
to this PR, or merged separately.
2019-11-17 08:34:25 -05:00
Ralf Jung
64244e9a18
do full deref-check before reborrowing
2019-11-14 10:24:02 +01:00
Ralf Jung
428fc531d8
silence a lint that catches the bug statically
2019-11-07 09:44:00 +01:00
Ralf Jung
1f8cb476ea
fix test erorr msg
2019-11-06 09:24:26 +01:00
Ralf Jung
c4f1d3f488
test that 0 cannot be offset-inbounds by 0
2019-11-06 09:24:26 +01:00
Ralf Jung
fcf0f886d4
adjust tests
2019-11-03 10:15:55 +01:00
Christian Poveda
61da8b8428
Add OsString from/to bytes helper functions
2019-10-18 09:47:19 -05:00
Ralf Jung
8ecd767791
fix test failure from diagnostics change
2019-09-29 11:30:28 -04:00
Christian Poveda
145a5826d5
Check that chdir
fails for non-utf8 paths
2019-09-24 17:28:38 -05:00
Oliver Scherer
b952584186
Rustup to 1.39.0-nightly ( 1e869133b
2019-09-09)
2019-09-09 13:00:20 +02:00
Ralf Jung
f67af5a1c2
test too big slice
2019-08-31 08:41:55 +02:00
Ralf Jung
cecbe1611b
test for invalid wide raw ptr
2019-08-29 17:19:09 +02:00
Ralf Jung
94cd0ce734
fix test failure due to my own lint
2019-08-18 11:16:02 +02:00
Ralf Jung
2f95d4d50c
remove dead code
2019-08-15 11:01:03 +02:00
Ralf Jung
60a0688185
adjust tests for eager pointer checks on deref
2019-08-15 11:01:03 +02:00
Ralf Jung
b93629262d
test that even &Cell must be dereferencable
2019-08-09 19:22:47 +02:00
bors
b09ae31da0
Auto merge of #871 - RalfJung:miri-rustc-cleanup, r=RalfJung
...
Cleanup after rustc bootstrap tests Miri with a separate libstd
Should only be merged after https://github.com/rust-lang/rust/pull/63162 got the green light.
2019-08-08 20:43:47 +00:00
Ralf Jung
d26917a9d6
fix for latest rustc
2019-08-05 10:45:48 +02:00
Ralf Jung
f47e58950b
check that atomics are sufficiently aligned, and add test
2019-08-04 10:30:42 +02:00
Ralf Jung
a41ec9aacb
adjust error messages in tests
2019-08-03 20:54:57 +02:00
Ralf Jung
bff6b05424
more consistent test name
2019-08-03 17:27:50 +02:00
Ralf Jung
773f6aeb4c
remove some compile-fail tests that now work
2019-08-03 15:01:04 +02:00
Ralf Jung
2973063fa3
test dangling ZST deref
2019-08-02 14:26:15 +02:00
Ralf Jung
c4c2716f4e
make reborrow shallow, and fix tests for that
2019-08-02 08:09:22 +02:00
Ralf Jung
6c545ba340
the compile-fail-norustc hack is no longer needed
2019-07-31 15:29:55 +02:00
Ralf Jung
d5ca345c36
remove redundant tests / flags
2019-07-23 23:26:25 +02:00
Ralf Jung
3c1ab78196
review failing compile-fail tests
2019-07-23 23:25:06 +02:00
Ralf Jung
59190e8542
disable some compile-fail tests for rustc
2019-07-20 22:38:41 +02:00
Ralf Jung
95e6e671bf
fix compile-fail tests for latest rustc
2019-07-16 18:39:18 +02:00
Ralf Jung
4f6a56f54f
better error message when the program tries to spawn a thread
2019-07-06 10:07:21 +02:00
Ralf Jung
b29cb7d551
avoid catching errors
2019-07-03 10:56:25 +02:00
Ralf Jung
0bb50ada34
make sure we catch alignment problems even with intrptrcast
2019-06-29 14:31:54 +02:00
Christian Poveda
792d665a1f
Fix merge conflicts
2019-06-25 00:57:33 -05:00
Ralf Jung
7e7b5d42ba
Apply suggestions from code review
...
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
2019-06-24 14:50:27 +02:00
Ralf Jung
4d65aa8f20
expand and better explain alignment check tests
2019-06-24 08:40:45 +02:00
Ralf Jung
4dc188a60e
adjust for refactored memory pointer checks
2019-06-23 20:19:26 +02:00
Christian Poveda
e57447014d
Duplicate compile-fail tests for intptrcast
2019-06-21 16:32:54 -05:00
Ralf Jung
5472755f16
add a failing test where an immovable generator gets moved
2019-06-21 21:48:27 +02:00
Ralf Jung
04fa38dd1b
allow some inequality comparisons between pointers and integers
2019-06-20 16:38:55 +02:00
Ralf Jung
7ce36226e6
implement and test unchecked_{add,sub,mul} intrinsics
2019-06-16 11:10:33 +02:00
Ralf Jung
cf748149ce
test unchecked_rem
2019-06-16 11:10:33 +02:00
Ralf Jung
fc90124489
test exact_div UB detection
2019-06-16 11:10:33 +02:00
Ralf Jung
9f48b3029c
test that we cannot access unescaped static memory with a raw ptr
2019-06-02 22:16:02 +02:00
Ralf Jung
e03255d625
fix existing tests
...
fix thread-local example to no longer write to pointers derived from a shared ref;
fix compile-fail test
2019-06-02 22:16:02 +02:00
Ralf Jung
0dfc1c97c5
test weak_into_raw
2019-05-29 19:36:16 +02:00
Ralf Jung
f10ab1991c
fix error pattern
2019-05-27 19:37:31 +02:00
Ralf Jung
74f98b3803
test for new read rules
2019-05-21 15:43:18 +02:00
Ralf Jung
4b9e1544c2
give up on two-phase borrows
2019-05-17 15:02:31 +02:00
Ralf Jung
f676f2265b
make writes act stack-like
2019-05-15 18:12:58 +02:00
Ralf Jung
617195eb12
add arielby's example
2019-04-30 20:18:29 +02:00
Ralf Jung
d410b13139
fix compile-fail ref files
2019-04-21 13:18:05 +02:00
Ralf Jung
287ffb8bba
test another version of 'creating a shared ref must not leak the Unique'
2019-04-19 08:46:40 +02:00
Ralf Jung
7d9dc6e698
test that creating a 2nd mutable ref from a NonNull invalidates the first
2019-04-18 14:43:25 +02:00
Ralf Jung
e1ed855a44
more tests -- also one showing why we are not done yet
2019-04-17 16:02:57 +02:00
Ralf Jung
72cec0562c
add tests for fixes: sharing no longer leaks, and we can handle entering interior mutability
2019-04-17 16:02:57 +02:00
Ralf Jung
46d5fd8487
barriers are dead, long live protectors -- this enables overlapping two-phase borrows!
2019-04-17 16:02:57 +02:00
Ralf Jung
ef52be031c
adjust compile-fail error messages
...
This also passes miri-test-libstd!
2019-04-17 16:02:57 +02:00
Ralf Jung
6fdc75024b
Merge branch 'master' into rand
2019-04-16 20:55:58 +02:00
Ralf Jung
af2b42de0a
fix compile-fail test
2019-04-16 19:09:41 +02:00
Ralf Jung
ceca7c5020
tweak entropy tests a bit
2019-04-16 19:06:08 +02:00
Ralf Jung
a246116bdc
rustup
2019-04-14 10:30:00 +02:00
Aaron Hill
ae8e7f654a
Fix compile-fail error message
2019-04-09 10:19:29 -04:00
Aaron Hill
9243680588
Use 'ignore-' instead of 'only-'
...
Apparently 'ignore-' doesn't work with compiletest_rs
2019-04-08 23:52:33 -04:00
Aaron Hill
5e07ff6b1f
Only run 'getrandom' test on Linux
2019-04-08 23:16:13 -04:00
Aaron Hill
6d3e93c281
Refactor random number generation
2019-04-08 22:22:41 -04:00
Aaron Hill
5530d295ad
Simplify cast using as_mut_ptr()
2019-04-08 21:36:35 -04:00
Aaron Hill
73239573c9
Implement non-deterministc mode
...
Part of #653
This allows us to properly implement getrandom(),
which unlocks the default HashMap type (e.g. HashMap<K, V>)
with RandomState)
This commit adds a new '-Zmiri-seed=<seed>' option. When present,
this option takes a 64-bit hex value, which is used as the seed
to an internal PRNG. This PRNG is used to implement the 'getrandom()'
syscall.
When '-Zmiri-seed' is not passed, 'getrandom()' will be disabled.
2019-04-07 19:26:20 -04:00
Oliver Scherer
56c7656568
Remove dead code and docs
2019-03-11 10:28:03 +01:00
Alexander Regueiro
12d3ecbaff
Various cosmetic improvements.
2019-02-26 18:37:46 +00:00
Alexander Regueiro
a478bfebd2
Removed copyright notices.
2019-02-26 18:37:45 +00:00
Ralf Jung
3c652032c0
be more clear which stack we are talking about
2019-02-12 10:51:03 +01:00
Ralf Jung
48ac35f072
panic_impl is another way to panic
2019-02-06 11:41:45 +01:00
Ralf Jung
79bdec8a9c
fix test for latest nightly
2018-12-22 16:07:50 +01:00
Ralf Jung
7e9098ff69
treat ref-to-raw cast like a reborrow: do a special kind of retag
2018-12-12 11:11:20 +01:00
Ralf Jung
f044205b5f
the test suite assumes a libstd with full MIR; run test suite on xargo-built foreign libstds
2018-12-10 10:04:55 +01:00
Ralf Jung
bbdc3380d5
fix tests
2018-12-07 10:15:25 +01:00
Ralf Jung
36a2b89522
remove a whole lot of unnecessary attributes
2018-12-02 11:26:09 +01:00
Ralf Jung
58309956c1
for now, we allow Undef in raw pointers as we do in integers
2018-11-27 14:26:23 +01:00
Ralf Jung
7d623f73cc
do not use 'let _', it is strange
2018-11-26 15:31:53 +01:00
Ralf Jung
22f11b8eec
make tests compatible with 2018 edition
2018-11-20 14:15:14 +01:00
Ralf Jung
827e5180f2
stacked borrows is broken without full MIR
2018-11-16 10:01:54 +01:00