mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
This commit is contained in:
14
test/ModuleInterface/swift-interface-compile.swift
Normal file
14
test/ModuleInterface/swift-interface-compile.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
// 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
|
||||
Reference in New Issue
Block a user