mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
ae1e3d0865
The new library, swiftEmbeddedPlatformPOSIX, implements all of the _swift_XYZ functions needed to support Embedded Swift as shims on top of a POSIX system that provides posix_memalign, free, putchar, and so on. This offers an easier way to bridge between the prior ad hoc requirements of Embedded Swift and the newer platform abstraction layer. Part of rdar://164057124
40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleA.swift -o %t/MyModuleA.o -emit-module -emit-module-path %t/MyModuleA.swiftmodule -emit-empty-object-file
|
|
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleB.swift -o %t/MyModuleB.o -emit-module -emit-module-path %t/MyModuleB.swiftmodule -emit-empty-object-file
|
|
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t -parse-as-library %t/MyModuleC.swift -o %t/MyModuleC.o -emit-module -emit-module-path %t/MyModuleC.swiftmodule -emit-empty-object-file
|
|
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -c -I%t %t/Main.swift -o %t/Main.o
|
|
// RUN: %target-clang %target-clang-resource-dir-opt %t/Main.o %t/MyModuleA.o %t/MyModuleB.o %t/MyModuleC.o %target-embedded-posix-shim -o %t/a.out
|
|
// RUN: %target-run %t/a.out
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
//--- MyModuleA.swift
|
|
|
|
public func a() {}
|
|
|
|
//--- MyModuleB.swift
|
|
|
|
import MyModuleA
|
|
|
|
public func b() {}
|
|
|
|
//--- MyModuleC.swift
|
|
|
|
import MyModuleB
|
|
|
|
public func c() {}
|
|
|
|
//--- Main.swift
|
|
|
|
import MyModuleA
|
|
import MyModuleB
|
|
import MyModuleC
|
|
|
|
a()
|
|
b()
|
|
c()
|