2012-02-22 16:09:41 +00:00
|
|
|
// RUN: llvm-tblgen %s | FileCheck %s
|
|
|
|
|
|
|
|
class Register<string name, int idx> {
|
|
|
|
string Name = name;
|
|
|
|
int Index = idx;
|
|
|
|
}
|
|
|
|
|
2012-05-24 22:17:39 +00:00
|
|
|
// CHECK-NOT: !strconcat
|
|
|
|
|
|
|
|
foreach i = 0-3 in
|
|
|
|
def Q#i : Register<"Q"#i, i>;
|
|
|
|
|
|
|
|
// CHECK: def Q0
|
|
|
|
// CHECK: def Q1
|
|
|
|
// CHECK: def Q2
|
|
|
|
// CHECK: def Q3
|
|
|
|
|
2012-02-22 16:09:41 +00:00
|
|
|
foreach i = [0, 1, 2, 3, 4, 5, 6, 7] in
|
|
|
|
def R#i : Register<"R"#i, i>;
|
|
|
|
|
|
|
|
// CHECK: def R0
|
|
|
|
// CHECK: string Name = "R0";
|
|
|
|
// CHECK: int Index = 0;
|
|
|
|
|
|
|
|
// CHECK: def R1
|
|
|
|
// CHECK: string Name = "R1";
|
|
|
|
// CHECK: int Index = 1;
|
|
|
|
|
|
|
|
// CHECK: def R2
|
|
|
|
// CHECK: string Name = "R2";
|
|
|
|
// CHECK: int Index = 2;
|
|
|
|
|
|
|
|
// CHECK: def R3
|
|
|
|
// CHECK: string Name = "R3";
|
|
|
|
// CHECK: int Index = 3;
|
|
|
|
|
|
|
|
// CHECK: def R4
|
|
|
|
// CHECK: string Name = "R4";
|
|
|
|
// CHECK: int Index = 4;
|
|
|
|
|
|
|
|
// CHECK: def R5
|
|
|
|
// CHECK: string Name = "R5";
|
|
|
|
// CHECK: int Index = 5;
|
|
|
|
|
|
|
|
// CHECK: def R6
|
|
|
|
// CHECK: string Name = "R6";
|
|
|
|
// CHECK: int Index = 6;
|
|
|
|
|
|
|
|
// CHECK: def R7
|
|
|
|
// CHECK: string Name = "R7";
|
|
|
|
// CHECK: int Index = 7;
|
2012-05-24 22:17:39 +00:00
|
|
|
|
2014-06-10 12:41:14 +00:00
|
|
|
foreach i = {0-3,9-7} in {
|
2012-05-24 22:17:39 +00:00
|
|
|
def S#i : Register<"Q"#i, i>;
|
2014-06-10 12:41:14 +00:00
|
|
|
def : Register<"T"#i, i>;
|
|
|
|
}
|
2012-05-24 22:17:39 +00:00
|
|
|
|
|
|
|
// CHECK: def S0
|
|
|
|
// CHECK: def S1
|
|
|
|
// CHECK: def S2
|
|
|
|
// CHECK: def S3
|
|
|
|
// CHECK: def S7
|
|
|
|
// CHECK: def S8
|
|
|
|
// CHECK: def S9
|
2014-06-10 12:41:14 +00:00
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T0";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T1";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T2";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T3";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T9";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T8";
|
|
|
|
|
|
|
|
// CHECK: def
|
|
|
|
// CHECK: string Name = "T7";
|
|
|
|
|