summaryrefslogtreecommitdiffstats
path: root/tests/ui/numbers-arithmetic
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
commit023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch)
tree60fc59477c605c72b0a1051409062ddecc43f877 /tests/ui/numbers-arithmetic
parentAdding debian version 1.72.1+dfsg1-1. (diff)
downloadrustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz
rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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