2021-03-11 22:55:11 +01:00
|
|
|
//@ run-pass
|
2024-05-04 16:21:50 +02:00
|
|
|
//@ compile-flags: -Ccodegen-units=1 -Cllvm-args=--inline-threshold=0 -Clink-dead-code -Copt-level=0 -Cdebuginfo=2
|
2021-03-11 22:55:11 +01:00
|
|
|
|
|
|
|
// Make sure LLVM does not miscompile this.
|
|
|
|
|
|
|
|
fn make_string(ch: char) -> String {
|
|
|
|
let mut bytes = [0u8; 4];
|
|
|
|
ch.encode_utf8(&mut bytes).into()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let ch = '😃';
|
|
|
|
dbg!(ch);
|
|
|
|
let string = make_string(ch);
|
|
|
|
dbg!(string);
|
|
|
|
}
|