summaryrefslogtreecommitdiffstats
path: root/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/numbers-arithmetic/promoted_overflow_opt.rs')
-rw-r--r--tests/ui/numbers-arithmetic/promoted_overflow_opt.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs b/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs
new file mode 100644
index 000000000..76279e913
--- /dev/null
+++ b/tests/ui/numbers-arithmetic/promoted_overflow_opt.rs
@@ -0,0 +1,8 @@
+// run-pass
+
+// compile-flags: -O
+
+fn main() {
+ let x = &(0u32 - 1);
+ assert_eq!(*x, u32::MAX)
+}