diff options
| author | Peter Reid <peter.d.reid@gmail.com> | 2015-09-13 22:19:36 -0400 |
|---|---|---|
| committer | Peter Reid <peter.d.reid@gmail.com> | 2015-09-13 22:19:36 -0400 |
| commit | a593a211fe71e82b3f87dd16fb25831fb8a00442 (patch) | |
| tree | fbe9f5de29fbe3a89d7814c1c0b20c0e5f4ad9f3 /src/test/run-fail | |
| parent | 1927a869d4917cb7bf47cc069dde574e01c26de3 (diff) | |
| download | rust-a593a211fe71e82b3f87dd16fb25831fb8a00442.tar.gz rust-a593a211fe71e82b3f87dd16fb25831fb8a00442.zip | |
Add test for overflowing pow
This would catch regressions of issue #28012.
Diffstat (limited to 'src/test/run-fail')
| -rw-r--r-- | src/test/run-fail/overflowing-pow.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/run-fail/overflowing-pow.rs b/src/test/run-fail/overflowing-pow.rs new file mode 100644 index 00000000000..15335b8dfb1 --- /dev/null +++ b/src/test/run-fail/overflowing-pow.rs @@ -0,0 +1,16 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern:thread '<main>' panicked at 'arithmetic operation overflowed' +// compile-flags: -C debug-assertions + +fn main() { + let _x = 2i32.pow(1024); +} |
