Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen %s | FileCheck %s
      2 
      3 class Type<string name, int length, int width> {
      4   string Name = name;
      5   int Length = length;
      6   int Width = width;
      7 }
      8 
      9 multiclass OT1<string ss, int l, int w> {
     10   def _#NAME# : Type<ss, l, w>;
     11 }
     12 multiclass OT2<string ss, int w> {
     13   defm  v1#NAME# : OT1<!strconcat( "v1", ss),  1, w>;
     14   defm  v2#NAME# : OT1<!strconcat( "v2", ss),  2, w>;
     15   defm  v3#NAME# : OT1<!strconcat( "v3", ss),  3, w>;
     16   defm  v4#NAME# : OT1<!strconcat( "v4", ss),  4, w>;
     17   defm  v8#NAME# : OT1<!strconcat( "v8", ss),  8, w>;
     18   defm v16#NAME# : OT1<!strconcat("v16", ss), 16, w>;
     19 }
     20 
     21 defm i8 : OT2<"i8", 8>;
     22 
     23 // CHECK: _v16i8
     24 // CHECK: Length = 16
     25 // CHECK: Width = 8
     26 
     27 // CHECK: _v1i8
     28 // CHECK: Length = 1
     29 // CHECK: Width = 8
     30 
     31 // CHECK: _v2i8
     32 // CHECK: Length = 2
     33 // CHECK: Width = 8
     34 
     35 // CHECK: _v3i8
     36 // CHECK: Length = 3
     37 // CHECK: Width = 8
     38 
     39 // CHECK: _v4i8
     40 // CHECK: Length = 4
     41 // CHECK: Width = 8
     42 
     43 // CHECK: _v8i8
     44 // CHECK: Length = 8
     45 // CHECK: Width = 8
     46