Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / unittests / DWARFLinkerParallel / DWARFLinkerTest.cpp
blob50c91396d6a1c5a3c3388672005da2996254f52b
1 //===- llvm/unittest/DWARFLinkerParallel/DWARFLinkerTest.cpp --------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DWARFLinker/Utils.h"
10 #include "gtest/gtest.h"
12 using namespace llvm;
13 using namespace dwarf_linker;
15 #define DEVELOPER_DIR "/Applications/Xcode.app/Contents/Developer"
17 namespace {
19 TEST(DWARFLinker, PathTest) {
20 EXPECT_EQ(guessDeveloperDir("/Foo"), "");
21 EXPECT_EQ(guessDeveloperDir("Foo.sdk"), "");
22 EXPECT_EQ(guessDeveloperDir(
23 DEVELOPER_DIR
24 "/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk"),
25 DEVELOPER_DIR);
26 EXPECT_EQ(guessDeveloperDir(DEVELOPER_DIR "/SDKs/MacOSX.sdk"), DEVELOPER_DIR);
27 EXPECT_TRUE(
28 isInToolchainDir("/Library/Developer/Toolchains/"
29 "swift-DEVELOPMENT-SNAPSHOT-2024-05-15-a.xctoolchain/"
30 "usr/lib/swift/macosx/_StringProcessing.swiftmodule/"
31 "arm64-apple-macos.private.swiftinterface"));
32 EXPECT_FALSE(isInToolchainDir("/Foo/not-an.xctoolchain/Bar/Baz"));
35 } // anonymous namespace