about summary refs log tree commit diff
path: root/tests/ui/codegen/unsupported-static-initializer-in-const-array.rs
blob: bc94130ee199a709c0bc405efaabad50ad8e48f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! LLVM error with unsupported expression in static
//! initializer for const pointer in array on macOS.
//!
//! Regression test for <https://github.com/rust-lang/rust/issues/89225>.

//@ build-pass
//@ compile-flags: -C opt-level=3

const fn make() -> (i32, i32, *const i32) {
    const V: i32 = 123;
    &V as *const i32;
    (0, 0, &V)
}

fn main() {
    let arr = [make(); 32];
    println!("{}", arr[0].0);
}