1
- // skip-filecheck
2
1
#![ feature( custom_mir, core_intrinsics) ]
3
2
4
3
extern crate core;
@@ -7,6 +6,8 @@ use core::intrinsics::mir::*;
7
6
// EMIT_MIR debuginfo.pointee.built.after.mir
8
7
#[ custom_mir( dialect = "built" ) ]
9
8
fn pointee ( opt : & mut Option < i32 > ) {
9
+ // CHECK-LABEL: fn pointee(
10
+ // CHECK: debug foo => (((*_1) as variant#1).0: i32);
10
11
mir ! (
11
12
debug foo => Field :: <i32 >( Variant ( * opt, 1 ) , 0 ) ;
12
13
{
@@ -18,9 +19,12 @@ fn pointee(opt: &mut Option<i32>) {
18
19
// EMIT_MIR debuginfo.numbered.built.after.mir
19
20
#[ custom_mir( dialect = "analysis" , phase = "post-cleanup" ) ]
20
21
fn numbered ( i : ( u32 , i32 ) ) {
22
+ // CHECK-LABEL: fn numbered(
23
+ // CHECK: debug first => (_1.0: u32);
24
+ // CHECK: debug second => (_1.1: i32);
21
25
mir ! (
22
26
debug first => i. 0 ;
23
- debug second => i. 0 ;
27
+ debug second => i. 1 ;
24
28
{
25
29
Return ( )
26
30
}
@@ -32,6 +36,8 @@ struct S { x: f32 }
32
36
// EMIT_MIR debuginfo.structured.built.after.mir
33
37
#[ custom_mir( dialect = "analysis" , phase = "post-cleanup" ) ]
34
38
fn structured ( i : S ) {
39
+ // CHECK-LABEL: fn structured(
40
+ // CHECK: debug x => (_1.0: f32);
35
41
mir ! (
36
42
debug x => i. x;
37
43
{
@@ -43,6 +49,8 @@ fn structured(i: S) {
43
49
// EMIT_MIR debuginfo.variant.built.after.mir
44
50
#[ custom_mir( dialect = "built" ) ]
45
51
fn variant ( opt : Option < i32 > ) {
52
+ // CHECK-LABEL: fn variant(
53
+ // CHECK: debug inner => ((_1 as variant#1).0: i32);
46
54
mir ! (
47
55
debug inner => Field :: <i32 >( Variant ( opt, 1 ) , 0 ) ;
48
56
{
@@ -54,6 +62,9 @@ fn variant(opt: Option<i32>) {
54
62
// EMIT_MIR debuginfo.variant_deref.built.after.mir
55
63
#[ custom_mir( dialect = "built" ) ]
56
64
fn variant_deref ( opt : Option < & i32 > ) {
65
+ // CHECK-LABEL: fn variant_deref(
66
+ // CHECK: debug pointer => ((_1 as variant#1).0: &i32);
67
+ // CHECK: debug deref => (*((_1 as variant#1).0: &i32));
57
68
mir ! (
58
69
debug pointer => Field :: <& i32 >( Variant ( opt, 1 ) , 0 ) ;
59
70
debug deref => * Field :: <& i32 >( Variant ( opt, 1 ) , 0 ) ;
@@ -66,6 +77,8 @@ fn variant_deref(opt: Option<&i32>) {
66
77
// EMIT_MIR debuginfo.constant.built.after.mir
67
78
#[ custom_mir( dialect = "built" ) ]
68
79
fn constant ( ) {
80
+ // CHECK-LABEL: fn constant(
81
+ // CHECK: debug scalar => const 5_usize;
69
82
mir ! (
70
83
debug scalar => 5_usize ;
71
84
{
0 commit comments