Files
swift-mirror/test/embedded/modules-used2.swift
T
Pavel Yaskevich 60ea598e7f [SIL] Set actor isolation when constructing/initializing SILFunction
Prevents situations when actor isolation ends up not being set
un-intentionally i.e. when cloning, specializating, or creating
thunks.

The thunks get `unspecified` isolation at the moment.
2026-04-21 16:03:35 -07:00

42 lines
1.4 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library -I %t %t/Main.swift -emit-sil | %FileCheck %s --check-prefix CHECK-SIL
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library -I %t %t/Main.swift -c -o %t/a.o
// RUN: %target-clang %target-clang-resource-dir-opt %t/a.o %target-embedded-posix-shim -o %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: swift_feature_Embedded
// BEGIN MyModule.swift
@used
@_cdecl("main")
func main() -> CInt {
print("main in a submodule")
return 0
}
@used
func foo() {
}
// BEGIN Main.swift
import MyModule
// CHECK-SIL: // main()
// CHECK-SIL-NEXT: // Isolation: unspecified
// CHECK-SIL-NEXT: sil [used] @$e8MyModule4mains5Int32VyF : $@convention(thin) () -> Int32 {
// CHECK-SIL: // @objc main
// CHECK-SIL-NEXT: // Isolation: unspecified
// CHECK-SIL-NEXT: sil [thunk] [used] [asmname "main"] @$e8MyModule4mains5Int32VyFTo : $@convention(c) () -> Int32
// CHECK-SIL: // foo()
// CHECK-SIL-NEXT: // Isolation: unspecified
// CHECK-SIL-NEXT: sil [used] @$e8MyModule3fooyyF : $@convention(thin) () -> () {
// CHECK: main in a submodule