Skip to content

Commit f5ddec8

Browse files
committed
FileCheck debuginfo.
1 parent 775d1c0 commit f5ddec8

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

tests/mir-opt/building/custom/debuginfo.numbered.built.after.mir

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn numbered(_1: (u32, i32)) -> () {
44
debug first => (_1.0: u32);
5-
debug second => (_1.0: u32);
5+
debug second => (_1.1: i32);
66
let mut _0: ();
77

88
bb0: {

tests/mir-opt/building/custom/debuginfo.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
#![feature(custom_mir, core_intrinsics)]
32

43
extern crate core;
@@ -7,6 +6,8 @@ use core::intrinsics::mir::*;
76
// EMIT_MIR debuginfo.pointee.built.after.mir
87
#[custom_mir(dialect = "built")]
98
fn pointee(opt: &mut Option<i32>) {
9+
// CHECK-LABEL: fn pointee(
10+
// CHECK: debug foo => (((*_1) as variant#1).0: i32);
1011
mir!(
1112
debug foo => Field::<i32>(Variant(*opt, 1), 0);
1213
{
@@ -18,9 +19,12 @@ fn pointee(opt: &mut Option<i32>) {
1819
// EMIT_MIR debuginfo.numbered.built.after.mir
1920
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
2021
fn numbered(i: (u32, i32)) {
22+
// CHECK-LABEL: fn numbered(
23+
// CHECK: debug first => (_1.0: u32);
24+
// CHECK: debug second => (_1.1: i32);
2125
mir!(
2226
debug first => i.0;
23-
debug second => i.0;
27+
debug second => i.1;
2428
{
2529
Return()
2630
}
@@ -32,6 +36,8 @@ struct S { x: f32 }
3236
// EMIT_MIR debuginfo.structured.built.after.mir
3337
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
3438
fn structured(i: S) {
39+
// CHECK-LABEL: fn structured(
40+
// CHECK: debug x => (_1.0: f32);
3541
mir!(
3642
debug x => i.x;
3743
{
@@ -43,6 +49,8 @@ fn structured(i: S) {
4349
// EMIT_MIR debuginfo.variant.built.after.mir
4450
#[custom_mir(dialect = "built")]
4551
fn variant(opt: Option<i32>) {
52+
// CHECK-LABEL: fn variant(
53+
// CHECK: debug inner => ((_1 as variant#1).0: i32);
4654
mir!(
4755
debug inner => Field::<i32>(Variant(opt, 1), 0);
4856
{
@@ -54,6 +62,9 @@ fn variant(opt: Option<i32>) {
5462
// EMIT_MIR debuginfo.variant_deref.built.after.mir
5563
#[custom_mir(dialect = "built")]
5664
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));
5768
mir!(
5869
debug pointer => Field::<&i32>(Variant(opt, 1), 0);
5970
debug deref => *Field::<&i32>(Variant(opt, 1), 0);
@@ -66,6 +77,8 @@ fn variant_deref(opt: Option<&i32>) {
6677
// EMIT_MIR debuginfo.constant.built.after.mir
6778
#[custom_mir(dialect = "built")]
6879
fn constant() {
80+
// CHECK-LABEL: fn constant(
81+
// CHECK: debug scalar => const 5_usize;
6982
mir!(
7083
debug scalar => 5_usize;
7184
{

0 commit comments

Comments
 (0)