11//@ add-minicore
2- //@ revisions: linux win_x86 win_i686 macos thumb
2+ //@ revisions: linux win_x86_msvc win_x86_gnu win_i686_gnu macos thumb
33//
44//@[linux] compile-flags: --target x86_64-unknown-linux-gnu
55//@[linux] needs-llvm-components: x86
6- //@[win_x86] compile-flags: --target x86_64-pc-windows-gnu
7- //@[win_x86] needs-llvm-components: x86
8- //@[win_i686] compile-flags: --target i686-pc-windows-gnu
9- //@[win_i686] needs-llvm-components: x86
6+ //@[win_x86_gnu] compile-flags: --target x86_64-pc-windows-gnu
7+ //@[win_x86_gnu] needs-llvm-components: x86
8+ //@[win_x86_msvc] compile-flags: --target x86_64-pc-windows-msvc
9+ //@[win_x86_msvc] needs-llvm-components: x86
10+ //@[win_i686_gnu] compile-flags: --target i686-pc-windows-gnu
11+ //@[win_i686_gnu] needs-llvm-components: x86
1012//@[macos] compile-flags: --target aarch64-apple-darwin
1113//@[macos] needs-llvm-components: aarch64
1214//@[thumb] compile-flags: --target thumbv7em-none-eabi
@@ -23,6 +25,11 @@ use minicore::*;
2325//
2426// linux: .pushsection .text.naked_empty,\22ax\22, @progbits
2527// macos: .pushsection __TEXT,__text,regular,pure_instructions
28+ //
29+ // win_x86_msvc: .pushsection .text$naked_empty,\22xr\22
30+ // win_x86_gnu-NOT: .pushsection
31+ // win_i686_gnu-NOT: .pushsection
32+ //
2633// thumb: .pushsection .text.naked_empty,\22ax\22, %progbits
2734//
2835// linux, macos, thumb: .balign 4
@@ -35,12 +42,12 @@ use minicore::*;
3542//
3643// linux: .type naked_empty, @function
3744//
38- // win_x86 : .def naked_empty
39- // win_i686 : .def _naked_empty
45+ // win_x86_msvc,win_x86_gnu : .def naked_empty
46+ // win_i686_gnu : .def _naked_empty
4047//
41- // win_x86,win_i686 : .scl 2
42- // win_x86,win_i686 : .type 32
43- // win_x86,win_i686 : .endef
48+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .scl 2
49+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .type 32
50+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .endef
4451//
4552// win_x86: .pushsection .text.naked_empty,\22xr\22
4653// win_i686: .pushsection .text._naked_empty,\22xr\22
@@ -59,7 +66,8 @@ use minicore::*;
5966// linux,macos,win_x86,win_x86: ret
6067// thumb: bx lr
6168//
62- // linux,macos,thumb: .popsection
69+ // linux,windows,win_x86_msvc,thumb: .popsection
70+ // win_x86_gnu-NOT,win_i686_gnu-NOT: .popsection
6371//
6472// thumb: .thumb
6573//
@@ -82,6 +90,11 @@ pub extern "C" fn naked_empty() {
8290//
8391// linux: .pushsection .text.naked_with_args_and_return,\22ax\22, @progbits
8492// macos: .pushsection __TEXT,__text,regular,pure_instructions
93+ //
94+ // win_x86_msvc: .pushsection .text$naked_with_args_and_return,\22xr\22
95+ // win_x86_gnu-NOT: .pushsection
96+ // win_i686_gnu-NOT: .pushsection
97+ //
8598// thumb: .pushsection .text.naked_with_args_and_return,\22ax\22, %progbits
8699//
87100// linux, macos, thumb: .balign 4
@@ -94,12 +107,12 @@ pub extern "C" fn naked_empty() {
94107//
95108// linux: .type naked_with_args_and_return, @function
96109//
97- // win_x86 : .def naked_with_args_and_return
98- // win_i686 : .def _naked_with_args_and_return
110+ // win_x86_msvc,win_x86_gnu : .def naked_with_args_and_return
111+ // win_i686_gnu : .def _naked_with_args_and_return
99112//
100- // win_x86,win_i686 : .scl 2
101- // win_x86,win_i686 : .type 32
102- // win_x86,win_i686 : .endef
113+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .scl 2
114+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .type 32
115+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .endef
103116//
104117// win_x86: .pushsection .text.naked_with_args_and_return,\22xr\22
105118// win_i686: .pushsection .text._naked_with_args_and_return,\22xr\22
@@ -115,14 +128,15 @@ pub extern "C" fn naked_empty() {
115128//
116129// CHECK-LABEL: naked_with_args_and_return:
117130//
118- // linux, win_x86,win_i686 : lea rax, [rdi + rsi]
131+ // linux,win_x86_msvc,win_x86_gnu,win_i686_gnu : lea rax, [rdi + rsi]
119132// macos: add x0, x0, x1
120133// thumb: adds r0, r0, r1
121134//
122135// linux,macos,win_x86,win_i686: ret
123136// thumb: bx lr
124137//
125- // linux,macos,thumb: .popsection
138+ // linux,windows,win_x86_msvc,thumb: .popsection
139+ // win_x86_gnu-NOT,win_i686_gnu-NOT: .popsection
126140//
127141// thumb: .thumb
128142//
@@ -146,7 +160,7 @@ pub extern "C" fn naked_with_args_and_return(a: isize, b: isize) -> isize {
146160
147161// linux: .pushsection .text.some_different_name,\22ax\22, @progbits
148162// macos: .pushsection .text.some_different_name,regular,pure_instructions
149- // win_x86,win_i686 : .pushsection .text.some_different_name,\22xr\22
163+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .pushsection .text.some_different_name,\22xr\22
150164// thumb: .pushsection .text.some_different_name,\22ax\22, %progbits
151165// CHECK-LABEL: test_link_section:
152166#[ no_mangle]
@@ -163,15 +177,15 @@ pub extern "C" fn test_link_section() {
163177 }
164178}
165179
166- // win_x86 : .def fastcall_cc
167- // win_i686 : .def @fastcall_cc@4
180+ // win_x86_msvc,win_x86_gnu : .def fastcall_cc
181+ // win_i686_gnu : .def @fastcall_cc@4
168182//
169- // win_x86,win_i686 : .scl 2
170- // win_x86,win_i686 : .type 32
171- // win_x86,win_i686 : .endef
183+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .scl 2
184+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .type 32
185+ // win_x86_msvc,win_x86_gnu,win_i686_gnu : .endef
172186//
173- // win_x86 -LABEL: fastcall_cc:
174- // win_i686 -LABEL: @fastcall_cc@4:
187+ // win_x86_msvc-LABEL,win_x86_gnu -LABEL: fastcall_cc:
188+ // win_i686_gnu -LABEL: @fastcall_cc@4:
175189#[ cfg( target_os = "windows" ) ]
176190#[ no_mangle]
177191#[ unsafe( naked) ]
0 commit comments