Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AsmParser] Report invalid data layout more gracefully
Report this as a normal LLParser error, rather than a fatal error.
- Loading branch information
Showing
31 changed files
with
40 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
llvm/test/Assembler/datalayout-invalid-function-ptr-alignment.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
; RUN: not --crash llvm-as %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as %s 2>&1 | FileCheck %s | ||
|
||
; CHECK: LLVM ERROR: Alignment is neither 0 nor a power of 2 | ||
; CHECK: error: Alignment is neither 0 nor a power of 2 | ||
|
||
target datalayout = "Fi24" |
4 changes: 2 additions & 2 deletions
4
llvm/test/Assembler/datalayout-invalid-stack-natural-alignment.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
; RUN: not --crash llvm-as %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as %s 2>&1 | FileCheck %s | ||
|
||
; CHECK: LLVM ERROR: Alignment is neither 0 nor a power of 2 | ||
; CHECK: error: Alignment is neither 0 nor a power of 2 | ||
|
||
target datalayout = "S24" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash opt < %s 2>&1 | grep 'not a number, or does not fit in an unsigned int' | ||
; RUN: not opt < %s 2>&1 | grep 'not a number, or does not fit in an unsigned int' | ||
|
||
target datalayout = "p:4294967296:64:64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
|
||
target datalayout = "A16777216" | ||
; CHECK: Invalid address space, must be a 24-bit integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
|
||
; CHECK: Invalid address space, must be a 24-bit integer | ||
target datalayout = "G16777216" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
|
||
; CHECK: Invalid address space, must be a 24-bit integer | ||
target datalayout = "P16777216" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "^" | ||
; CHECK: Unknown specifier in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "m" | ||
; CHECK: Expected mangling specifier in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "m." | ||
; CHECK: Unexpected trailing characters after mangling specifier in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "f" | ||
; CHECK: Missing alignment specification in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = ":32" | ||
; CHECK: Expected token before separator in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "i64:64:16" | ||
; CHECK: Preferred alignment cannot be less than the ABI alignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "i64:16:16777216" | ||
; CHECK: Invalid preferred alignment, must be a 16bit integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "i64:16777216:16777216" | ||
; CHECK: Invalid ABI alignment, must be a 16bit integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "i16777216:16:16" | ||
; CHECK: Invalid bit width, must be a 24bit integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "m:v" | ||
; CHECK: Unknown mangling in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "n0" | ||
; CHECK: Zero width native integer type in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "p16777216:64:64:64" | ||
; CHECK: Invalid address space, must be a 24bit integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "a1:64" | ||
; CHECK: Sized aggregate specification in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "a:" | ||
; CHECK: Trailing separator in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "p:48:52" | ||
; CHECK: number of bits must be a byte width multiple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "e-p" | ||
; CHECK: Missing size specification for pointer in datalayout string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
; RUN: not --crash llvm-as < %s 2>&1 | FileCheck %s | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
target datalayout = "e-p:64" | ||
; CHECK: Missing alignment specification for pointer in datalayout string |
ee4d09b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙂