about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2018-08-26 15:13:01 +0200
committerRalf Jung <post@ralfj.de>2018-08-28 19:57:05 +0200
commite6a5a9418a35b4bfb9681123838fce58130bfd1f (patch)
tree18678f7cdba75a44fb55e7535d2068d7dcc5dfb4 /src/test
parent066d2eea250c9010358392c93ef40f36cbb9930b (diff)
downloadrust-e6a5a9418a35b4bfb9681123838fce58130bfd1f.tar.gz
rust-e6a5a9418a35b4bfb9681123838fce58130bfd1f.zip
restructure unary_op to also dispatch on type first; fix promotion with unary '-' overflowing
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/ctfe/promotion.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/run-pass/ctfe/promotion.rs b/src/test/run-pass/ctfe/promotion.rs
index 2d228408254..28b876c308b 100644
--- a/src/test/run-pass/ctfe/promotion.rs
+++ b/src/test/run-pass/ctfe/promotion.rs
@@ -8,10 +8,18 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -O
+
 fn foo(_: &'static [&'static str]) {}
 fn bar(_: &'static [&'static str; 3]) {}
+fn baz_i32(_: &'static i32) {}
+fn baz_u32(_: &'static u32) {}
 
 fn main() {
     foo(&["a", "b", "c"]);
     bar(&["d", "e", "f"]);
+
+    // make sure that these do not cause trouble despite overflowing
+    baz_u32(&(0-1));
+    baz_i32(&-std::i32::MIN);
 }