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