Skip to content

Commit 479e8aa

Browse files
authored
Unrolled build for rust-lang#121865
Rollup merge of rust-lang#121865 - Kirandevraj:unnamed-fields-filecheck, r=oli-obk Add FileCheck annotations to MIR-opt unnamed-fields tests Part of rust-lang#116971 Adds filecheck annotations to unnamed-fields mir-opt tests in `tests/mir-opt/unnamed-fields`
2 parents 0fa7fea + ba70528 commit 479e8aa

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

tests/mir-opt/unnamed-fields/field_access.rs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// skip-filecheck
1+
// Tests the correct handling of unnamed fields within structs and unions marked with #[repr(C)].
2+
23
// EMIT_MIR field_access.foo.SimplifyCfg-initial.after.mir
34
// EMIT_MIR field_access.bar.SimplifyCfg-initial.after.mir
45

@@ -36,18 +37,36 @@ union Bar {
3637

3738
fn access<T>(_: T) {}
3839

40+
// CHECK-LABEL: fn foo(
3941
fn foo(foo: Foo) {
42+
// CHECK [[a:_.*]] = (_1.0: u8);
43+
// CHECK _.* = access::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
4044
access(foo.a);
45+
// CHECK [[b:_.*]] = ((_1.1: Foo::{anon_adt#0}).0: i8);
46+
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
4147
access(foo.b);
48+
// CHECK [[c:_.*]] = ((_1.1: Foo::{anon_adt#0}).1: bool);
49+
// CHECK _.* = access::<bool>(move [[c]]) -> [return: bb3, unwind: bb5];
4250
access(foo.c);
51+
// CHECK [[d:_.*]] = (((_1.2: Foo::{anon_adt#1}).0: Foo::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]);
52+
// CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5];
4353
access(foo.d);
4454
}
4555

56+
// CHECK-LABEL: fn bar(
4657
fn bar(bar: Bar) {
4758
unsafe {
59+
// CHECK [[a:_.*]] = (_1.0: u8);
60+
// CHECK _.* = access::<u8>(move [[a]]) -> [return: bb1, unwind: bb5];
4861
access(bar.a);
62+
// CHECK [[b:_.*]] = ((_1.1: Bar::{anon_adt#0}).0: i8);
63+
// CHECK _.* = access::<i8>(move [[b]]) -> [return: bb2, unwind: bb5];
4964
access(bar.b);
65+
// CHECK [[c:_.*]] = ((_1.1: Bar::{anon_adt#0}).1: bool);
66+
// CHECK _.* = access::<bool>(move [[c]]) -> [return: bb3, unwind: bb5];
5067
access(bar.c);
68+
// CHECK [[d:_.*]] = (((_1.2: Bar::{anon_adt#1}).0: Bar::{anon_adt#1}::{anon_adt#0}).0: [u8; 1]);
69+
// CHECK _.* = access::<[u8; 1]>(move [[d]]) -> [return: bb4, unwind: bb5];
5170
access(bar.d);
5271
}
5372
}

0 commit comments

Comments
 (0)