mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The APIJSON tests used the default module cache and generated different modules under the same name. This lead some tests to load a different module than intended. This was made more easily detectable with the lock on the swiftmodules instead of the swiftinterfaces.
53 lines
2.0 KiB
Swift
53 lines
2.0 KiB
Swift
// REQUIRES: objc_interop, OS=macosx
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend %s -typecheck -emit-module-interface-path %t/MyModule.swiftinterface -enable-library-evolution -module-name MyModule -swift-version 5
|
|
// RUN: %target-swift-api-extract -o - -pretty-print %t/MyModule.swiftinterface -module-name MyModule -module-cache-path %t | %FileCheck %s
|
|
|
|
// Struct has no objc data.
|
|
@available(macOS 10.13, *)
|
|
public struct TestStruct {
|
|
public init() {}
|
|
|
|
@available(macOS 10.14, *)
|
|
public func testMethod() {}
|
|
}
|
|
|
|
// CHECK: {
|
|
// CHECK-NEXT: "target":
|
|
// CHECK-NEXT: "globals": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "name": "_$s8MyModule10TestStructV10testMethodyyF",
|
|
// CHECK-NEXT: "access": "public",
|
|
// CHECK-NEXT: "file": "/@input/MyModule.swiftinterface",
|
|
// CHECK-NEXT: "linkage": "exported",
|
|
// CHECK-NEXT: "introduced": "10.14"
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVACycfC",
|
|
// CHECK-NEXT: "access": "public",
|
|
// CHECK-NEXT: "file": "/@input/MyModule.swiftinterface",
|
|
// CHECK-NEXT: "linkage": "exported"
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVMa",
|
|
// CHECK-NEXT: "access": "public",
|
|
// CHECK-NEXT: "file": "/@input/MyModule.swiftinterface",
|
|
// CHECK-NEXT: "linkage": "exported"
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVMn",
|
|
// CHECK-NEXT: "access": "public",
|
|
// CHECK-NEXT: "file": "/@input/MyModule.swiftinterface",
|
|
// CHECK-NEXT: "linkage": "exported"
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "name": "_$s8MyModule10TestStructVN",
|
|
// CHECK-NEXT: "access": "public",
|
|
// CHECK-NEXT: "file": "/@input/MyModule.swiftinterface",
|
|
// CHECK-NEXT: "linkage": "exported"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "interfaces": [],
|
|
// CHECK-NEXT: "version": "1.0"
|
|
// CHECK-NEXT: }
|