Files
archived-llvm/test/TableGen/eq.td
Nicolai Haehnle af0de5073c TableGen: Add !ne, !le, !lt, !ge, and !gt comparisons
Change-Id: I8e2ece677268972d578a787467f7ef52a1f33a71

Differential revision: https://reviews.llvm.org/D44114

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327496 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:57 +00:00

31 lines
563 B
TableGen

// RUN: llvm-tblgen %s | FileCheck %s
// XFAIL: vg_leak
// CHECK-LABEL: def FALSE {
// CHECK: int Value = 0;
// CHECK: }
// CHECK-LABEL: def TRUE {
// CHECK: int Value = 1;
// CHECK: }
// CHECK-LABEL: def X_NE {
// CHECK: bit a = 1;
// CHECK: bit b = 0;
// CHECK: }
class Base<int V> {
int Value = V;
}
class Derived<string Truth> :
Base<!if(!eq(Truth, "true"), 1, 0)>;
def TRUE : Derived<"true">;
def FALSE : Derived<"false">;
def X_NE {
bit a = !ne("true", "false");
bit b = !ne("foo", "foo");
}