2019-07-26 21:54:25 +00:00
|
|
|
//@ run-pass
|
2017-10-18 01:45:42 +00:00
|
|
|
//@ ignore-emscripten no no_std executables
|
2016-09-25 20:47:00 +00:00
|
|
|
|
2019-04-03 17:50:28 +00:00
|
|
|
#![feature(lang_items, start)]
|
2014-09-07 21:57:26 +00:00
|
|
|
#![no_std]
|
|
|
|
|
2015-03-27 17:58:12 +00:00
|
|
|
extern crate std as other;
|
2014-09-07 21:57:26 +00:00
|
|
|
|
2017-06-13 22:52:59 +00:00
|
|
|
#[macro_use] extern crate alloc;
|
2014-09-07 21:57:26 +00:00
|
|
|
|
2017-06-13 22:52:59 +00:00
|
|
|
use alloc::string::ToString;
|
2014-09-07 21:57:26 +00:00
|
|
|
|
|
|
|
#[start]
|
2015-03-26 00:06:52 +00:00
|
|
|
fn start(_argc: isize, _argv: *const *const u8) -> isize {
|
2015-02-18 10:42:01 +00:00
|
|
|
let s = format!("{}", 1_isize);
|
2014-09-07 21:57:26 +00:00
|
|
|
assert_eq!(s, "1".to_string());
|
|
|
|
|
|
|
|
let s = format!("test");
|
|
|
|
assert_eq!(s, "test".to_string());
|
|
|
|
|
2015-02-18 10:42:01 +00:00
|
|
|
let s = format!("{test}", test=3_isize);
|
2014-09-07 21:57:26 +00:00
|
|
|
assert_eq!(s, "3".to_string());
|
|
|
|
|
|
|
|
let s = format!("hello {}", "world");
|
|
|
|
assert_eq!(s, "hello world".to_string());
|
|
|
|
|
|
|
|
0
|
|
|
|
}
|