1// RUN: llvm-tblgen %s | FileCheck %s 2// XFAIL: vg_leak 3 4class Register<string name, int idx> { 5 string Name = name; 6 int Index = idx; 7} 8 9// CHECK-NOT: !strconcat 10 11foreach i = 0-3 in 12 def Q#i : Register<"Q"#i, i>; 13 14// CHECK: def Q0 15// CHECK: def Q1 16// CHECK: def Q2 17// CHECK: def Q3 18 19foreach i = [0, 1, 2, 3, 4, 5, 6, 7] in 20 def R#i : Register<"R"#i, i>; 21 22// CHECK: def R0 23// CHECK: string Name = "R0"; 24// CHECK: int Index = 0; 25 26// CHECK: def R1 27// CHECK: string Name = "R1"; 28// CHECK: int Index = 1; 29 30// CHECK: def R2 31// CHECK: string Name = "R2"; 32// CHECK: int Index = 2; 33 34// CHECK: def R3 35// CHECK: string Name = "R3"; 36// CHECK: int Index = 3; 37 38// CHECK: def R4 39// CHECK: string Name = "R4"; 40// CHECK: int Index = 4; 41 42// CHECK: def R5 43// CHECK: string Name = "R5"; 44// CHECK: int Index = 5; 45 46// CHECK: def R6 47// CHECK: string Name = "R6"; 48// CHECK: int Index = 6; 49 50// CHECK: def R7 51// CHECK: string Name = "R7"; 52// CHECK: int Index = 7; 53 54foreach i = {0-3,9-7} in { 55 def S#i : Register<"Q"#i, i>; 56 def : Register<"T"#i, i>; 57} 58 59// CHECK: def S0 60// CHECK: def S1 61// CHECK: def S2 62// CHECK: def S3 63// CHECK: def S7 64// CHECK: def S8 65// CHECK: def S9 66 67// CHECK: def 68// CHECK: string Name = "T0"; 69 70// CHECK: def 71// CHECK: string Name = "T1"; 72 73// CHECK: def 74// CHECK: string Name = "T2"; 75 76// CHECK: def 77// CHECK: string Name = "T3"; 78 79// CHECK: def 80// CHECK: string Name = "T9"; 81 82// CHECK: def 83// CHECK: string Name = "T8"; 84 85// CHECK: def 86// CHECK: string Name = "T7"; 87 88