about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/derived_ord.{impl#0}-partial_cmp.PreCodegen.after.mir
blob: 5993bd79d274c4e62666b5e2b9a6c821955f407f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// MIR for `<impl at $DIR/derived_ord.rs:5:10: 5:20>::partial_cmp` after PreCodegen

fn <impl at $DIR/derived_ord.rs:5:10: 5:20>::partial_cmp(_1: &MultiField, _2: &MultiField) -> Option<std::cmp::Ordering> {
    debug self => _1;
    debug other => _2;
    let mut _0: std::option::Option<std::cmp::Ordering>;
    let mut _6: i8;
    scope 1 {
        debug cmp => _0;
    }
    scope 2 (inlined std::cmp::impls::<impl PartialOrd for char>::partial_cmp) {
        let mut _3: char;
        let mut _4: char;
        let mut _5: std::cmp::Ordering;
    }
    scope 3 (inlined std::cmp::impls::<impl PartialOrd for i16>::partial_cmp) {
        let mut _7: i16;
        let mut _8: i16;
        let mut _9: std::cmp::Ordering;
    }

    bb0: {
        StorageLive(_3);
        _3 = copy ((*_1).0: char);
        StorageLive(_4);
        _4 = copy ((*_2).0: char);
        _5 = Cmp(move _3, move _4);
        StorageDead(_4);
        StorageDead(_3);
        _0 = Option::<std::cmp::Ordering>::Some(copy _5);
        _6 = discriminant(_5);
        switchInt(move _6) -> [0: bb1, otherwise: bb2];
    }

    bb1: {
        StorageLive(_9);
        StorageLive(_7);
        _7 = copy ((*_1).1: i16);
        StorageLive(_8);
        _8 = copy ((*_2).1: i16);
        _9 = Cmp(move _7, move _8);
        StorageDead(_8);
        StorageDead(_7);
        _0 = Option::<std::cmp::Ordering>::Some(move _9);
        StorageDead(_9);
        goto -> bb3;
    }

    bb2: {
        goto -> bb3;
    }

    bb3: {
        return;
    }
}