Skip to content

Commit 573fd5a

Browse files
committed
Auto merge of rust-lang#102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrum
Get rid of exclude-list for Windows-only tests Main purpose of this change is to get rid of a quite long (and growing) list of excluded targets, while this test should only be useful on Windows (as far as I understand it). The `// only-windows` header seams to implement exactly what we need here. I don't know why there are some whitespace changes, but `x.py fmt` and `.git/hooks/pre-push` are happy.
2 parents de692f1 + 0919c94 commit 573fd5a

File tree

2 files changed

+8
-30
lines changed

2 files changed

+8
-30
lines changed

src/test/ui/abi/x86stdcall.rs

+5-21
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
// run-pass
2-
// ignore-wasm32-bare no libc to test ffi with
3-
// ignore-sgx no libc
2+
// only-windows
43
// GetLastError doesn't seem to work with stack switching
54

65
#[cfg(windows)]
76
mod kernel32 {
8-
extern "system" {
9-
pub fn SetLastError(err: usize);
10-
pub fn GetLastError() -> usize;
11-
}
7+
extern "system" {
8+
pub fn SetLastError(err: usize);
9+
pub fn GetLastError() -> usize;
10+
}
1211
}
1312

14-
1513
#[cfg(windows)]
1614
pub fn main() {
1715
unsafe {
@@ -22,17 +20,3 @@ pub fn main() {
2220
assert_eq!(expected, actual);
2321
}
2422
}
25-
26-
#[cfg(any(target_os = "android",
27-
target_os = "dragonfly",
28-
target_os = "emscripten",
29-
target_os = "freebsd",
30-
target_os = "fuchsia",
31-
target_os = "illumos",
32-
target_os = "linux",
33-
target_os = "macos",
34-
target_os = "netbsd",
35-
target_os = "openbsd",
36-
target_os = "solaris",
37-
target_os = "vxworks"))]
38-
pub fn main() { }

src/test/ui/abi/x86stdcall2.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// run-pass
2+
// only-windows
23

34
#![allow(non_camel_case_types)]
45
pub type HANDLE = usize;
@@ -7,27 +8,20 @@ pub type SIZE_T = u32;
78
pub type LPVOID = usize;
89
pub type BOOL = u8;
910

10-
#[cfg(windows)]
1111
mod kernel32 {
12-
use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL};
12+
use super::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T};
1313

1414
extern "system" {
1515
pub fn GetProcessHeap() -> HANDLE;
16-
pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T)
17-
-> LPVOID;
16+
pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID;
1817
pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL;
1918
}
2019
}
2120

22-
23-
#[cfg(windows)]
2421
pub fn main() {
2522
let heap = unsafe { kernel32::GetProcessHeap() };
2623
let mem = unsafe { kernel32::HeapAlloc(heap, 0, 100) };
2724
assert!(mem != 0);
2825
let res = unsafe { kernel32::HeapFree(heap, 0, mem) };
2926
assert!(res != 0);
3027
}
31-
32-
#[cfg(not(windows))]
33-
pub fn main() { }

0 commit comments

Comments
 (0)