Files
swift-mirror/test/ModuleInterface/swift-interface-compile.swift
Saleem Abdulrasool b660d20c85 Frontend: re-serialise static library status
When compiling the swiftmodule from the textual swift interface, ensure
that we re-serialise the static or dynamic nature of the module. This is
required for proper code generation where the static and dynamic linking
is material to symbolic references. This also opens the possibility of
optimizations on other platforms via internalisation of the symbols.

Fixes: #77756
2024-11-27 14:25:17 -08:00

15 lines
555 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -module-cache-path %t/mcp -I %S/Inputs/SR77756 -c %s -o /dev/null -D STATIC
// RUN: llvm-bcanalyzer -dump %t/mcp/static-*.swiftmodule | %FileCheck %s -check-prefix CHECK-STATIC
// RUN: %target-swift-frontend -module-cache-path %t/mcp -I %S/Inputs/SR77756 -c %s -o /dev/null
// RUN: llvm-bcanalyzer -dump %t/mcp/dynamic-*.swiftmodule | %FileCheck %s -check-prefix CHECK-DYNAMIC
#if STATIC
import `static`
#else
import `dynamic`
#endif
// CHECK-STATIC: IS_STATIC
// CHECK-DYNAMIC-NOT: IS_STATIC