Skip to content

Commit 280672e

Browse files
committed
Follow Rust naming convention for modules and type names
1 parent 2e63eef commit 280672e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

tests/assembly-llvm/reg-struct-return.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ use minicore::*;
2222

2323
// Verifies ABI changes for small structs, where both fields fit into one register.
2424
// WITH is expected to use register return, WITHOUT should use hidden pointer.
25-
mod small {
26-
struct small_t {
25+
mod Small {
26+
struct SmallStruct {
2727
a: i8,
2828
b: i8,
2929
}
3030

3131
unsafe extern "C" {
32-
fn small() -> small_t;
32+
fn small() -> SmallStruct;
3333
}
3434

3535
#[unsafe(no_mangle)]
36-
pub unsafe extern "C" fn small_callee() -> small_t {
36+
pub unsafe extern "C" fn small_callee() -> SmallStruct {
3737
// (42 << 8) | 42 = 10794
3838

3939
// WITH-LABEL: small_callee
@@ -44,11 +44,11 @@ mod small {
4444
// WITHOUT-DAG: movl 4(%esp), %e{{.*}}
4545
// WITHOUT-DAG: movw $10794, (%e{{.*}})
4646
// WITHOUT: retl $4
47-
small_t { a: 42, b: 42 }
47+
SmallStruct { a: 42, b: 42 }
4848
}
4949

5050
#[unsafe(no_mangle)]
51-
pub unsafe extern "C" fn small_caller(dst: &mut small_t) {
51+
pub unsafe extern "C" fn small_caller(dst: &mut SmallStruct) {
5252
// WITH-LABEL: small_caller
5353
// WITH: calll small
5454
// WITH: movw %ax, (%e{{.*}})
@@ -64,18 +64,18 @@ mod small {
6464
// for reg-struct-return.
6565
// WITH is expected to still use register return, WITHOUT should use hidden
6666
// pointer.
67-
mod pivot {
68-
struct pivot_t {
67+
mod Pivot {
68+
struct PivotStruct {
6969
a: i32,
7070
b: i32,
7171
}
7272

7373
unsafe extern "C" {
74-
fn pivot() -> pivot_t;
74+
fn pivot() -> PivotStruct;
7575
}
7676

7777
#[unsafe(no_mangle)]
78-
pub unsafe extern "C" fn pivot_callee() -> pivot_t {
78+
pub unsafe extern "C" fn pivot_callee() -> PivotStruct {
7979
// WITH-LABEL: pivot_callee
8080
// WITH-DAG: movl $42, %e{{.*}}
8181
// WITH-DAG: movl $42, %e{{.*}}
@@ -86,11 +86,11 @@ mod pivot {
8686
// WITHOUT-DAG: movl $42, (%e{{.*}})
8787
// WITHOUT-DAG: movl $42, 4(%e{{.*}})
8888
// WITHOUT: retl $4
89-
pivot_t { a: 42, b: 42 }
89+
PivotStruct { a: 42, b: 42 }
9090
}
9191

9292
#[unsafe(no_mangle)]
93-
pub unsafe extern "C" fn pivot_caller(dst: &mut pivot_t) {
93+
pub unsafe extern "C" fn pivot_caller(dst: &mut PivotStruct) {
9494
// WITH-LABEL: pivot_caller
9595
// WITH: calll pivot
9696
// WITH-DAG: movl %e{{.*}}, 4(%e{{.*}})
@@ -107,30 +107,30 @@ mod pivot {
107107
// maximum size for reg-struct-return (8 bytes).
108108
// Here, both WITH and WITHOUT should use the hidden pointer convention (i.e, they
109109
// should be identical).
110-
mod large {
111-
struct large_t {
110+
mod Large {
111+
struct LargeStruct {
112112
a: i32,
113113
b: i32,
114114
c: i32,
115115
}
116116

117117
unsafe extern "C" {
118-
fn large() -> large_t;
118+
fn large() -> LargeStruct;
119119
}
120120

121121
#[unsafe(no_mangle)]
122-
pub unsafe extern "C" fn large_callee() -> large_t {
122+
pub unsafe extern "C" fn large_callee() -> LargeStruct {
123123
// CHECK-LABEL: large_callee
124124
// CHECK: movl 4(%esp), %e{{.*}}
125125
// CHECK-DAG: movl $42, (%e{{.*}})
126126
// CHECK-DAG: movl $42, 4(%e{{.*}})
127127
// CHECK-DAG: movl $42, 8(%e{{.*}})
128128
// CHECK: retl $4
129-
large_t { a: 42, b: 42, c: 42 }
129+
LargeStruct { a: 42, b: 42, c: 42 }
130130
}
131131

132132
#[unsafe(no_mangle)]
133-
pub unsafe extern "C" fn large_caller(dst: *mut large_t) {
133+
pub unsafe extern "C" fn large_caller(dst: *mut LargeStruct) {
134134
// CHECK-LABEL: large_caller
135135
// CHECK: calll large
136136
// CHECK: subl $4, %esp

0 commit comments

Comments
 (0)