Skip to content

Commit c0f5cdd

Browse files
Address review comment
1 parent 8a01401 commit c0f5cdd

1 file changed

Lines changed: 46 additions & 46 deletions

File tree

tests/codegen-llvm/abi-win64-zst.rs

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ extern crate minicore;
2222
use minicore::*;
2323

2424
#[repr(C)]
25-
struct CZst;
25+
struct CMaybeZst;
2626

2727
#[repr(transparent)]
28-
struct CZst2((), CZst, ());
28+
struct CMaybeZst2((), CMaybeZst, ());
2929

3030
// Make sure the argument is always passed when explicitly requesting a Windows ABI,
3131
// and it is `repr(C)` - but not if it is `repr(Rust)`.
@@ -35,57 +35,57 @@ struct CZst2((), CZst, ());
3535
#[no_mangle]
3636
extern "win64" fn pass_rust_zst_win64(_: ()) {}
3737

38-
// CHECK: define win64cc void @pass_c_zst_win64(ptr {{[^,]*}})
38+
// CHECK: define win64cc void @pass_c_maybezst_win64(ptr {{[^,]*}})
3939
#[no_mangle]
40-
extern "win64" fn pass_c_zst_win64(_: CZst) {}
40+
extern "win64" fn pass_c_maybezst_win64(_: CMaybeZst) {}
4141

42-
// CHECK: define win64cc void @pass_c_zst_2_win64(ptr {{[^,]*}})
42+
// CHECK: define win64cc void @pass_c_maybezst_2_win64(ptr {{[^,]*}})
4343
#[no_mangle]
44-
extern "win64" fn pass_c_zst_2_win64(_: CZst2) {}
44+
extern "win64" fn pass_c_maybezst_2_win64(_: CMaybeZst2) {}
4545

4646
// CHECK: define x86_vectorcallcc void @pass_rust_zst_vectorcall()
4747
#[no_mangle]
4848
extern "vectorcall" fn pass_rust_zst_vectorcall(_: ()) {}
4949

50-
// CHECK: define x86_vectorcallcc void @pass_c_zst_vectorcall(ptr {{[^,]*}})
50+
// CHECK: define x86_vectorcallcc void @pass_c_maybezst_vectorcall(ptr {{[^,]*}})
5151
#[no_mangle]
52-
extern "vectorcall" fn pass_c_zst_vectorcall(_: CZst) {}
52+
extern "vectorcall" fn pass_c_maybezst_vectorcall(_: CMaybeZst) {}
5353

54-
// CHECK: define x86_vectorcallcc void @pass_c_zst_2_vectorcall(ptr {{[^,]*}})
54+
// CHECK: define x86_vectorcallcc void @pass_c_maybezst_2_vectorcall(ptr {{[^,]*}})
5555
#[no_mangle]
56-
extern "vectorcall" fn pass_c_zst_2_vectorcall(_: CZst2) {}
56+
extern "vectorcall" fn pass_c_maybezst_2_vectorcall(_: CMaybeZst2) {}
5757

5858
// windows-gnu: define void @pass_rust_zst_fastcall()
5959
// windows-msvc: define void @pass_rust_zst_fastcall()
6060
#[no_mangle]
6161
#[cfg(windows)] // "fastcall" is not valid on 64bit Linux
6262
extern "fastcall" fn pass_rust_zst_fastcall(_: ()) {}
6363

64-
// windows-gnu: define void @pass_c_zst_fastcall(ptr {{[^,]*}})
65-
// windows-msvc: define void @pass_c_zst_fastcall(ptr {{[^,]*}})
64+
// windows-gnu: define void @pass_c_maybezst_fastcall(ptr {{[^,]*}})
65+
// windows-msvc: define void @pass_c_maybezst_fastcall(ptr {{[^,]*}})
6666
#[no_mangle]
6767
#[cfg(windows)] // "fastcall" is not valid on 64bit Linux
68-
extern "fastcall" fn pass_c_zst_fastcall(_: CZst) {}
68+
extern "fastcall" fn pass_c_maybezst_fastcall(_: CMaybeZst) {}
6969

70-
// windows-gnu: define void @pass_c_zst_2_fastcall(ptr {{[^,]*}})
71-
// windows-msvc: define void @pass_c_zst_2_fastcall(ptr {{[^,]*}})
70+
// windows-gnu: define void @pass_c_maybezst_2_fastcall(ptr {{[^,]*}})
71+
// windows-msvc: define void @pass_c_maybezst_2_fastcall(ptr {{[^,]*}})
7272
#[no_mangle]
7373
#[cfg(windows)] // "fastcall" is not valid on 64bit Linux
74-
extern "fastcall" fn pass_c_zst_2_fastcall(_: CZst2) {}
74+
extern "fastcall" fn pass_c_maybezst_2_fastcall(_: CMaybeZst2) {}
7575

7676
// The sysv64 ABI ignores ZST.
7777

7878
// CHECK: define x86_64_sysvcc void @pass_rust_zst_sysv64()
7979
#[no_mangle]
8080
extern "sysv64" fn pass_rust_zst_sysv64(_: ()) {}
8181

82-
// CHECK: define x86_64_sysvcc void @pass_c_zst_sysv64()
82+
// CHECK: define x86_64_sysvcc void @pass_c_maybezst_sysv64()
8383
#[no_mangle]
84-
extern "sysv64" fn pass_c_zst_sysv64(_: CZst) {}
84+
extern "sysv64" fn pass_c_maybezst_sysv64(_: CMaybeZst) {}
8585

86-
// CHECK: define x86_64_sysvcc void @pass_c_zst_2_sysv64()
86+
// CHECK: define x86_64_sysvcc void @pass_c_maybezst_2_sysv64()
8787
#[no_mangle]
88-
extern "sysv64" fn pass_c_zst_2_sysv64(_: CZst2) {}
88+
extern "sysv64" fn pass_c_maybezst_2_sysv64(_: CMaybeZst2) {}
8989

9090
// For `extern "C"` functions, ZST are ignored on Linux put passed on Windows.
9191

@@ -95,55 +95,55 @@ extern "sysv64" fn pass_c_zst_2_sysv64(_: CZst2) {}
9595
#[no_mangle]
9696
extern "C" fn pass_rust_zst_c(_: ()) {}
9797

98-
// linux: define void @pass_c_zst_c()
99-
// windows-msvc: define void @pass_c_zst_c(ptr {{[^,]*}})
100-
// windows-gnu: define void @pass_c_zst_c(ptr {{[^,]*}})
98+
// linux: define void @pass_c_maybezst_c()
99+
// windows-msvc: define void @pass_c_maybezst_c(ptr {{[^,]*}})
100+
// windows-gnu: define void @pass_c_maybezst_c(ptr {{[^,]*}})
101101
#[no_mangle]
102-
extern "C" fn pass_c_zst_c(_: CZst) {}
102+
extern "C" fn pass_c_maybezst_c(_: CMaybeZst) {}
103103

104-
// linux: define void @pass_c_zst_2_c()
105-
// windows-msvc: define void @pass_c_zst_2_c(ptr {{[^,]*}})
106-
// windows-gnu: define void @pass_c_zst_2_c(ptr {{[^,]*}})
104+
// linux: define void @pass_c_maybezst_2_c()
105+
// windows-msvc: define void @pass_c_maybezst_2_c(ptr {{[^,]*}})
106+
// windows-gnu: define void @pass_c_maybezst_2_c(ptr {{[^,]*}})
107107
#[no_mangle]
108-
extern "C" fn pass_c_zst_2_c(_: CZst2) {}
108+
extern "C" fn pass_c_maybezst_2_c(_: CMaybeZst2) {}
109109

110110
// Now check `repr(C)` return types.
111111
// Again, we seek to match clang: <https://clang.godbolt.org/z/hKv74ThnE>
112112

113-
// CHECK: define win64cc void @ret_c_zst_win64(ptr {{[^,]*}})
113+
// CHECK: define win64cc void @ret_c_maybezst_win64(ptr {{[^,]*}})
114114
#[no_mangle]
115-
extern "win64" fn ret_c_zst_win64() -> CZst {
116-
CZst
115+
extern "win64" fn ret_c_maybezst_win64() -> CMaybeZst {
116+
CMaybeZst
117117
}
118118

119-
// CHECK: define x86_vectorcallcc void @ret_c_zst_vectorcall(ptr {{[^,]*}})
119+
// CHECK: define x86_vectorcallcc void @ret_c_maybezst_vectorcall(ptr {{[^,]*}})
120120
#[no_mangle]
121-
extern "vectorcall" fn ret_c_zst_vectorcall() -> CZst {
122-
CZst
121+
extern "vectorcall" fn ret_c_maybezst_vectorcall() -> CMaybeZst {
122+
CMaybeZst
123123
}
124124

125-
// windows-gnu: define void @ret_c_zst_fastcall(ptr {{[^,]*}})
126-
// windows-msvc: define void @ret_c_zst_fastcall(ptr {{[^,]*}})
125+
// windows-gnu: define void @ret_c_maybezst_fastcall(ptr {{[^,]*}})
126+
// windows-msvc: define void @ret_c_maybezst_fastcall(ptr {{[^,]*}})
127127
#[no_mangle]
128128
#[cfg(windows)] // "fastcall" is not valid on 64bit Linux
129-
extern "fastcall" fn ret_c_zst_fastcall() -> CZst {
130-
CZst
129+
extern "fastcall" fn ret_c_maybezst_fastcall() -> CMaybeZst {
130+
CMaybeZst
131131
}
132132

133133
// The sysv64 ABI ignores ZST.
134134

135-
// CHECK: define x86_64_sysvcc void @ret_c_zst_sysv64()
135+
// CHECK: define x86_64_sysvcc void @ret_c_maybezst_sysv64()
136136
#[no_mangle]
137-
extern "sysv64" fn ret_c_zst_sysv64() -> CZst {
138-
CZst
137+
extern "sysv64" fn ret_c_maybezst_sysv64() -> CMaybeZst {
138+
CMaybeZst
139139
}
140140

141141
// For `extern "C"` functions, ZST are ignored on Linux put reted on Windows.
142142

143-
// linux: define void @ret_c_zst_c()
144-
// windows-msvc: define void @ret_c_zst_c(ptr {{[^,]*}})
145-
// windows-gnu: define void @ret_c_zst_c(ptr {{[^,]*}})
143+
// linux: define void @ret_c_maybezst_c()
144+
// windows-msvc: define void @ret_c_maybezst_c(ptr {{[^,]*}})
145+
// windows-gnu: define void @ret_c_maybezst_c(ptr {{[^,]*}})
146146
#[no_mangle]
147-
extern "C" fn ret_c_zst_c() -> CZst {
148-
CZst
147+
extern "C" fn ret_c_maybezst_c() -> CMaybeZst {
148+
CMaybeZst
149149
}

0 commit comments

Comments
 (0)