Skip to content

Commit dc2fa3a

Browse files
committed
test: alterations for Windows
This brings the Interpreter pass rate on Windows to 100%
1 parent 0fe7e14 commit dc2fa3a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/Interpreter/SDK/libc.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
import Glibc
1616
#elseif os(Windows)
1717
import MSVCRT
18+
19+
let S_IRUSR: Int32 = ucrt._S_IREAD
20+
let S_IWUSR: Int32 = 0
21+
let S_IXUSR: Int32 = 0
22+
23+
let S_IRGRP: Int32 = 0o0040
24+
let S_IROTH: Int32 = 0o0004
1825
#else
1926
#error("Unsupported platform")
2027
#endif
@@ -49,7 +56,7 @@ if errFile != -1 {
4956
}
5057

5158
// CHECK-NOT: error
52-
// CHECK: created mode *33216* *33216*
59+
// CHECK: created mode *{{33216|33060}}* *{{33216|33060}}*
5360
let tempFile =
5461
open(tempPath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IXUSR)
5562
if tempFile == -1 {
@@ -84,6 +91,10 @@ if err != 0 {
8491

8592
print("created mode *\(statbuf1.st_mode)* *\(statbuf2.st_mode)*")
8693

94+
#if os(Windows)
95+
assert(statbuf1.st_mode == S_IFREG | S_IRUSR | S_IRGRP | S_IROTH)
96+
#else
8797
assert(statbuf1.st_mode == S_IFREG | S_IRUSR | S_IWUSR | S_IXUSR)
98+
#endif
8899
assert(statbuf1.st_mode == statbuf2.st_mode)
89100

0 commit comments

Comments
 (0)