Skip to content

[test] Setup testing for OpenBSD. #30599

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
Mar 24, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion test/ClangImporter/availability_returns_twice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
typealias JumpBuffer = Int32
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
typealias JumpBuffer = jmp_buf
#else
Expand Down
2 changes: 1 addition & 1 deletion test/ClangImporter/clang_builtins.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Fuzzing/fuzzer_test.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Fuzzing/fuzzer_test_simpler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/builtin_math.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/SDK/libc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/dynamic_replacement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import StdlibUnittest

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/dynamic_replacement_chaining.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import StdlibUnittest

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import StdlibUnittest

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/Prototypes/BigInt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import StdlibUnittest
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
8 changes: 7 additions & 1 deletion test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ elif run_os in ['windows-msvc']:
('%r -emit-pcm -target %s' % (config.swiftc, config.variant_triple))


elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'windows-gnu'] or
elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-cygnus', 'windows-gnu'] or
(kIsAndroid and run_os in ['linux-android', 'linux-androideabi'])):
# Running lit and the compiler on Android itself is more like running on Linux,
# ie the NDK and adb aren't needed, so use this instead.
Expand All @@ -1107,6 +1107,12 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'windows-cygnus', 'w
config.target_shared_library_prefix = 'lib'
config.target_shared_library_suffix = ".so"
config.target_sdk_name = "freebsd"
elif run_os == 'openbsd':
lit_config.note("Testing OpenBSD " + config.variant_triple)
config.target_object_format = "elf"
config.target_shared_library_prefix = 'lib'
config.target_shared_library_suffix = ".so"
config.target_sdk_name = "openbsd"
elif kIsAndroid:
lit_config.note("Testing Android " + config.variant_triple)
config.target_object_format = "elf"
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/FloatConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/MathConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/PrintFloat.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import StdlibUnittest
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
4 changes: 2 additions & 2 deletions test/stdlib/Runtime.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftShims

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down Expand Up @@ -603,7 +603,7 @@ Runtime.test("SwiftError layout constants for LLDB") {
expectEqual(40, offsetof_SwiftError_typeMetadata.load(as: UInt.self))
expectEqual(72, sizeof_SwiftError.load(as: UInt.self))
#endif
#elseif os(Linux) || os(Android) || os(Windows)
#elseif os(Linux) || os(Android) || os(Windows) || os(OpenBSD)
expectEqual(16, offsetof_SwiftError_typeMetadata.load(as: UInt.self))
expectEqual(32, sizeof_SwiftError.load(as: UInt.self))
#else
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/VarArgs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Swift
#if _runtime(_ObjC)
import Darwin
import CoreGraphics
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
typealias CGFloat = Double
#elseif os(Windows)
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/mmap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import StdlibUnittest
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#else
#error("Unsupported platform")
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/tgmath.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin.C.tgmath
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down
2 changes: 1 addition & 1 deletion test/stdlib/tgmath_optimized.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
#elseif os(Linux) || os(FreeBSD) || os(OpenBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) || os(WASI)
import Glibc
#elseif os(Windows)
import MSVCRT
Expand Down