summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs')
-rw-r--r--src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs b/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
new file mode 100644
index 000000000..4785abbc5
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
@@ -0,0 +1,9 @@
+// run-pass
+#![allow(const_err)]
+
+// compile-flags: -O
+
+fn main() {
+ let x = &(0u32 - 1);
+ assert_eq!(*x, u32::MAX)
+}