mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
MapMetadata: Allow unresolved metadata if it won't change
Allow unresolved nodes through the `MapMetadata()` if `RF_NoModuleLevelChanges`, since there's no remapping to do anyway. This fixes PR22929. I'll add a clang test as a follow-up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -9,4 +9,5 @@ add_llvm_unittest(UtilsTests
|
||||
Cloning.cpp
|
||||
IntegerDivision.cpp
|
||||
Local.cpp
|
||||
ValueMapperTest.cpp
|
||||
)
|
||||
|
27
unittests/Transforms/Utils/ValueMapperTest.cpp
Normal file
27
unittests/Transforms/Utils/ValueMapperTest.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
//===- ValueMapper.cpp - Unit tests for ValueMapper -----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/IR/LLVMContext.h"
|
||||
#include "llvm/IR/Metadata.h"
|
||||
#include "llvm/Transforms/Utils/ValueMapper.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
TEST(ValueMapperTest, MapMetadataUnresolved) {
|
||||
LLVMContext Context;
|
||||
TempMDTuple T = MDTuple::getTemporary(Context, None);
|
||||
|
||||
ValueToValueMapTy VM;
|
||||
EXPECT_EQ(T.get(), MapMetadata(T.get(), VM, RF_NoModuleLevelChanges));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user