From 0f529885fad55a42a81625cb8894e7646bc2761f Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Tue, 6 Mar 2018 13:48:47 +0000 Subject: 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 --- llvm/test/TableGen/BitOffsetDecoder.td | 10 ---------- llvm/test/TableGen/BitsInitOverflow.td | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'llvm/test') 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>(5){1}, !cast>(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 -- cgit v1.2.3