summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/lower_intrinsics.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/mir-opt/lower_intrinsics.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/lower_intrinsics.rs')
-rw-r--r--tests/mir-opt/lower_intrinsics.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs
index 0ca88a42e..0758e9b77 100644
--- a/tests/mir-opt/lower_intrinsics.rs
+++ b/tests/mir-opt/lower_intrinsics.rs
@@ -1,5 +1,5 @@
// unit-test: LowerIntrinsics
-// ignore-wasm32 compiled with panic=abort by default
+// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
#![feature(core_intrinsics, intrinsics, rustc_attrs)]
#![crate_type = "lib"]
@@ -11,6 +11,17 @@ pub fn wrapping(a: i32, b: i32) {
let _z = core::intrinsics::wrapping_mul(a, b);
}
+// EMIT_MIR lower_intrinsics.unchecked.LowerIntrinsics.diff
+pub unsafe fn unchecked(a: i32, b: i32) {
+ let _a = core::intrinsics::unchecked_add(a, b);
+ let _b = core::intrinsics::unchecked_sub(a, b);
+ let _c = core::intrinsics::unchecked_mul(a, b);
+ let _x = core::intrinsics::unchecked_div(a, b);
+ let _y = core::intrinsics::unchecked_rem(a, b);
+ let _i = core::intrinsics::unchecked_shl(a, b);
+ let _j = core::intrinsics::unchecked_shr(a, b);
+}
+
// EMIT_MIR lower_intrinsics.size_of.LowerIntrinsics.diff
pub fn size_of<T>() -> usize {
core::intrinsics::size_of::<T>()