[embedded] Start building embedded support on Linux/ELF, expand archs of the embedded stdlib to cover common embedded targets, take 2

This commit is contained in:
Kuba Mracek
2023-11-28 10:31:39 -08:00
parent fd6338737b
commit a0ec73ef42
51 changed files with 90 additions and 104 deletions

View File

@@ -11,12 +11,14 @@ function(set_if_arch_bitness var_name)
"${SIA_ARCH}" STREQUAL "x86" OR
"${SIA_ARCH}" STREQUAL "armv5" OR
"${SIA_ARCH}" STREQUAL "armv6" OR
"${SIA_ARCH}" STREQUAL "armv6m" OR
"${SIA_ARCH}" STREQUAL "armv7" OR
"${SIA_ARCH}" STREQUAL "armv7k" OR
"${SIA_ARCH}" STREQUAL "arm64_32" OR
"${SIA_ARCH}" STREQUAL "armv7m" OR
"${SIA_ARCH}" STREQUAL "armv7em" OR
"${SIA_ARCH}" STREQUAL "armv7s" OR
"${SIA_ARCH}" STREQUAL "riscv32" OR
"${SIA_ARCH}" STREQUAL "wasm32" OR
"${SIA_ARCH}" STREQUAL "powerpc")
set("${var_name}" "${SIA_CASE_32_BIT}" PARENT_SCOPE)

View File

@@ -138,7 +138,7 @@ option(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB
"Enable build of the embedded Swift standard library and runtime"
TRUE)
if(NOT SWIFT_HOST_VARIANT STREQUAL "macosx")
if((NOT SWIFT_HOST_VARIANT STREQUAL "macosx") AND (NOT SWIFT_HOST_VARIANT STREQUAL "linux"))
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
elseif(NOT SWIFT_INCLUDE_TOOLS)
# Temporarily, only build embedded stdlib when building the compiler, to
@@ -151,13 +151,37 @@ endif()
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
set(EMBEDDED_STDLIB_TARGET_TRIPLES
# arch module_name target triple
"armv6 armv6-apple-none-macho armv6-apple-none-macho"
"armv6m armv6m-apple-none-macho armv6m-apple-none-macho"
"armv7 armv7-apple-none-macho armv7-apple-none-macho"
"armv7em armv7em-apple-none-macho armv7em-apple-none-macho"
"arm64 arm64-apple-none-macho arm64-apple-none-macho"
# the following are all ELF targets
"armv6 armv6-none-none-eabi armv6-none-none-eabi"
"armv6m armv6m-none-none-eabi armv6-none-none-eabi"
"armv7 armv7-none-none-eabi armv7-none-none-eabi"
"armv7em armv7em-none-none-eabi armv7em-none-none-eabi"
"aarch64 aarch64-none-none-elf aarch64-none-none-elf"
"riscv32 riscv32-none-none-eabi riscv32-none-none-eabi"
"riscv64 riscv64-none-none-eabi riscv64-none-none-eabi"
)
if (SWIFT_HOST_VARIANT STREQUAL "linux")
set(EMBEDDED_STDLIB_TARGET_TRIPLES ${EMBEDDED_STDLIB_TARGET_TRIPLES}
"${SWIFT_HOST_VARIANT_ARCH} ${SWIFT_HOST_VARIANT_ARCH}-unknown-linux-gnu ${SWIFT_HOST_VARIANT_ARCH}-unknown-linux-gnu"
# In practice this expands to either:
# "x86_64 x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu"
# "aarch64 aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu"
)
elseif (SWIFT_HOST_VARIANT STREQUAL "macosx")
set(EMBEDDED_STDLIB_TARGET_TRIPLES ${EMBEDDED_STDLIB_TARGET_TRIPLES}
"x86_64 x86_64-apple-macos x86_64-apple-macos10.13"
"arm64 arm64-apple-macos arm64-apple-macos10.13"
"arm64e arm64e-apple-macos arm64e-apple-macos10.13"
)
endif()
endif()
if(SWIFT_BUILD_STDLIB)
# These must be kept in dependency order so that any referenced targets

View File

@@ -198,10 +198,19 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
list(GET list 1 mod)
list(GET list 2 triple)
# TODO: Only build embedded Swift Concurrency for macOS, for now.
if (SWIFT_HOST_VARIANT STREQUAL "linux")
if(NOT "${mod}" MATCHES "-linux-gnu$")
continue()
endif()
set(extra_c_compile_flags)
set(extra_swift_compile_flags)
elseif (SWIFT_HOST_VARIANT STREQUAL "macosx")
if(NOT "${mod}" MATCHES "-macos$")
continue()
endif()
set(extra_c_compile_flags -D__MACH__ -D__APPLE__ -ffreestanding)
set(extra_swift_compile_flags -Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding)
endif()
set(SWIFT_SDK_embedded_ARCH_${mod}_MODULE "${mod}")
set(SWIFT_SDK_embedded_LIB_SUBDIR "embedded")
@@ -242,12 +251,11 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
TaskCancellation.swift
SWIFT_COMPILE_FLAGS
-Xcc -D__MACH__ -Xcc -D__APPLE__ -Xcc -ffreestanding -enable-experimental-feature Embedded
${extra_swift_compile_flags} -enable-experimental-feature Embedded
-parse-stdlib -DSWIFT_CONCURRENCY_EMBEDDED
${SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS}
C_COMPILE_FLAGS
-D__MACH__ -D__APPLE__ -ffreestanding
${SWIFT_RUNTIME_CONCURRENCY_C_FLAGS} -DSWIFT_CONCURRENCY_EMBEDDED=1
${extra_c_compile_flags} ${SWIFT_RUNTIME_CONCURRENCY_C_FLAGS} -DSWIFT_CONCURRENCY_EMBEDDED=1
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
SDK "embedded"
ARCHITECTURE "${mod}"

View File

@@ -6,8 +6,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
import Builtin

View File

@@ -7,8 +7,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@_silgen_name("putchar")
func putchar(_: UInt8)

View File

@@ -2,8 +2,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public struct MyStruct {
}

View File

@@ -7,8 +7,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@_silgen_name("putchar")
func putchar(_: UInt8)

View File

@@ -3,8 +3,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@main
struct Main {

View File

@@ -6,8 +6,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
class MyClass {
init() { print("MyClass.init") }

View File

@@ -7,8 +7,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public class MyClass {
public init() { print("MyClass.init") }

View File

@@ -6,8 +6,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
class MyClass {
init() { print("MyClass.init") }

View File

@@ -6,8 +6,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public class MyClass {
var handler: (()->())? = nil

View File

@@ -7,8 +7,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@_silgen_name("putchar")
func putchar(_: UInt8)

View File

@@ -7,7 +7,6 @@
// REQUIRES: executable_test
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
import _Concurrency

View File

@@ -7,7 +7,6 @@
// REQUIRES: executable_test
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
import _Concurrency

View File

@@ -2,7 +2,6 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
import Builtin

View File

@@ -7,7 +7,6 @@
// REQUIRES: executable_test
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
import _Concurrency

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@_silgen_name("putchar")
func putchar(_: UInt8)

View File

@@ -7,8 +7,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func foo<T>(_ array: inout [T]) {
array.withUnsafeMutableBytes {

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@main
struct Main {

View File

@@ -1,8 +1,7 @@
// RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -parse-as-library -module-name main | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
class MyClass {
init() {

View File

@@ -3,8 +3,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func foo() -> [Int] {
var a = [1, 2, 3]

View File

@@ -3,8 +3,7 @@
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
struct User {
let o: BaseClass

View File

@@ -4,8 +4,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
protocol Fooable {
func foo()

View File

@@ -5,7 +5,6 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that

View File

@@ -2,8 +2,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func sink<T>(t: T) {}

View File

@@ -9,8 +9,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN MyModule.swift

View File

@@ -9,8 +9,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN MyModule.swift

View File

@@ -7,8 +7,7 @@
// RUN: %target-swift-frontend -emit-ir -I %t %t/Main.swift -enable-experimental-feature Embedded -parse-as-library | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// Dependencies look like this:
//
@@ -44,4 +43,4 @@ public func main() {
MyModuleC.foo()
}
// CHECK: @"$s9MyModuleA6globalSivp" = global %TSi zeroinitializer
// CHECK: @"$s9MyModuleA6globalSivp" = {{.*}}global %TSi zeroinitializer

View File

@@ -5,8 +5,7 @@
// RUN: %target-swift-frontend -emit-ir -I %t %t/Main.swift -enable-experimental-feature Embedded -parse-as-library | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN MyModule.swift
@@ -31,7 +30,7 @@ public func main() {
foo()
}
// CHECK: @"$s4Main022global_in_client_used_c1_D0Sivp" = global %TSi zeroinitializer
// CHECK: @"$s4Main024global_in_client_unused_c1_D0Sivp" = global %TSi zeroinitializer
// CHECK: @"$s8MyModule022global_in_module_used_d1_E0Sivp" = global %TSi zeroinitializer
// CHECK: @"$s8MyModule024global_in_module_unused_d1_E0Sivp" = global %TSi zeroinitializer
// CHECK: @"$s4Main022global_in_client_used_c1_D0Sivp" = {{.*}}global %TSi zeroinitializer
// CHECK: @"$s4Main024global_in_client_unused_c1_D0Sivp" = {{.*}}global %TSi zeroinitializer
// CHECK: @"$s8MyModule022global_in_module_used_d1_E0Sivp" = {{.*}}global %TSi zeroinitializer
// CHECK: @"$s8MyModule024global_in_module_unused_d1_E0Sivp" = {{.*}}global %TSi zeroinitializer

View File

@@ -9,8 +9,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN MyModule.swift

View File

@@ -1,8 +1,7 @@
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func staticstring() -> StaticString {
return "hello"

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public struct MyStructA {
static var singleton = MyStructA()

View File

@@ -2,14 +2,13 @@
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend %t/Main.swift %S/Inputs/print.swift -import-bridging-header %t/BridgingHeader.h -enable-experimental-feature Embedded -c -o %t/main.o
// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip
// RUN: %target-clang %t/main.o -o %t/a.out -dead_strip -pthreads
// RUN: %target-run %t/a.out | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN BridgingHeader.h

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
// ASan cannot work in ("Interceptors are not working, AddressSanitizer is

View File

@@ -1,8 +1,7 @@
// RUN: %target-swift-emit-ir -Osize %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func foo<T>(n: T) {
bar(n: 42)

View File

@@ -2,8 +2,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func foo() {
bar([42])

View File

@@ -7,7 +7,6 @@
// RUN: %target-swift-frontend -target arm64-apple-none-macho -assert-config Debug -Osize -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: optimized_stdlib
public func test() {}

View File

@@ -4,8 +4,7 @@
// RUN: %target-swift-frontend -enable-import-ptrauth-field-function-pointers -O -emit-ir %t/Main.swift -enable-experimental-feature Embedded -import-objc-header %t/header.h | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// REQUIRES: CPU=arm64e
// BEGIN header.h

View File

@@ -6,8 +6,7 @@
// RUN: %target-swift-frontend -enable-import-ptrauth-field-function-pointers -O -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded -import-objc-header %t/header.h
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// REQUIRES: CPU=arm64e
// BEGIN header.h

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@main
struct Main {

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
@_silgen_name("putchar")
func putchar(_: UInt8)

View File

@@ -11,8 +11,7 @@
// RUN: %target-swift-frontend -Osize -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
// BEGIN Module.swift

View File

@@ -4,8 +4,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func stringArray() -> [StaticString] {
return ["a", "b", "c", "d"]

View File

@@ -3,8 +3,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public struct MyInterpolation : StringInterpolationProtocol {
public typealias StringLiteralType = StaticString

View File

@@ -2,7 +2,6 @@
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
public func bool() -> Bool {
return true

View File

@@ -2,7 +2,6 @@
// RUN: %target-swift-frontend -target arm64-apple-none-macho -Xcc -D__MACH__ -Xcc -D__arm64__ -Xcc -D__APPLE__ -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: optimized_stdlib
class MyClass {}

View File

@@ -1,8 +1,7 @@
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded -throws-as-traps | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func test() {
withUnsafeTemporaryAllocation(byteCount: MemoryLayout<Int>.size, alignment: MemoryLayout<Int>.alignment) { p in

View File

@@ -3,8 +3,7 @@
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded -throws-as-traps | %FileCheck %s --check-prefix CHECK-TRAPS-IR
// REQUIRES: swift_in_compiler
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
enum MyError : Error {
case a

View File

@@ -5,8 +5,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public enum MyError : Error, Equatable {
case a

View File

@@ -2,8 +2,7 @@
// REQUIRES: swift_in_compiler
// REQUIRES: optimized_stdlib
// REQUIRES: VENDOR=apple
// REQUIRES: OS=macosx
// REQUIRES: OS=macosx || OS=linux-gnu
public func unsafeWriteArray<T, R>(_ elementType: R.Type, array: inout T, index n: Int, value: R) {
precondition(_isPOD(elementType))