llvm-project/llvm/test/TableGen/if-unresolved-cast.td
Philip Reames 8a4451cdc3 [llvm-tblgen] Support conditional definitions using !casts clauses
This is a follow on to D145108. This started as simply fixing the crash on an error case reported against that change, but I think this also ends up fixing the original reported issue (https://github.com/llvm/llvm-project/issues/49830) as well. More accurately, D145108 fixed the case where the cast resolves to an existing record, and this change fixes the case where the named record doesn't exist.

Differential Revision: https://reviews.llvm.org/D145711
2023-03-10 15:50:11 -08:00

9 lines
162 B
TableGen

// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s
// XFAIL: vg_leak
class A { int x; }
// CHECK: Undefined reference to record: ''
if !cast<A>("").x then
def x;