aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/block_expr1.rs
blob: 011cc1fc89d59ebe30cc4ad7843bec255c58ce1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fn test3(x: i32) -> i32 {
    if x > 1 {
        5
    } else {
        0
    }
}

fn test5(x: i32) -> i32 {
    if x > 1 {
        if x == 5 {
            7
        } else {
            9
        }
    } else {
        0
    }
}

fn main() {
    let call3: i32 = { test3(3) + 2 };
    // { dg-warning "unused name" "" { target *-*-* } .-1 }
    let call5 = {
        // { dg-warning "unused name" "" { target *-*-* } .-1 }
        let a = test5(5);
        a + 1
    };
}