cfa756df2067279b600ffa46d7fffc5d320e5fcd
[oota-llvm.git] / test / TableGen / LetInsideMultiClasses.td
1 // RUN: llvm-tblgen %s | FileCheck %s
2
3 // CHECK: bit IsDouble = 1;
4 // CHECK: bit IsDouble = 1;
5 // CHECK: bit IsDouble = 1;
6 // CHECK-NOT: bit IsDouble = 1;
7
8 class Instruction<bits<4> opc, string Name> {
9   bits<4> opcode = opc;
10   string name = Name;
11   bit IsDouble = 0;
12 }
13
14 multiclass basic_r<bits<4> opc> {
15   let name = "newname" in {
16     def rr : Instruction<opc, "rr">;
17     def rm : Instruction<opc, "rm">;
18   }
19
20   let name = "othername" in
21     def rx : Instruction<opc, "rx">;
22 }
23
24 multiclass basic_ss<bits<4> opc> {
25   let IsDouble = 0 in
26     defm SS : basic_r<opc>;
27
28   let IsDouble = 1 in
29     defm SD : basic_r<opc>;
30 }
31
32 defm ADD : basic_ss<0xf>;
33