blob: c27ec97e06094fdbe1e2cb28a06211ea22886f7e [file]
// { dg-output "correct\r*" }
#![feature(no_core)]
#![no_core]
extern "C" {
fn puts(s: *const i8);
}
fn main() -> i32 {
let arr = [0, 4, 5, 6, 1];
let a: &[i32] = &arr;
let mut ret = 1;
match a {
[1, .., b] => {
/* should not take this path */
unsafe { puts("wrong\0" as *const str as *const i8) }
}
[0, .., 0] => {
/* should not take this path */
unsafe { puts("wrong\0" as *const str as *const i8) }
},
[0, .., b] => {
ret -= b;
unsafe { puts("correct\0" as *const str as *const i8) }
},
_ => {}
}
ret
}