Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen %s | FileCheck %s
      2 // XFAIL: vg_leak
      3 
      4 // CHECK: Classes
      5 // CHECK: Sr
      6 // CHECK: Jr
      7 // CHECK: "NAME"
      8 
      9 // CHECK: Defs
     10 
     11 // CHECK: def DX {
     12 // CHECK:   list<string> x = ["0", "1", "2"];
     13 // CHECK: }
     14 
     15 // CHECK: def DY {
     16 // CHECK:   list<int> y = [5, 7];
     17 // CHECK: }
     18 
     19 // CHECK: Jr
     20 // CHECK: Sr
     21 
     22 class A<list<string> names> {
     23   list<string> Names = names;
     24 }
     25 
     26 class B<list<string> names> : A<!foreach(name, names, !strconcat(name, ", Sr."))>;
     27 
     28 class C<list<string> names> : A<!foreach(name, names, !strconcat(name, ", Jr."))>;
     29 
     30 class D<list<string> names> : A<!foreach(name, names, !subst("NAME", "John Smith", name))>;
     31 
     32 class Names {
     33   list<string> values = ["Ken Griffey", "Seymour Cray"];
     34 }
     35 
     36 def People : Names;
     37 
     38 def Seniors : B<People.values>;
     39 def Juniors : C<People.values>;
     40 def Smiths : D<["NAME", "Jane Smith"]>;
     41 def Unprocessed : D<People.values>;
     42 
     43 class X<list<int> a> {
     44     list<string> x = !foreach(num, a, !cast<string>(num));
     45 }
     46 
     47 def DX : X<[0, 1, 2]>;
     48 
     49 class Y<list<int> a> {
     50   list<int> y = !foreach(num, a, !add(!add(4, num), !add(1, num)));
     51 }
     52 
     53 def DY: Y<[0, 1]>;
     54