mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -11,12 +11,14 @@ function(set_if_arch_bitness var_name)
|
|||||||
"${SIA_ARCH}" STREQUAL "x86" OR
|
"${SIA_ARCH}" STREQUAL "x86" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv5" OR
|
"${SIA_ARCH}" STREQUAL "armv5" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv6" OR
|
"${SIA_ARCH}" STREQUAL "armv6" OR
|
||||||
|
"${SIA_ARCH}" STREQUAL "armv6m" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv7" OR
|
"${SIA_ARCH}" STREQUAL "armv7" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv7k" OR
|
"${SIA_ARCH}" STREQUAL "armv7k" OR
|
||||||
"${SIA_ARCH}" STREQUAL "arm64_32" OR
|
"${SIA_ARCH}" STREQUAL "arm64_32" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv7m" OR
|
"${SIA_ARCH}" STREQUAL "armv7m" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv7em" OR
|
"${SIA_ARCH}" STREQUAL "armv7em" OR
|
||||||
"${SIA_ARCH}" STREQUAL "armv7s" OR
|
"${SIA_ARCH}" STREQUAL "armv7s" OR
|
||||||
|
"${SIA_ARCH}" STREQUAL "riscv32" OR
|
||||||
"${SIA_ARCH}" STREQUAL "wasm32" OR
|
"${SIA_ARCH}" STREQUAL "wasm32" OR
|
||||||
"${SIA_ARCH}" STREQUAL "powerpc")
|
"${SIA_ARCH}" STREQUAL "powerpc")
|
||||||
set("${var_name}" "${SIA_CASE_32_BIT}" PARENT_SCOPE)
|
set("${var_name}" "${SIA_CASE_32_BIT}" PARENT_SCOPE)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ option(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB
|
|||||||
"Enable build of the embedded Swift standard library and runtime"
|
"Enable build of the embedded Swift standard library and runtime"
|
||||||
TRUE)
|
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)
|
set(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB FALSE)
|
||||||
elseif(NOT SWIFT_INCLUDE_TOOLS)
|
elseif(NOT SWIFT_INCLUDE_TOOLS)
|
||||||
# Temporarily, only build embedded stdlib when building the compiler, to
|
# Temporarily, only build embedded stdlib when building the compiler, to
|
||||||
@@ -151,13 +151,37 @@ endif()
|
|||||||
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
|
if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
|
||||||
set(EMBEDDED_STDLIB_TARGET_TRIPLES
|
set(EMBEDDED_STDLIB_TARGET_TRIPLES
|
||||||
# arch module_name target triple
|
# 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"
|
"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"
|
"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"
|
"x86_64 x86_64-apple-macos x86_64-apple-macos10.13"
|
||||||
"arm64 arm64-apple-macos arm64-apple-macos10.13"
|
"arm64 arm64-apple-macos arm64-apple-macos10.13"
|
||||||
"arm64e arm64e-apple-macos arm64e-apple-macos10.13"
|
"arm64e arm64e-apple-macos arm64e-apple-macos10.13"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SWIFT_BUILD_STDLIB)
|
if(SWIFT_BUILD_STDLIB)
|
||||||
# These must be kept in dependency order so that any referenced targets
|
# These must be kept in dependency order so that any referenced targets
|
||||||
|
|||||||
@@ -198,10 +198,19 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB AND SWIFT_SHOULD_BUILD_EMBEDDED_CONCURRENC
|
|||||||
list(GET list 1 mod)
|
list(GET list 1 mod)
|
||||||
list(GET list 2 triple)
|
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$")
|
if(NOT "${mod}" MATCHES "-macos$")
|
||||||
continue()
|
continue()
|
||||||
endif()
|
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_ARCH_${mod}_MODULE "${mod}")
|
||||||
set(SWIFT_SDK_embedded_LIB_SUBDIR "embedded")
|
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
|
TaskCancellation.swift
|
||||||
|
|
||||||
SWIFT_COMPILE_FLAGS
|
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
|
-parse-stdlib -DSWIFT_CONCURRENCY_EMBEDDED
|
||||||
${SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS}
|
${SWIFT_RUNTIME_CONCURRENCY_SWIFT_FLAGS}
|
||||||
C_COMPILE_FLAGS
|
C_COMPILE_FLAGS
|
||||||
-D__MACH__ -D__APPLE__ -ffreestanding
|
${extra_c_compile_flags} ${SWIFT_RUNTIME_CONCURRENCY_C_FLAGS} -DSWIFT_CONCURRENCY_EMBEDDED=1
|
||||||
${SWIFT_RUNTIME_CONCURRENCY_C_FLAGS} -DSWIFT_CONCURRENCY_EMBEDDED=1
|
|
||||||
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
|
MODULE_DIR "${CMAKE_BINARY_DIR}/lib/swift/embedded"
|
||||||
SDK "embedded"
|
SDK "embedded"
|
||||||
ARCHITECTURE "${mod}"
|
ARCHITECTURE "${mod}"
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
import Builtin
|
import Builtin
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@_silgen_name("putchar")
|
@_silgen_name("putchar")
|
||||||
func putchar(_: UInt8)
|
func putchar(_: UInt8)
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public struct MyStruct {
|
public struct MyStruct {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@_silgen_name("putchar")
|
@_silgen_name("putchar")
|
||||||
func putchar(_: UInt8)
|
func putchar(_: UInt8)
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct Main {
|
struct Main {
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
class MyClass {
|
class MyClass {
|
||||||
init() { print("MyClass.init") }
|
init() { print("MyClass.init") }
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public class MyClass {
|
public class MyClass {
|
||||||
public init() { print("MyClass.init") }
|
public init() { print("MyClass.init") }
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
class MyClass {
|
class MyClass {
|
||||||
init() { print("MyClass.init") }
|
init() { print("MyClass.init") }
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public class MyClass {
|
public class MyClass {
|
||||||
var handler: (()->())? = nil
|
var handler: (()->())? = nil
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@_silgen_name("putchar")
|
@_silgen_name("putchar")
|
||||||
func putchar(_: UInt8)
|
func putchar(_: UInt8)
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: OS=macosx
|
// REQUIRES: OS=macosx
|
||||||
|
|
||||||
import _Concurrency
|
import _Concurrency
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: OS=macosx
|
// REQUIRES: OS=macosx
|
||||||
|
|
||||||
import _Concurrency
|
import _Concurrency
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: OS=macosx
|
// REQUIRES: OS=macosx
|
||||||
|
|
||||||
import Builtin
|
import Builtin
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: OS=macosx
|
// REQUIRES: OS=macosx
|
||||||
|
|
||||||
import _Concurrency
|
import _Concurrency
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@_silgen_name("putchar")
|
@_silgen_name("putchar")
|
||||||
func putchar(_: UInt8)
|
func putchar(_: UInt8)
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func foo<T>(_ array: inout [T]) {
|
public func foo<T>(_ array: inout [T]) {
|
||||||
array.withUnsafeMutableBytes {
|
array.withUnsafeMutableBytes {
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct Main {
|
struct Main {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -parse-as-library -module-name main | %FileCheck %s
|
// RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded -parse-as-library -module-name main | %FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
class MyClass {
|
class MyClass {
|
||||||
init() {
|
init() {
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func foo() -> [Int] {
|
public func foo() -> [Int] {
|
||||||
var a = [1, 2, 3]
|
var a = [1, 2, 3]
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
|
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
struct User {
|
struct User {
|
||||||
let o: BaseClass
|
let o: BaseClass
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
protocol Fooable {
|
protocol Fooable {
|
||||||
func foo()
|
func foo()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: OS=macosx
|
// REQUIRES: OS=macosx
|
||||||
|
|
||||||
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
|
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func sink<T>(t: T) {}
|
public func sink<T>(t: T) {}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN MyModule.swift
|
// BEGIN MyModule.swift
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN MyModule.swift
|
// BEGIN MyModule.swift
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,7 @@
|
|||||||
// RUN: %target-swift-frontend -emit-ir -I %t %t/Main.swift -enable-experimental-feature Embedded -parse-as-library | %FileCheck %s
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// Dependencies look like this:
|
// Dependencies look like this:
|
||||||
//
|
//
|
||||||
@@ -44,4 +43,4 @@ public func main() {
|
|||||||
MyModuleC.foo()
|
MyModuleC.foo()
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK: @"$s9MyModuleA6globalSivp" = global %TSi zeroinitializer
|
// CHECK: @"$s9MyModuleA6globalSivp" = {{.*}}global %TSi zeroinitializer
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// RUN: %target-swift-frontend -emit-ir -I %t %t/Main.swift -enable-experimental-feature Embedded -parse-as-library | %FileCheck %s
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN MyModule.swift
|
// BEGIN MyModule.swift
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ public func main() {
|
|||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
|
|
||||||
// CHECK: @"$s4Main022global_in_client_used_c1_D0Sivp" = global %TSi zeroinitializer
|
// CHECK: @"$s4Main022global_in_client_used_c1_D0Sivp" = {{.*}}global %TSi zeroinitializer
|
||||||
// CHECK: @"$s4Main024global_in_client_unused_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: @"$s8MyModule022global_in_module_used_d1_E0Sivp" = {{.*}}global %TSi zeroinitializer
|
||||||
// CHECK: @"$s8MyModule024global_in_module_unused_d1_E0Sivp" = global %TSi zeroinitializer
|
// CHECK: @"$s8MyModule024global_in_module_unused_d1_E0Sivp" = {{.*}}global %TSi zeroinitializer
|
||||||
|
|||||||
@@ -9,8 +9,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN MyModule.swift
|
// BEGIN MyModule.swift
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
|
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func staticstring() -> StaticString {
|
public func staticstring() -> StaticString {
|
||||||
return "hello"
|
return "hello"
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public struct MyStructA {
|
public struct MyStructA {
|
||||||
static var singleton = MyStructA()
|
static var singleton = MyStructA()
|
||||||
|
|||||||
@@ -2,14 +2,13 @@
|
|||||||
// RUN: %{python} %utils/split_file.py -o %t %s
|
// 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-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
|
// RUN: %target-run %t/a.out | %FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN BridgingHeader.h
|
// BEGIN BridgingHeader.h
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
|
// For LTO, the linker dlopen()'s the libLTO library, which is a scenario that
|
||||||
// ASan cannot work in ("Interceptors are not working, AddressSanitizer is
|
// ASan cannot work in ("Interceptors are not working, AddressSanitizer is
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// RUN: %target-swift-emit-ir -Osize %s -enable-experimental-feature Embedded | %FileCheck %s
|
// RUN: %target-swift-emit-ir -Osize %s -enable-experimental-feature Embedded | %FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func foo<T>(n: T) {
|
public func foo<T>(n: T) {
|
||||||
bar(n: 42)
|
bar(n: 42)
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func foo() {
|
public func foo() {
|
||||||
bar([42])
|
bar([42])
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
|
|
||||||
public func test() {}
|
public func test() {}
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
// REQUIRES: CPU=arm64e
|
// REQUIRES: CPU=arm64e
|
||||||
|
|
||||||
// BEGIN header.h
|
// BEGIN header.h
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
// REQUIRES: CPU=arm64e
|
// REQUIRES: CPU=arm64e
|
||||||
|
|
||||||
// BEGIN header.h
|
// BEGIN header.h
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@main
|
@main
|
||||||
struct Main {
|
struct Main {
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
@_silgen_name("putchar")
|
@_silgen_name("putchar")
|
||||||
func putchar(_: UInt8)
|
func putchar(_: UInt8)
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
// RUN: %target-swift-frontend -Osize -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
|
// RUN: %target-swift-frontend -Osize -emit-ir %t/Main.swift -I%t -enable-experimental-feature Embedded
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
// BEGIN Module.swift
|
// BEGIN Module.swift
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func stringArray() -> [StaticString] {
|
public func stringArray() -> [StaticString] {
|
||||||
return ["a", "b", "c", "d"]
|
return ["a", "b", "c", "d"]
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public struct MyInterpolation : StringInterpolationProtocol {
|
public struct MyInterpolation : StringInterpolationProtocol {
|
||||||
public typealias StringLiteralType = StaticString
|
public typealias StringLiteralType = StaticString
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
|
|
||||||
public func bool() -> Bool {
|
public func bool() -> Bool {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
|
|
||||||
class MyClass {}
|
class MyClass {}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded -throws-as-traps | %FileCheck %s
|
// RUN: %target-swift-frontend -emit-ir %s -enable-experimental-feature Embedded -throws-as-traps | %FileCheck %s
|
||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func test() {
|
public func test() {
|
||||||
withUnsafeTemporaryAllocation(byteCount: MemoryLayout<Int>.size, alignment: MemoryLayout<Int>.alignment) { p in
|
withUnsafeTemporaryAllocation(byteCount: MemoryLayout<Int>.size, alignment: MemoryLayout<Int>.alignment) { p in
|
||||||
|
|||||||
@@ -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
|
// 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: swift_in_compiler
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
enum MyError : Error {
|
enum MyError : Error {
|
||||||
case a
|
case a
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: executable_test
|
// REQUIRES: executable_test
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public enum MyError : Error, Equatable {
|
public enum MyError : Error, Equatable {
|
||||||
case a
|
case a
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
// REQUIRES: swift_in_compiler
|
// REQUIRES: swift_in_compiler
|
||||||
// REQUIRES: optimized_stdlib
|
// REQUIRES: optimized_stdlib
|
||||||
// REQUIRES: VENDOR=apple
|
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||||
// REQUIRES: OS=macosx
|
|
||||||
|
|
||||||
public func unsafeWriteArray<T, R>(_ elementType: R.Type, array: inout T, index n: Int, value: R) {
|
public func unsafeWriteArray<T, R>(_ elementType: R.Type, array: inout T, index n: Int, value: R) {
|
||||||
precondition(_isPOD(elementType))
|
precondition(_isPOD(elementType))
|
||||||
|
|||||||
Reference in New Issue
Block a user