aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/const_fold1.rs
blob: 3cd6c0c77b5126056d35b411485705d7317ab4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// { dg-additional-options "-w" }
const fn const_fn() -> usize {
    4
}

const FN_TEST: usize = const_fn();

const TEST: usize = 2 + FN_TEST;

fn main() -> i32 {
    let a: [_; 12] = [5; TEST * 2];
    a[6] - 5
}