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