mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 22:34:39 +00:00
[MC] Issue error message when data region is not terminated
llvm-svn: 324868
This commit is contained in:
parent
64c8bc6792
commit
91a20825ce
@ -945,7 +945,13 @@ void MachObjectWriter::writeObject(MCAssembler &Asm,
|
||||
it != ie; ++it) {
|
||||
const DataRegionData *Data = &(*it);
|
||||
uint64_t Start = getSymbolAddress(*Data->Start, Layout);
|
||||
uint64_t End = getSymbolAddress(*Data->End, Layout);
|
||||
uint64_t End;
|
||||
if (Data->End)
|
||||
End = getSymbolAddress(*Data->End, Layout);
|
||||
else
|
||||
report_fatal_error("Data region not terminated");
|
||||
|
||||
|
||||
DEBUG(dbgs() << "data in code region-- kind: " << Data->Kind
|
||||
<< " start: " << Start << "(" << Data->Start->getName() << ")"
|
||||
<< " end: " << End << "(" << Data->End->getName() << ")"
|
||||
|
8
test/MC/X86/check-end-of-data-region.s
Normal file
8
test/MC/X86/check-end-of-data-region.s
Normal file
@ -0,0 +1,8 @@
|
||||
// RUN: not llvm-mc -triple=x86_64-apple-darwin -filetype=obj -o /dev/null %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
|
||||
|
||||
.align 4
|
||||
.data_region jt32
|
||||
foo:
|
||||
.long 0
|
||||
|
||||
// CHECK-ERROR: LLVM ERROR: Data region not terminated
|
Loading…
x
Reference in New Issue
Block a user