2011-10-06 15:39:59 +02:00
|
|
|
// RUN: llvm-tblgen %s | FileCheck %s
|
2013-11-10 15:26:08 +01:00
|
|
|
// XFAIL: vg_leak
|
2018-03-14 12:00:57 +01:00
|
|
|
|
|
|
|
// 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: }
|
2010-01-05 20:11:42 +01:00
|
|
|
|
|
|
|
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">;
|
2018-03-14 12:00:57 +01:00
|
|
|
|
|
|
|
def X_NE {
|
|
|
|
bit a = !ne("true", "false");
|
|
|
|
bit b = !ne("foo", "foo");
|
|
|
|
}
|