Skip to content

Commit 46d188e

Browse files
committed
Merge remote-tracking branch 'origin/main' into rebranch
2 parents e5f97d7 + c9b0a2a commit 46d188e

File tree

7 files changed

+49
-1
lines changed

7 files changed

+49
-1
lines changed

lib/Serialization/ModuleFileSharedCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ bool ModuleFileSharedCore::hasSourceInfo() const {
18291829
std::string ModuleFileSharedCore::resolveModuleDefiningFilePath(const StringRef SDKPath) const {
18301830
if (!ModuleInterfacePath.empty()) {
18311831
std::string interfacePath = ModuleInterfacePath.str();
1832-
if (llvm::sys::path::is_relative(interfacePath)) {
1832+
if (llvm::sys::path::is_relative(interfacePath) && !ModuleInterfacePath.starts_with(SDKPath)) {
18331833
SmallString<128> absoluteInterfacePath(SDKPath);
18341834
llvm::sys::path::append(absoluteInterfacePath, interfacePath);
18351835
return absoluteInterfacePath.str().str();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -target arm64-apple-macosx15.0 -module-name OtherModule -O
3+
4+
import Swift
5+
6+
public struct OtherStruct {
7+
var x : Int
8+
public init()
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -disable-objc-attr-requires-foundation-module -target arm64-apple-macosx15.0 -enable-objc-interop -enable-library-evolution -module-link-name swiftCore -parse-stdlib -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -enable-experimental-concise-pound-file -target-min-inlining-version min -module-name Swift
3+
4+
public struct Int {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -disable-objc-attr-requires-foundation-module -target arm64-apple-macosx15.0 -enable-objc-interop -enable-library-evolution -module-link-name swiftSwiftOnoneSupport -parse-stdlib -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -target-min-inlining-version min -module-name SwiftOnoneSupport
3+
4+
import Swift
5+
6+
public let x: Swift.Int
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -disable-objc-attr-requires-foundation-module -target arm64-apple-macosx15.0 -enable-objc-interop -enable-library-evolution -module-link-name swift_Concurrency -parse-stdlib -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -target-min-inlining-version min -module-name _Concurrency
3+
4+
import Swift
5+
6+
@frozen public enum Task {}
7+
8+
public let x: Swift.Int
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -target arm64-apple-macosx15.0 -enable-objc-interop -enable-library-evolution -module-link-name swift_StringProcessing -swift-version 5 -O -library-level api -enforce-exclusivity=unchecked -target-min-inlining-version min -module-name _StringProcessing
3+
4+
import Swift
5+
6+
public let x: Swift.Int
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %empty-directory(%t.relative_sdk_path)
2+
// RUN: %empty-directory(%t.mcp)
3+
4+
// RUN: cp -R %S/Inputs/stdlib_rebuild %t.relative_sdk_path/
5+
// RUN: cd %t.relative_sdk_path
6+
7+
// RUN: %target-swift-frontend(mock-sdk: -sdk stdlib_rebuild -module-cache-path %t.mcp) -target arm64-apple-macosx15.0 -resource-dir /dev/null -o %t.relative_sdk_path -emit-object %s
8+
9+
// REQUIRES: OS=macosx
10+
11+
import OtherModule
12+
13+
func fn(_: Int) {
14+
let _ = OtherStruct()
15+
}

0 commit comments

Comments
 (0)