Skip to content

Commit

Permalink
FileCheck address_of_pair.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Dec 2, 2023
1 parent 0908f17 commit 378abbc
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/mir-opt/const_prop/address_of_pair.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
// skip-filecheck
// unit-test: ConstProp

// EMIT_MIR address_of_pair.fn0.ConstProp.diff
pub fn fn0() -> bool {
// CHECK-LABEL: fn fn0(
// CHECK: debug pair => [[pair:_.*]];
// CHECK: debug ptr => [[ptr:_.*]];
// CHECK: debug ret => [[ret:_.*]];
// CHECK: (*[[ptr]]) = const true;
// CHECK-NOT: = const false;
// CHECK-NOT: = const true;
// CHECK: [[tmp:_.*]] = ([[pair]].1: bool);
// CHECK-NOT: = const false;
// CHECK-NOT: = const true;
// CHECK: [[ret]] = Not(move [[tmp]]);
// CHECK-NOT: = const false;
// CHECK-NOT: = const true;
// CHECK: _0 = [[ret]];
let mut pair = (1, false);
let ptr = core::ptr::addr_of_mut!(pair.1);
pair = (1, false);
Expand Down

0 comments on commit 378abbc

Please sign in to comment.