Mark that the return is using EAX so that we don't use it for some other
[llvm.git] / test / TableGen / 2010-03-24-PrematureDefaults.td
blob2ff2d42d27304cc019c88365d36b0525fc434026
1 // RUN: tblgen %s | FileCheck %s
2 // XFAIL: vg_leak
4 class A<int k, bits<2> x = 1> {
5   int K = k;
6   bits<2> Bits = x;
9 // CHECK: def a1
10 // CHECK: Bits = { 0, 1 }
11 def a1 : A<12>;
13 // CHECK: def a2
14 // CHECK: Bits = { 1, 0 }
15 def a2 : A<13, 2>;
17 // Here was the bug: X.Bits would get resolved to the default a1.Bits while
18 // resolving the first template argument. When the second template argument
19 // was processed, X would be set correctly, but Bits retained the default
20 // value.
21 class B<int k, A x = a1> {
22   A X = x;
23   bits<2> Bits = X.Bits;
26 // CHECK: def b1
27 // CHECK: Bits = { 0, 1 }
28 def b1 : B<27>;
30 // CHECK: def b2
31 // CHECK: Bits = { 1, 0 }
32 def b2 : B<28, a2>;
34 class C<A x = a1> {
35   bits<2> Bits = x.Bits;
38 // CHECK: def c1
39 // CHECK: Bits = { 0, 1 }
40 def c1 : C;
42 // CHECK: def c2
43 // CHECK: Bits = { 1, 0 }
44 def c2 : C<a2>;