2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2017-10-18 01:45:42 +00:00
|
|
|
//@ ignore-emscripten no no_std executables
|
2024-12-14 08:13:12 +00:00
|
|
|
//@ ignore-wasm different `main` convention
|
2017-06-19 19:40:51 +00:00
|
|
|
|
2014-09-16 02:29:47 +00:00
|
|
|
#![no_std]
|
2024-12-14 08:13:12 +00:00
|
|
|
#![no_main]
|
2014-09-16 02:29:47 +00:00
|
|
|
|
2024-12-14 08:13:12 +00:00
|
|
|
// Import global allocator and panic handler.
|
2015-03-27 17:58:12 +00:00
|
|
|
extern crate std as other;
|
2015-01-06 03:13:38 +00:00
|
|
|
|
2024-12-14 08:13:12 +00:00
|
|
|
#[macro_use] extern crate alloc;
|
2014-09-16 02:29:47 +00:00
|
|
|
|
2017-06-13 22:52:59 +00:00
|
|
|
use alloc::vec::Vec;
|
2014-09-16 02:29:47 +00:00
|
|
|
|
|
|
|
// Issue #16806
|
|
|
|
|
2024-12-14 08:13:12 +00:00
|
|
|
#[no_mangle]
|
|
|
|
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
|
2014-09-16 02:29:47 +00:00
|
|
|
let x: Vec<u8> = vec![0, 1, 2];
|
|
|
|
match x.last() {
|
|
|
|
Some(&2) => (),
|
|
|
|
_ => panic!(),
|
|
|
|
}
|
|
|
|
0
|
|
|
|
}
|