mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +00:00
DataLayout: Validate that the pref alignment is at least the ABI align
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c859e73a24
commit
2b022d53a3
@ -424,7 +424,10 @@ DataLayout::findPointerLowerBound(uint32_t AddressSpace) {
|
||||
void DataLayout::setPointerAlignment(uint32_t AddrSpace, unsigned ABIAlign,
|
||||
unsigned PrefAlign,
|
||||
uint32_t TypeByteWidth) {
|
||||
assert(ABIAlign <= PrefAlign && "Preferred alignment worse than ABI!");
|
||||
if (PrefAlign < ABIAlign)
|
||||
report_fatal_error(
|
||||
"Preferred alignment cannot be less than the ABI alignment");
|
||||
|
||||
PointersTy::iterator I = findPointerLowerBound(AddrSpace);
|
||||
if (I == Pointers.end() || I->AddressSpace != AddrSpace) {
|
||||
Pointers.insert(I, PointerAlignElem::get(AddrSpace, ABIAlign, PrefAlign,
|
||||
|
3
test/Assembler/invalid-datalayout18.ll
Normal file
3
test/Assembler/invalid-datalayout18.ll
Normal file
@ -0,0 +1,3 @@
|
||||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
||||
target datalayout = "p:32:32:16"
|
||||
; CHECK: Preferred alignment cannot be less than the ABI alignment
|
Loading…
x
Reference in New Issue
Block a user