summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/int-abs-overflow.rs
blob: d63ba8cb03e9a069b855553ad26e151df620712e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
// compile-flags: -C overflow-checks=on
// ignore-emscripten no threads support
// needs-unwind

use std::thread;

fn main() {
    assert!(thread::spawn(|| i8::MIN.abs()).join().is_err());
    assert!(thread::spawn(|| i16::MIN.abs()).join().is_err());
    assert!(thread::spawn(|| i32::MIN.abs()).join().is_err());
    assert!(thread::spawn(|| i64::MIN.abs()).join().is_err());
    assert!(thread::spawn(|| isize::MIN.abs()).join().is_err());
}