[clang][tests] Add missing compiler name
authorTimm Bäder <tbaeder@redhat.com>
Thu, 9 Jun 2022 13:10:29 +0000 (15:10 +0200)
committerTimm Bäder <tbaeder@redhat.com>
Thu, 9 Jun 2022 13:11:40 +0000 (15:11 +0200)
The driver stripts the first argument. Without the compiler name, the
test depends on whether GCC_INSTALL_PREFIX is set or not.

See https://reviews.llvm.org/D125862

clang/unittests/Driver/ToolChainTest.cpp

index 3f59fd4..33389a5 100644 (file)
@@ -595,7 +595,7 @@ TEST(ToolChainTest, Toolsets) {
     Driver TheDriver("/bin/clang", "x86_64-redhat-linux", Diags,
                      "clang LLVM compiler", InMemoryFileSystem);
     std::unique_ptr<Compilation> C(
-        TheDriver.BuildCompilation({"--gcc-toolchain="}));
+        TheDriver.BuildCompilation({"clang", "--gcc-toolchain="}));
     ASSERT_TRUE(C);
     std::string S;
     {
@@ -635,7 +635,7 @@ TEST(ToolChainTest, Toolsets) {
     Driver TheDriver("/bin/clang", "x86_64-redhat-linux", Diags,
                      "clang LLVM compiler", InMemoryFileSystem);
     std::unique_ptr<Compilation> C(
-        TheDriver.BuildCompilation({"--gcc-toolchain="}));
+        TheDriver.BuildCompilation({"clang", "--gcc-toolchain="}));
     ASSERT_TRUE(C);
     std::string S;
     {