Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen %s | FileCheck %s
      2 // XFAIL: vg_leak
      3 
      4 def shifts {
      5     bits<2> b = 0b10;
      6     int i = 2;
      7     int shifted_b = !shl(b, 2);
      8     int shifted_i = !shl(i, 2);
      9 }
     10 // CHECK: def shifts
     11 // CHECK: shifted_b = 8
     12 // CHECK: shifted_i = 8
     13 
     14 class Int<int value> {
     15   int Value = value;
     16 }
     17 
     18 // CHECK: def v0
     19 // CHECK: Value = 0
     20 
     21 // CHECK: def v1
     22 // CHECK: Value = 1
     23 
     24 def v1024   : Int<1024>;
     25 // CHECK: def v1024
     26 // CHECK: Value = 1024
     27 
     28 def v1025   : Int<!add(v1024.Value, 1)>;
     29 // CHECK: def v1025
     30 // CHECK: Value = 1025
     31 
     32 def v2048   : Int<!add(v1024.Value, v1024.Value)>;
     33 // CHECK: def v2048
     34 // CHECK: Value = 2048
     35 
     36 def v0 : Int<!and(v1024.Value, v2048.Value)>;
     37 def v1 : Int<!and(v1025.Value, 1)>;
     38