summaryrefslogtreecommitdiffstats
path: root/tests/ui/numbers-arithmetic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/numbers-arithmetic')
-rw-r--r--tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs15
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-add.rs3
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-mul.rs3
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs2
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-neg.rs2
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-pow-signed.rs3
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs3
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-sub.rs3
8 files changed, 27 insertions, 7 deletions
diff --git a/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs b/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
new file mode 100644
index 000000000..64ff1f8b1
--- /dev/null
+++ b/tests/ui/numbers-arithmetic/apfloat-modulo-wrong.rs
@@ -0,0 +1,15 @@
+// run-pass
+// check-run-results
+// regression test for issue #109567
+
+fn f() -> f64 {
+ std::hint::black_box(-1.0) % std::hint::black_box(-1.0)
+}
+
+const G: f64 = -1.0 % -1.0;
+
+pub fn main() {
+ assert_eq!(-1, G.signum() as i32);
+ assert_eq!((-0.0_f64).to_bits(), G.to_bits());
+ assert_eq!(f().signum(), G.signum());
+}
diff --git a/tests/ui/numbers-arithmetic/overflowing-add.rs b/tests/ui/numbers-arithmetic/overflowing-add.rs
index b0f22a74b..c45b44966 100644
--- a/tests/ui/numbers-arithmetic/overflowing-add.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-add.rs
@@ -1,5 +1,6 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to add with overflow'
+// error-pattern:thread 'main' panicked
+// error-pattern:attempt to add with overflow
// compile-flags: -C debug-assertions
// ignore-emscripten no processes
diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.rs b/tests/ui/numbers-arithmetic/overflowing-mul.rs
index 34ab5d8fa..ec5279d32 100644
--- a/tests/ui/numbers-arithmetic/overflowing-mul.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-mul.rs
@@ -1,5 +1,6 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// error-pattern:thread 'main' panicked
+// error-pattern:attempt to multiply with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions
diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
index 565b7e86f..dabb0d50c 100644
--- a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
@@ -1,5 +1,5 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
+// error-pattern:attempt to negate with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions
diff --git a/tests/ui/numbers-arithmetic/overflowing-neg.rs b/tests/ui/numbers-arithmetic/overflowing-neg.rs
index df1198053..530243753 100644
--- a/tests/ui/numbers-arithmetic/overflowing-neg.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-neg.rs
@@ -1,5 +1,5 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to negate with overflow'
+// error-pattern:attempt to negate with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions
diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
index b59efe6f2..c2c8cad5f 100644
--- a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
@@ -1,5 +1,6 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// error-pattern:thread 'main' panicked
+// error-pattern:attempt to multiply with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions
diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
index f2643c164..4a0f9abd9 100644
--- a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
@@ -1,5 +1,6 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to multiply with overflow'
+// error-pattern:thread 'main' panicked
+// error-pattern:attempt to multiply with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions
diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.rs b/tests/ui/numbers-arithmetic/overflowing-sub.rs
index 66685ac96..119d80748 100644
--- a/tests/ui/numbers-arithmetic/overflowing-sub.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-sub.rs
@@ -1,5 +1,6 @@
// run-fail
-// error-pattern:thread 'main' panicked at 'attempt to subtract with overflow'
+// error-pattern:thread 'main' panicked
+// error-pattern:attempt to subtract with overflow
// ignore-emscripten no processes
// compile-flags: -C debug-assertions