llvm-6502/test/TableGen/eq.td
David Greene 6786d5e183 Add an !eq() operator to TableGen. It operates on strings only.
Use !cast<string>() to compare other types of objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92754 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 19:11:42 +00:00

14 lines
242 B
TableGen

// RUN: tblgen %s | FileCheck %s
// CHECK: Value = 0
// CHECK: Value = 1
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">;