//===- ROCm.cpp -------------------------------------------------*- C++ -*-===// // // This file is licensed 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 // //===----------------------------------------------------------------------===// // The purpose of this test is to showcase a more singular usage of LLD as a // library, where only one LLD driver is being used (and linked in the target // application). We also expect that linking twice the same object files // would yield a successfull result. When used as library, LLD always cleans its // internal memory context after each linker call. //===----------------------------------------------------------------------===// // When this flag is on, we actually need the MinGW driver library, not the // ELF one. Here our test only covers the case where the ELF driver is linked // into the unit test binary. #ifndef LLD_DEFAULT_LD_LLD_IS_MINGW #include "lld/Common/Driver.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/Path.h" #include "gmock/gmock.h" #include <algorithm> static std::string expand(const char *path) { … } LLD_HAS_DRIVER(…) static bool lldInvoke(const char *inPath, const char *outPath) { … } static bool runLinker(const char *path) { … } TEST(AsLib, ROCm) { … } #endif