From 324f918438715b4a0d024af5930628c1674f4fcd Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 19 Jan 2019 08:50:56 +0000 Subject: Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Driver/MultilibTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'unittests/Driver/MultilibTest.cpp') diff --git a/unittests/Driver/MultilibTest.cpp b/unittests/Driver/MultilibTest.cpp index c5e8e0970d..9dca139ab4 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 // //===----------------------------------------------------------------------===// // -- cgit v1.2.3 From b8a27facb342a656ec9e00a8e5ae58e0073e54d4 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Sat, 27 Apr 2019 00:25:11 +0000 Subject: [Driver] Support priority for multilibs When more than one multilib flag matches, try to select the best possible match based on priority. When two different multilibs with the same same priority match, we still throw an error matching the existing behavior. Differential Revision: https://reviews.llvm.org/D60990 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359359 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Driver/MultilibTest.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'unittests/Driver/MultilibTest.cpp') diff --git a/unittests/Driver/MultilibTest.cpp b/unittests/Driver/MultilibTest.cpp index 9dca139ab4..0731c81d9f 100644 --- a/unittests/Driver/MultilibTest.cpp +++ b/unittests/Driver/MultilibTest.cpp @@ -349,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"; +} -- cgit v1.2.3