summaryrefslogtreecommitdiffstats
path: root/unittests/Driver
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Driver')
-rw-r--r--unittests/Driver/DistroTest.cpp7
-rw-r--r--unittests/Driver/ModuleCacheTest.cpp7
-rw-r--r--unittests/Driver/MultilibTest.cpp31
-rw-r--r--unittests/Driver/ToolChainTest.cpp7
4 files changed, 36 insertions, 16 deletions
diff --git a/unittests/Driver/DistroTest.cpp b/unittests/Driver/DistroTest.cpp
index bc1863c429..d0c86d1c54 100644
--- a/unittests/Driver/DistroTest.cpp
+++ b/unittests/Driver/DistroTest.cpp
@@ -1,9 +1,8 @@
//===- unittests/Driver/DistroTest.cpp --- ToolChains tests ---------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/unittests/Driver/ModuleCacheTest.cpp b/unittests/Driver/ModuleCacheTest.cpp
index 7340889796..db3395f4ab 100644
--- a/unittests/Driver/ModuleCacheTest.cpp
+++ b/unittests/Driver/ModuleCacheTest.cpp
@@ -1,9 +1,8 @@
//===- unittests/Driver/ModuleCacheTest.cpp -------------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/unittests/Driver/MultilibTest.cpp b/unittests/Driver/MultilibTest.cpp
index c5e8e0970d..0731c81d9f 100644
--- a/unittests/Driver/MultilibTest.cpp
+++ b/unittests/Driver/MultilibTest.cpp
@@ -1,9 +1,8 @@
//===- unittests/Driver/MultilibTest.cpp --- Multilib tests ---------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -350,3 +349,27 @@ TEST(MultilibTest, SetCombineWith) {
Latte.combineWith(Milk);
ASSERT_EQ(Latte.size(), (unsigned)2);
}
+
+TEST(MultilibTest, SetPriority) {
+ MultilibSet MS;
+ MS.push_back(Multilib("foo", {}, {}, 1).flag("+foo"));
+ MS.push_back(Multilib("bar", {}, {}, 2).flag("+bar"));
+
+ Multilib::flags_list Flags1;
+ Flags1.push_back("+foo");
+ Flags1.push_back("-bar");
+ Multilib Selection1;
+ ASSERT_TRUE(MS.select(Flags1, Selection1))
+ << "Flag set was {\"+foo\"}, but selection not found";
+ ASSERT_TRUE(Selection1.gccSuffix() == "/foo")
+ << "Selection picked " << Selection1 << " which was not expected";
+
+ Multilib::flags_list Flags2;
+ Flags2.push_back("+foo");
+ Flags2.push_back("+bar");
+ Multilib Selection2;
+ ASSERT_TRUE(MS.select(Flags2, Selection2))
+ << "Flag set was {\"+bar\"}, but selection not found";
+ ASSERT_TRUE(Selection2.gccSuffix() == "/bar")
+ << "Selection picked " << Selection2 << " which was not expected";
+}
diff --git a/unittests/Driver/ToolChainTest.cpp b/unittests/Driver/ToolChainTest.cpp
index f1181072a7..80938c83f8 100644
--- a/unittests/Driver/ToolChainTest.cpp
+++ b/unittests/Driver/ToolChainTest.cpp
@@ -1,9 +1,8 @@
//===- unittests/Driver/ToolChainTest.cpp --- ToolChain tests -------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//