mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	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
		
			
				
	
	
		
			28 lines
		
	
	
		
			743 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			743 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| //===- 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));
 | |
| }
 | |
| 
 | |
| }
 |