Skip to content

Commit e99115a

Browse files
committed
Update test expectations
1 parent a0a731e commit e99115a

14 files changed

Lines changed: 28 additions & 10 deletions

tests/unit/out/unsafe/anonymous-struct.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,48 @@ use std::collections::BTreeMap;
66
use std::io::{Read, Seek, Write};
77
use std::os::fd::{AsFd, FromRawFd, IntoRawFd};
88
use std::rc::Rc;
9+
#[repr(C)]
910
#[derive(Copy, Clone, Default)]
1011
pub struct Outer_Named {
1112
pub a: i32,
1213
pub b: i32,
1314
}
15+
#[repr(C)]
1416
#[derive(Copy, Clone, Default)]
1517
pub struct Outer_anon_0 {
1618
pub c: i32,
1719
pub d: i32,
1820
}
21+
#[repr(C)]
1922
#[derive(Copy, Clone, Default)]
2023
pub struct Outer_anon_1 {
2124
pub g: i32,
2225
pub h: i32,
2326
}
27+
#[repr(C)]
2428
#[derive(Copy, Clone, Default)]
2529
pub struct Outer_anon_2 {
2630
pub e: i32,
2731
pub f: i32,
2832
}
33+
#[repr(C)]
2934
#[derive(Copy, Clone, Default)]
3035
pub struct Outer_anon_3_anon_0 {
3136
pub j: i32,
3237
}
38+
#[repr(C)]
3339
#[derive(Copy, Clone, Default)]
3440
pub struct Outer_anon_3_anon_1 {
3541
pub k: i32,
3642
}
43+
#[repr(C)]
3744
#[derive(Copy, Clone, Default)]
3845
pub struct Outer_anon_3 {
3946
pub i: i32,
4047
pub inner_named: Outer_anon_3_anon_0,
4148
pub anon_1: Outer_anon_3_anon_1,
4249
}
50+
#[repr(C)]
4351
#[derive(Copy, Clone, Default)]
4452
pub struct Outer {
4553
pub named: Outer_Named,
@@ -87,6 +95,7 @@ unsafe fn main_0() -> i32 {
8795
assert!(((o.anon_3.i) == (9)));
8896
assert!(((o.anon_3.inner_named.j) == (10)));
8997
assert!(((o.anon_3.anon_1.k) == (11)));
98+
#[repr(C)]
9099
#[derive(Copy, Clone, Default)]
91100
pub struct anon_0 {
92101
pub x: i32,

tests/unit/out/unsafe/anonymous-struct_c.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,48 @@ use std::collections::BTreeMap;
66
use std::io::{Read, Seek, Write};
77
use std::os::fd::{AsFd, FromRawFd, IntoRawFd};
88
use std::rc::Rc;
9+
#[repr(C)]
910
#[derive(Copy, Clone, Default)]
1011
pub struct Named {
1112
pub a: i32,
1213
pub b: i32,
1314
}
15+
#[repr(C)]
1416
#[derive(Copy, Clone, Default)]
1517
pub struct Outer_anon_0 {
1618
pub c: i32,
1719
pub d: i32,
1820
}
21+
#[repr(C)]
1922
#[derive(Copy, Clone, Default)]
2023
pub struct Outer_anon_1 {
2124
pub g: i32,
2225
pub h: i32,
2326
}
27+
#[repr(C)]
2428
#[derive(Copy, Clone, Default)]
2529
pub struct Outer_anon_2 {
2630
pub e: i32,
2731
pub f: i32,
2832
}
33+
#[repr(C)]
2934
#[derive(Copy, Clone, Default)]
3035
pub struct Outer_anon_3_anon_0 {
3136
pub j: i32,
3237
}
38+
#[repr(C)]
3339
#[derive(Copy, Clone, Default)]
3440
pub struct Outer_anon_3_anon_1 {
3541
pub k: i32,
3642
}
43+
#[repr(C)]
3744
#[derive(Copy, Clone, Default)]
3845
pub struct Outer_anon_3 {
3946
pub i: i32,
4047
pub inner_named: Outer_anon_3_anon_0,
4148
pub anon_1: Outer_anon_3_anon_1,
4249
}
50+
#[repr(C)]
4351
#[derive(Copy, Clone, Default)]
4452
pub struct Outer {
4553
pub named: Named,
@@ -83,6 +91,7 @@ unsafe fn main_0() -> i32 {
8391
assert!(((o.anon_3.i) == (9)));
8492
assert!(((o.anon_3.inner_named.j) == (10)));
8593
assert!(((o.anon_3.anon_1.k) == (11)));
94+
#[repr(C)]
8695
#[derive(Copy, Clone, Default)]
8796
pub struct anon_0 {
8897
pub x: i32,

tests/unit/union_addrof_external.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// translation-fail: refcount
2-
// no-compile: unsafe
32
#include <assert.h>
43
#include <stddef.h>
54
#include <stdint.h>

tests/unit/union_cross_arm_cast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// no-compile
1+
// no-compile: refcount
22
#include <assert.h>
33
#include <stddef.h>
44
#include <stdint.h>

tests/unit/union_field_alignment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// no-compile
1+
// no-compile: refcount
22
#include <assert.h>
33
#include <stddef.h>
44
#include <stdint.h>

tests/unit/union_memset_memcpy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// no-compile
1+
// no-compile: refcount
22
#include <assert.h>
33
#include <stddef.h>
44
#include <stdint.h>

tests/unit/union_nested.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// no-compile
1+
// no-compile: refcount
22
#include <assert.h>
33
#include <stdint.h>
44
#include <string.h>

tests/unit/union_pointer_pun_address.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// no-compile: refcount
2-
// panic: unsafe
32
#include <assert.h>
43

54
struct node_a {

tests/unit/union_pointer_pun_writethrough.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// panic: refcount
2-
// XFAIL: unsafe
1+
// no-compile: refcount
32
#include <assert.h>
43

54
int main(void) {

tests/unit/union_struct_dual_use.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// no-compile
1+
// no-compile: refcount
22
#include <assert.h>
33
#include <string.h>
44

0 commit comments

Comments
 (0)