Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen %s | FileCheck %s
      2 // XFAIL: vg_leak
      3 
      4 // CHECK-LABEL: def FALSE {
      5 //       CHECK:   int Value = 0;
      6 //       CHECK: }
      7 
      8 // CHECK-LABEL: def TRUE {
      9 //       CHECK:   int Value = 1;
     10 //       CHECK: }
     11 
     12 // CHECK-LABEL: def X_NE {
     13 //       CHECK:   bit a = 1;
     14 //       CHECK:   bit b = 0;
     15 //       CHECK: }
     16 
     17 class Base<int V> {
     18   int Value = V;
     19 }
     20 
     21 class Derived<string Truth> :
     22   Base<!if(!eq(Truth, "true"), 1, 0)>;
     23 
     24 def TRUE : Derived<"true">;
     25 def FALSE : Derived<"false">;
     26 
     27 def X_NE {
     28   bit a = !ne("true", "false");
     29   bit b = !ne("foo", "foo");
     30 }
     31