aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/deadcode_err2.rs
blob: 832fe998466054723608baa39277cfa69a28f075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn foo() -> i32 {
    return 1;
    return 1.5; // { dg-error "mismatched types, expected .i32. but got .<float>." }
    // { dg-warning "unreachable statement" "" { target *-*-* } .-1 } 
}

fn bar() -> i32 {
    return 1.5; // { dg-error "mismatched types, expected .i32. but got .<float>." }
    return 1;
    // { dg-warning "unreachable statement" "" { target *-*-* } .-1 } 
}

fn main() {
    foo();
    bar();
}