Bill Wendling | 7c20aab | 2013-08-22 20:46:05 +0000 | [diff] [blame] | 1 | // RUN: llvm-tblgen %s | FileCheck %s |
NAKAMURA Takumi | 5c0be2f | 2013-11-10 14:26:08 +0000 | [diff] [blame] | 2 | // XFAIL: vg_leak |
Bill Wendling | 7c20aab | 2013-08-22 20:46:05 +0000 | [diff] [blame] | 3 | |
| 4 | // CHECK: bit IsDouble = 1; |
| 5 | // CHECK: bit IsDouble = 1; |
| 6 | // CHECK: bit IsDouble = 1; |
| 7 | // CHECK-NOT: bit IsDouble = 1; |
Bruno Cardoso Lopes | 5f2adcc | 2010-06-10 02:42:59 +0000 | [diff] [blame] | 8 | |
| 9 | class Instruction<bits<4> opc, string Name> { |
| 10 | bits<4> opcode = opc; |
| 11 | string name = Name; |
| 12 | bit IsDouble = 0; |
| 13 | } |
| 14 | |
| 15 | multiclass basic_r<bits<4> opc> { |
| 16 | let name = "newname" in { |
| 17 | def rr : Instruction<opc, "rr">; |
| 18 | def rm : Instruction<opc, "rm">; |
| 19 | } |
| 20 | |
| 21 | let name = "othername" in |
| 22 | def rx : Instruction<opc, "rx">; |
| 23 | } |
| 24 | |
| 25 | multiclass basic_ss<bits<4> opc> { |
| 26 | let IsDouble = 0 in |
| 27 | defm SS : basic_r<opc>; |
| 28 | |
| 29 | let IsDouble = 1 in |
| 30 | defm SD : basic_r<opc>; |
| 31 | } |
| 32 | |
| 33 | defm ADD : basic_ss<0xf>; |
| 34 | |