Skip to content

Commit 66f71ba

Browse files
committed
Rework argument tests
1 parent 2fd7a1c commit 66f71ba

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

llvm/test/TableGen/instances.td

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,26 @@ multiclass MultiClassTest {
9494
defm test6_in_multiclass_def_ : MultiClassTest;
9595

9696
//-----------------------------------------------------------------------------//
97-
// Default argument will be considered as well.
97+
// Default argument/temporary actual parameter will be considered as well.
98+
class D<int n>;
9899

99-
class TestArgument<B b = B<>> {
100-
list<B> instances_B = !instances<B>();
100+
class TestArgument<D d = D<0>> {
101+
list<D> instances_D = !instances<D>();
101102
}
102103

103104
// CHECK-LABEL: def test7_default_arg {
104-
// CHECK-NEXT: list<B> instances_B = [anonymous_0, b0, b1, b2, b3];
105+
// CHECK-NEXT: list<D> instances_D = [anonymous_0];
105106
// CHECK-NEXT: }
106107
def test7_default_arg : TestArgument;
107108

108-
// Temporary actual parameter won't be considered.
109-
110109
// CHECK-LABEL: def test8_anonymous0_arg {
111-
// CHECK-NEXT: list<B> instances_B = [anonymous_0, b0, b1, b2, b3];
110+
// CHECK-NEXT: list<D> instances_D = [anonymous_0, anonymous_1];
112111
// CHECK-NEXT: }
113112
// CHECK-LABEL: def test8_anonymous1_arg {
114-
// CHECK-NEXT: list<B> instances_B = [anonymous_0, b0, b1, b2, b3];
113+
// CHECK-NEXT: list<D> instances_D = [anonymous_0, anonymous_1, anonymous_2];
115114
// CHECK-NEXT: }
116-
def test8_anonymous0_arg : TestArgument<B<>>;
117-
def test8_anonymous1_arg : TestArgument<B<>>;
115+
def test8_anonymous0_arg : TestArgument<D<1>>;
116+
def test8_anonymous1_arg : TestArgument<D<2>>;
118117

119118
//-----------------------------------------------------------------------------//
120119

0 commit comments

Comments
 (0)