mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When building against the static standard library, we should define `SWIFT_STATIC_STDLIB` to indicate to the shims that the declarations should be giving hidden visibility and default DLL storage. This is required to ensure that these symbols are known to be `dso_local` when compiling to avoid an unnecessary look up through the PLT/GOT or the indirection through the synthesized `__imp_` symbol and the IAT. This corrects a number of incorrect code generation cases on Windows with the static standard library.
6 lines
444 B
Swift
6 lines
444 B
Swift
// RUN: %swift_frontend_plain -parse-stdlib -typecheck %s -dump-clang-diagnostics 2>&1 | %FileCheck %s -check-prefix CHECK-DYNAMIC
|
|
// RUN: %swift_frontend_plain -parse-stdlib -use-static-resource-dir -typecheck %s -dump-clang-diagnostics 2>&1 | %FileCheck %s -check-prefix CHECK-STATIC
|
|
|
|
// CHECK-DYNAMIC-NOT: clang importer cc1 args: {{.*}} '-D' 'SWIFT_STATIC_STDLIB'
|
|
// CHECK-STATIC: clang importer cc1 args: {{.*}} '-D' 'SWIFT_STATIC_STDLIB'
|