Skip to content

test: alterations for Windows #22683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/Interpreter/SDK/libc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
import Glibc
#elseif os(Windows)
import MSVCRT

let S_IRUSR: Int32 = ucrt._S_IREAD
let S_IWUSR: Int32 = 0
let S_IXUSR: Int32 = 0

let S_IRGRP: Int32 = 0o0040
let S_IROTH: Int32 = 0o0004
#else
#error("Unsupported platform")
#endif
Expand Down Expand Up @@ -49,7 +56,7 @@ if errFile != -1 {
}

// CHECK-NOT: error
// CHECK: created mode *33216* *33216*
// CHECK: created mode *{{33216|33060}}* *{{33216|33060}}*
let tempFile =
open(tempPath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IXUSR)
if tempFile == -1 {
Expand Down Expand Up @@ -84,6 +91,10 @@ if err != 0 {

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

#if os(Windows)
assert(statbuf1.st_mode == S_IFREG | S_IRUSR | S_IRGRP | S_IROTH)
#else
assert(statbuf1.st_mode == S_IFREG | S_IRUSR | S_IWUSR | S_IXUSR)
#endif
assert(statbuf1.st_mode == statbuf2.st_mode)