]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/lower_intrinsics_e2e.rs
Remove astconv usage in diagnostic
[rust.git] / tests / mir-opt / lower_intrinsics_e2e.rs
1 // Checks that we do not have any branches in the MIR for the two tested functions.
2
3 // compile-flags: -Cpanic=abort
4 #![feature(core_intrinsics)]
5 #![crate_type = "lib"]
6
7 // EMIT_MIR lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
8 pub fn f_unit() {
9     f_dispatch(());
10 }
11
12
13 // EMIT_MIR lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
14 pub fn f_u64() {
15     f_dispatch(0u64);
16 }
17
18 #[inline(always)]
19 pub fn f_dispatch<T>(t: T) {
20     if std::mem::size_of::<T>() == 0 {
21         f_zst(t);
22     } else {
23         f_non_zst(t);
24     }
25 }
26
27 #[inline(never)]
28 pub fn f_zst<T>(_t: T) {
29 }
30
31 #[inline(never)]
32 pub fn f_non_zst<T>(_t: T) {}