LetInsideMultiClasses.td 664 B

12345678910111213141516171819202122232425262728293031323334
  1. // RUN: llvm-tblgen %s | FileCheck %s
  2. // XFAIL: vg_leak
  3. // CHECK: bit IsDouble = 1;
  4. // CHECK: bit IsDouble = 1;
  5. // CHECK: bit IsDouble = 1;
  6. // CHECK-NOT: bit IsDouble = 1;
  7. class Instruction<bits<4> opc, string Name> {
  8. bits<4> opcode = opc;
  9. string name = Name;
  10. bit IsDouble = 0;
  11. }
  12. multiclass basic_r<bits<4> opc> {
  13. let name = "newname" in {
  14. def rr : Instruction<opc, "rr">;
  15. def rm : Instruction<opc, "rm">;
  16. }
  17. let name = "othername" in
  18. def rx : Instruction<opc, "rx">;
  19. }
  20. multiclass basic_ss<bits<4> opc> {
  21. let IsDouble = 0 in
  22. defm SS : basic_r<opc>;
  23. let IsDouble = 1 in
  24. defm SD : basic_r<opc>;
  25. }
  26. defm ADD : basic_ss<0xf>;