1 // RUN: llvm-tblgen --no-warn-on-unused-template-args %s | FileCheck %s
4 class A<int k, bits<2> x = 1> {
10 // CHECK: Bits = { 0, 1 }
14 // CHECK: Bits = { 1, 0 }
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
21 class B<int k, A x = a1> {
23 bits<2> Bits = X.Bits;
27 // CHECK: Bits = { 0, 1 }
31 // CHECK: Bits = { 1, 0 }
35 bits<2> Bits = x.Bits;
39 // CHECK: Bits = { 0, 1 }
43 // CHECK: Bits = { 1, 0 }