summary refs log tree commit diff
path: root/src/test/ui/consts/promotion.rs
blob: 5f84030a9e96b4d0f68afaca43b23b5bd353dca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// check-pass

// compile-flags: -O

fn foo(_: &'static [&'static str]) {}
fn bar(_: &'static [&'static str; 3]) {}
fn baz_i32(_: &'static i32) {}
fn baz_u32(_: &'static u32) {}

fn main() {
    foo(&["a", "b", "c"]);
    bar(&["d", "e", "f"]);

    // make sure that these do not cause trouble despite overflowing
    baz_u32(&(0-1));
    baz_i32(&-std::i32::MIN);
}