diff options
author | Nicolai Haehnle <nhaehnle@gmail.com> | 2018-03-06 13:48:47 +0000 |
---|---|---|
committer | Nicolai Haehnle <nhaehnle@gmail.com> | 2018-03-06 13:48:47 +0000 |
commit | 0f529885fad55a42a81625cb8894e7646bc2761f (patch) | |
tree | e58cf00087981ccec537b7d28304f1cee4a79bc1 /llvm/test | |
parent | dfda9dcc1dfc4c50b7b3f538b9a629163dc44ee7 (diff) | |
download | bcm5719-llvm-0f529885fad55a42a81625cb8894e7646bc2761f.tar.gz bcm5719-llvm-0f529885fad55a42a81625cb8894e7646bc2761f.zip |
TableGen: Explicitly check whether a record has been resolved
Summary:
There are various places where resolving and constant folds can
get stuck, especially around casts. We don't always signal an
error for those, because in many cases they can legitimately
occur without being an error in the "untaken branch" of an !if.
Change-Id: I3befc0e4234c8e6cc61190504702918c9f29ce5c
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43754
llvm-svn: 326786
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/TableGen/BitOffsetDecoder.td | 10 | ||||
-rw-r--r-- | llvm/test/TableGen/BitsInitOverflow.td | 4 |
2 files changed, 2 insertions, 12 deletions
diff --git a/llvm/test/TableGen/BitOffsetDecoder.td b/llvm/test/TableGen/BitOffsetDecoder.td index ec0ceeee8a6..a928664398f 100644 --- a/llvm/test/TableGen/BitOffsetDecoder.td +++ b/llvm/test/TableGen/BitOffsetDecoder.td @@ -55,18 +55,8 @@ def baz : Instruction { field bits<16> SoftFail = 0; } -def bum : Instruction { - let InOperandList = (ins i32imm:$factor); - field bits<16> Inst; - bits<32> factor; - let Inst{7-0} = 0xEE; - let Inst{15-8} = !srl(factor,5); - let AsmString = "bum $factor"; - field bits<16> SoftFail = 0; - } } - // CHECK: tmp = fieldFromInstruction(insn, 8, 7); // CHECK: tmp = fieldFromInstruction(insn, 8, 8) << 3; // CHECK: tmp |= fieldFromInstruction(insn, 8, 4) << 7; diff --git a/llvm/test/TableGen/BitsInitOverflow.td b/llvm/test/TableGen/BitsInitOverflow.td index b2804053d25..cf5d1ca85bc 100644 --- a/llvm/test/TableGen/BitsInitOverflow.td +++ b/llvm/test/TableGen/BitsInitOverflow.td @@ -1,8 +1,8 @@ -// RUN: llvm-tblgen %s | FileCheck %s +// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s // Check that a large integer is not truncated to a small bit sequence. // -// CHECK: bits<2> X = { !cast<bits<2>>(5){1}, !cast<bits<2>>(5){0} }; +// CHECK: error: Initializer of 'X' in 'anonymous_0' could not be fully resolved: def { bits<2> X = 5; // bitfield is too small, reject |