1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -target x86_64-unknown-windows-msvc -parse-as-library -parse-stdlib -static -emit-module -emit-module-path %t/module.swiftmodule -module-name module -DMODULE %s
// RUN: %target-swift-frontend -target x86_64-unknown-windows-msvc -parse-as-library -parse-stdlib -S -emit-ir %s -module-name main -o - -I%t | %FileCheck %s -check-prefix CHECK-STATIC
// RUN: %target-swift-frontend -target x86_64-unknown-windows-msvc -parse-as-library -parse-stdlib -emit-module -emit-module-path %t/module.swiftmodule -module-name module -DMODULE %s
// RUN: %target-swift-frontend -target x86_64-unknown-windows-msvc -parse-as-library -parse-stdlib -S -emit-ir %s -module-name main -o - -I%t | %FileCheck %s -check-prefix CHECK-SHARED
#if MODULE
public struct S {}
public var value: S {
S()
}
public func f(_ s: S) {}
public protocol P {
}
public enum E: P {
}
#else
import module
protocol Q: P {
}
extension E: Q {
}
@main
struct Entry {
public static func main() {
f(value)
}
}
#endif
// Ensure that static linking does not mark the entries as being indirected
// through the IAT.
// CHECK-STATIC: @"$s6module1EO4main1QADWP" = hidden constant [2 x ptr] [
// CHECK-STATIC-SAME: ptr @"$s6module1EO4main1QADMc",
// CHECK-STATIC-SAME: ptr @"$s6module1EOAA1PAAWP"
// CHECK-STATIC-SAME: ]
// CHECK-STATIC: declare swiftcc void @"$s6module5valueAA1SVvg"()
// CHECK-STATIC: declare swiftcc void @"$s6module1fyyAA1SVF"()
// Ensure that shared linking does mark the functions as being indirected
// through the IAT.
// CHECK-SHARED: @"$s6module1EO4main1QADWP" = hidden constant [2 x ptr] [
// CHECK-SHARED-SAME: ptr @"$s6module1EO4main1QADMc",
// CHECK-SHARED-SAME: ptr null
// CHECK-SHARED-SAME: ]
// CHECK-SHARED: declare dllimport swiftcc void @"$s6module5valueAA1SVvg"()
// CHECK-SHARED: declare dllimport swiftcc void @"$s6module1fyyAA1SVF"()
|