================
@@ -78,6 +78,43 @@ TEST(DarwinSDKInfo, VersionMappingParseError) {
.has_value());
}
+TEST(DarwinSDKInfo, SystemPrefix) {
+ llvm::json::Object SDKSettings({{"CanonicalName", "macosx26.0"},
+ {"Version", "26.0"},
+ {"MaximumDeploymentTarget", "26.0.99"}});
+ llvm::json::Object SupportedTargets;
+ llvm::json::Object MacOS({{"Archs", {"x86_64", "arm64"}},
+ {"LLVMTargetTripleVendor", "apple"},
+ {"LLVMTargetTripleSys", "macos"},
+ {"LLVMTargetTripleEnvironment", ""},
+ {"SystemPrefix", "/System/macOSSupport"}});
+ llvm::json::Object MacCatalyst({{"Archs", {"x86_64", "arm64"}},
+ {"LLVMTargetTripleVendor", "apple"},
+ {"LLVMTargetTripleSys", "ios"},
+ {"LLVMTargetTripleEnvironment", "macabi"},
+ {"SystemPrefix", "/System/iOSSupport"}});
+ llvm::json::Object DriverKit({{"Archs", {"x86_64", "arm64"}},
+ {"LLVMTargetTripleVendor", "apple"},
+ {"LLVMTargetTripleSys", "driverkit"},
+ {"LLVMTargetTripleEnvironment", ""},
+ {"SystemPrefix", ""}});
+ SupportedTargets["macosx"] = std::move(MacOS);
+ SupportedTargets["iosmac"] = std::move(MacCatalyst);
+ SupportedTargets["driverkit"] = std::move(DriverKit);
+ SDKSettings["SupportedTargets"] = std::move(SupportedTargets);
+
+ auto SDKInfo = DarwinSDKInfo::parseDarwinSDKSettingsJSON(&SDKSettings);
+ ASSERT_TRUE(SDKInfo);
+ EXPECT_EQ(SDKInfo->getSystemPrefix(Triple("arm64-apple-macos26.0")),
+ "/System/macOSSupport");
+ EXPECT_EQ(SDKInfo->getSystemPrefix(Triple("ppc-apple-macos26.0")),
+ "/System/macOSSupport");
+ EXPECT_EQ(SDKInfo->getSystemPrefix(Triple("arm64-apple-ios26.0")),
+ "/System/macOSSupport");
+ EXPECT_EQ(SDKInfo->getSystemPrefix(Triple("arm64-apple-ios26.0-macabi")),
"");
+ EXPECT_EQ(SDKInfo->getSystemPrefix(Triple("arm64-apple-driverkit")), "");
----------------
cyndyishida wrote:
I have a similar question about this value, too. Today, DriverKit clients
always get `/System/DriverKit` regardless of the sdk version they are using,
but now this would break. Why is this desirable?
https://github.com/llvm/llvm-project/pull/171970
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits