rust/tests/compile-fail/intrinsics
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
..
assume.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
copy_null.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
copy_overflow.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
copy_overlapping.rs move error-pattern to inline annotation where possible 2020-04-12 12:01:20 +02:00
copy_unaligned.rs move error-pattern to inline annotation where possible 2020-04-12 12:01:20 +02:00
ctlz_nonzero.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
cttz_nonzero.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
div-by-zero-1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
div-by-zero-2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
exact_div1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
exact_div2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
exact_div3.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
exact_div4.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
float_to_int_32_inf1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_infneg1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_nan.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_nanneg.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_neg.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_too_big1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_too_big2.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_32_too_small1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_inf1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_infneg1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_infneg2.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_nan.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_neg.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_big1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_big2.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_big3.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_big4.rs use u128::MAX symbolic name 2020-04-18 10:11:45 +02:00
float_to_int_64_too_big5.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_small1.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_small2.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
float_to_int_64_too_small3.rs add tests for invalid float-to-int casts 2020-04-12 12:01:20 +02:00
out_of_bounds_ptr_1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
out_of_bounds_ptr_2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
overflowing-unchecked-rsh.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
ptr_offset_0_plus_0.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
ptr_offset_int_plus_int.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
ptr_offset_int_plus_ptr.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
ptr_offset_overflow.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
ptr_offset_ptr_plus_0.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_add1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_add2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_div1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_mul1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_mul2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_sub1.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
unchecked_sub2.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
uninit_uninhabited_type.rs 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
write_bytes_null.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
write_bytes_overflow.rs organize compile-fail tests in folders 2020-04-11 11:36:55 +02:00
zero_fn_ptr.rs 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