Commit Graph

110 Commits

Author SHA1 Message Date
Ralf Jung
ea730ab20f update tests for new allocator API 2017-07-10 16:15:58 -07:00
Ralf Jung
3c0a6d6922 simplify reallocate 2017-07-10 13:34:54 -07:00
Oliver Schneider
b8bd42e8d4 Merge pull request #234 from RalfJung/reallocate
Make Reallocate & Deallocate less permissive
2017-07-05 19:54:54 +02:00
Oliver Schneider
10ec543b9e Merge pull request #235 from RalfJung/intrinsics
Implement some missing intrinsics
2017-07-04 08:38:22 +02:00
Ralf Jung
19d6ad74e5 add test for div-by-zero with the operator (rather than the intrinsic) 2017-07-03 20:59:47 -07:00
Ralf Jung
30f92f8a27 catch overflows that are hidden by first casting the RHS to u32 2017-07-03 20:50:19 -07:00
Ralf Jung
ffd482e2f5 check the assumptions made by the unchecked_ and copy_nonoverlapping intrinsics 2017-07-03 20:37:38 -07:00
Ralf Jung
440c4778fa validate size and alignment on reallocate and deallocate 2017-07-03 16:47:58 -07:00
Ralf Jung
bdcdb605a4 fix test on i686 2017-07-03 16:16:05 -07:00
Ralf Jung
dc9f5a205f properly check for: double-free, use-after-reallocate 2017-07-03 16:12:11 -07:00
Ralf Jung
030166757c Fix transmute on ByValPair
Fixes #227
2017-07-03 13:58:50 -07:00
Oliver Schneider
42d3edada7 Merge pull request #220 from oli-obk/undo_single_field_opt
Remove the `field` field from `Lvalue::Local`
2017-06-28 10:15:36 +02:00
David Renshaw
54821102b4 update tests for new error message 2017-06-27 21:31:38 -04:00
Oliver Schneider
5dfaacf310 Simplify all the code 2017-06-27 13:36:41 +02:00
Ralf Jung
4e90e3bcf6 remove redundant test 2017-06-24 11:05:13 -07:00
Ralf Jung
b1acc130bb check alignment of pointers on Ref 2017-06-24 11:05:13 -07:00
Ralf Jung
f0c8df2291 handle ptr-int casts explicitly in cast.rs 2017-06-24 11:05:13 -07:00
Ralf Jung
7b7f690274 Make sure that casting a ptr-integer down to u8 makes it unusable 2017-06-24 11:05:13 -07:00
Oliver Schneider
4aca1d0e0b Make zst compile-fail tests more readable 2017-06-24 12:46:35 +02:00
Oliver Schneider
377fcce9b8 Ensure tests run with and without full MIR 2017-06-23 16:41:56 +02:00
Oliver Schneider
9be3e9185b Remove the zst allocation 2017-06-23 12:55:49 +02:00
Ralf Jung
12935b6514 add some compile-fail tests 2017-06-22 14:46:53 -07:00
Ralf Jung
14cb31fb88 permit bit-anding in pointer values below the alignment
This makes HashMap work!
2017-06-22 14:46:53 -07:00
Ralf Jung
2f61356858 permit offsetting a NULL-ptr by 0, to fix hashmap test 2017-06-22 13:41:13 -07:00
Ralf Jung
6eafb10b87 add test for function pointer offsets 2017-06-21 21:54:42 -07:00
Oliver Schneider
a6cd7a2e08 Also move some compile-fail tests to fullmir-only 2017-06-21 15:07:40 +02:00
Oliver Schneider
fcf495821e
Get rid of the integer allocation 2017-06-20 14:28:18 +02:00
Ralf Jung
3e1596d8c9 Error out when "primitive MIR math" (as opposed to unchecked intrinsics) overflows
Fixes #178
2017-06-07 15:39:44 -07:00
Ralf Jung
36505c7b40 fix bitops being accidentally allowed on pointers from the same allocation 2017-06-05 17:17:16 -07:00
Ralf Jung
2a231d66fc check bounds when using offset intrinsic or MIR op 2017-06-05 14:27:26 -07:00
Ralf Jung
f39e015163 check for overflow when doing pointer arithmetic 2017-06-05 14:23:35 -07:00
Ralf Jung
1d0e622a81 test that we cannot observe the bytes representing a pointer 2017-06-05 14:23:35 -07:00
Ralf Jung
44a45f7c34 run test suite also against libstd with full MIR 2017-05-31 13:39:40 -07:00
Ralf Jung
1241938f97 test suite now also passes on MIR-libstd
Also enable some tests that were disabled for no apparant reason.
(The comment in zst.rs was wrong, the test was disabled also for miri execution.)
Delete env_args test as the args can actually be queried with MIR-libstd (currently, they are always empty)
2017-05-30 10:41:38 -07:00
Ralf Jung
99433a1ffd improve fn pointer signature check to allow some casts that should be permitted
Also properly check the "non-capturing Fn to fn" case
2017-05-30 10:41:38 -07:00
Ralf Jung
cd6e3e6431 If a "start" lang item incl. MIR is present, run that instead of running main directly
This fixes the memory leaks when running a simple "Hello World" with MIR-libstd
2017-05-30 10:41:38 -07:00
Oliver Schneider
257ac5803f Don't unconditionally mask bitshift rhs 2017-03-14 14:24:16 +01:00
Oliver Schneider
8405770b51 Rustup to rustc 1.17.0-nightly (be760566c 2017-02-28) 2017-03-02 13:11:33 +01:00
Oliver Schneider
38d16ccacc
add test with an Rc cycle to create a memleak 2017-02-24 10:41:15 +01:00
Oliver Schneider
5829483f4d
add a test for the memory leak error 2017-02-24 10:41:15 +01:00
Oliver Schneider
0f183dc866 we cannot panic, thus panicking always returns false 2017-02-09 15:07:50 +01:00
Oliver Schneider
fb2d393427 update tests 2017-02-09 10:59:42 +01:00
Oliver Schneider
98cda6cb07 freeze -> static 2017-02-07 20:28:54 +01:00
Oliver Schneider
148c6de507 fix some unaligned reads 2017-01-31 10:36:46 +01:00
Oliver Schneider
548a6baec0
also test transmutes to empty enums 2017-01-12 11:23:44 +01:00
Oliver Schneider
b5f824fd9c
fix ICE when transmuting inhabited types to uninhabited 2017-01-12 09:59:00 +01:00
Oliver Schneider
753dbcf158
add a test for dereferencing a pointer to a ! 2017-01-12 09:41:36 +01:00
Oliver Schneider
ae7d69a5bd
msvc has different internals for mutexes and thus fails on a different function 2017-01-12 08:41:57 +01:00
Scott Olson
42239e69bf Make layout SizeOverflow test trigger on i686. 2016-12-16 23:57:46 -08:00
Oliver Schneider
986b3a07c2
layout computation can fail, make it fail with a miri error 2016-11-18 10:38:07 +01:00