mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
15 lines
555 B
Swift
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
|