3 // compile-flags: -Z thinlto -C codegen-units=8 -O
4 // ignore-emscripten can't inspect instructions on emscripten
6 // We want to assert here that ThinLTO will inline across codegen units. There's
7 // not really a great way to do that in general so we sort of hack around it by
8 // praying two functions go into separate codegen units and then assuming that
9 // if inlining *doesn't* happen the first byte of the functions will differ.
22 println!("{} {}", foo(), bar::bar());
25 let foo = foo as usize as *const u8;
26 let bar = bar::bar as usize as *const u8;
28 assert_eq!(*foo, *bar);