// RUN: %empty-directory(%t) // RUN: %target-swift-frontend -enable-experimental-feature Extern -lto=llvm-full %s -enable-experimental-feature Embedded -emit-bc -o %t/a.o // RUN: %target-clang %t/a.o -o %t/a.out // RUN: %target-run %t/a.out | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test // REQUIRES: OS=macosx // For LTO, the linker dlopen()'s the libLTO library, which is a scenario that // ASan cannot work in ("Interceptors are not working, AddressSanitizer is // loaded too late"). // REQUIRES: no_asan // REQUIRES: swift_feature_Embedded // REQUIRES: swift_feature_Extern @_extern(c, "putchar") @discardableResult func putchar(_: CInt) -> CInt public func print(_ s: StaticString, terminator: StaticString = "\n") { var p = s.utf8Start while p.pointee != 0 { putchar(CInt(p.pointee)) p += 1 } p = terminator.utf8Start while p.pointee != 0 { putchar(CInt(p.pointee)) p += 1 } } print("Hello, Embedded Swift!") // CHECK: Hello, Embedded Swift!