Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen %s | grep "zing = 4" | count 28
      2 
      3 class C1<int A, string B> { 
      4   int bar = A;
      5   string thestr = B;
      6   int zing;
      7 }
      8 
      9 def T : C1<4, "blah">;
     10 
     11 multiclass t1<int a1> {
     12   def S1 : C1<a1, "foo"> {
     13     int foo = 4;
     14     let bar = 1;
     15   }
     16   def S2 : C1<a1, "bar">;
     17 }
     18 
     19 multiclass t2<int a2> {
     20   def S3 : C1<a2, "foo"> {
     21     int foo = 4;
     22     let bar = 1;
     23   }
     24   def S4 : C1<a2, "bar">;
     25 }
     26 
     27 multiclass s1<int as1, int bs1> : t1<as1> {
     28   def S5 : C1<bs1, "moo"> {
     29     int moo = 3;
     30     let bar = 1;
     31   }
     32   def S6 : C1<bs1, "baz">;
     33 }
     34 
     35 multiclass s2<int as2> : t1<as2>, t2<as2>;
     36 
     37 multiclass s3<int as3, int bs3> : t1<as3>, t2<as3> {
     38   def S7 : C1<bs3, "moo"> {
     39     int moo = 3;
     40     let bar = 1;
     41   }
     42   def S8 : C1<bs3, "baz">;
     43 }
     44 
     45 let zing = 4 in
     46 defm FOO1 : s1<42, 24>;
     47 
     48 let zing = 4 in
     49 defm FOO2 : s2<99>;
     50 
     51 let zing = 4 in
     52 defm FOO3 : s3<84, 48>;
     53 
     54 def T4 : C1<6, "foo">;
     55 
     56 let zing = 4 in
     57   defm BAZ1 : s1<3, 4>;
     58 
     59 let zing = 4 in
     60   defm BAZ2 : s2<5>;
     61 
     62 let zing = 4 in
     63   defm BAZ3 : s3<6, 7>;
     64 
     65