2
0

DefmInherit.td 580 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // RUN: llvm-tblgen %s | FileCheck %s
  2. // XFAIL: vg_leak
  3. // CHECK: zing = 4
  4. // CHECK: zing = 4
  5. // CHECK: zing = 4
  6. // CHECK: zing = 4
  7. // CHECK-NOT: zing = 4
  8. class C1<int A, string B> {
  9. int bar = A;
  10. string thestr = B;
  11. int zing;
  12. }
  13. def T : C1<4, "blah">;
  14. multiclass t<int a> {
  15. def S1 : C1<a, "foo"> {
  16. int foo = 4;
  17. let bar = 1;
  18. }
  19. def S2 : C1<a, "bar">;
  20. }
  21. multiclass s<int a> {
  22. def S3 : C1<a, "moo"> {
  23. int moo = 3;
  24. let bar = 1;
  25. }
  26. def S4 : C1<a, "baz">;
  27. }
  28. defm FOO : t<42>, s<24>;
  29. def T4 : C1<6, "foo">;
  30. let zing = 4 in
  31. defm BAZ : t<3>, s<4>;