Files
swift-mirror/test/SourceKit/Indexing/index_with_swift_module.swift
Jordan Rose 43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00

35 lines
1.2 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %swift -emit-module -o %t/test_module.swiftmodule %S/Inputs/test_module.swift
// RUN: %sourcekitd-test -req=index %s -- %s -I %t | %FileCheck %s
// RUN: %sourcekitd-test -req=index %t/test_module.swiftmodule | %sed_clean > %t.response
// RUN: diff -u %S/Inputs/test_module.index.response %t.response
import test_module
func foo(a: TwoInts) {
}
// CHECK: key.kind: source.lang.swift.import.module.swift
// CHECK-NEXT: key.name: "Swift"
// CHECK-NEXT: key.filepath: "{{.*[/\\]Swift[.]swiftmodule([/\\].+[.]swiftmodule)?}}"
// CHECK-NEXT: key.hash:
// CHECK: key.kind: source.lang.swift.import.module.swift
// CHECK-NEXT: key.name: "test_module"
// CHECK-NEXT: key.filepath: "{{.*[/\\]}}test_module.swiftmodule"
// CHECK-NEXT: key.hash:
// CHECK: key.kind: source.lang.swift.ref.module
// CHECK-NEXT: key.name: "test_module"
// CHECK-NEXT: key.usr: "c:@M@test_module"
// CHECK: key.kind: source.lang.swift.ref.class
// CHECK-NEXT: key.name: "TwoInts"
// CHECK-NEXT: key.usr: "s:11test_module7TwoIntsC"
// RUN: %sourcekitd-test -req=index %S/Inputs/Swift.swiftmodule | %FileCheck %s -check-prefix=CHECK-SWIFT1
// CHECK-SWIFT1-DAG: key.groupname: "Bool"
// CHECK-SWIFT1-DAG: key.groupname: "Collection"