1 // RUN: llvm-tblgen %s | FileCheck %s
11 // CHECK: int sum = 8;
17 // CHECK: int val = 9;
21 // CHECK: int val = 7;
25 // CHECK: int val = 11;
29 // CHECK: int val = 12;
53 // CHECK-NOT: def F2_0_0
55 // CHECK-NOT: def F2_1_2
58 // CHECK-NOT: def F2_2_2
64 foreach i = [0, 1] in {
73 multiclass B<int x, list<int> lst> {
83 defm B2 : B<7, [0, 4, 5]>;
86 foreach i = [x, !add(x, 1)] in {
96 foreach _ = !if(b, [0], []<int>) in
103 multiclass E<list<int> lst, int x>
110 defm E1 : E<[3, 5], 8>;
112 multiclass F<list<int> lst> {
114 foreach j = !foldl([]<int>, lst, lhs, x,
115 !if(!lt(x, i), !listconcat(lhs, [x]), lhs)) in
121 defm F2 : F<[0, 1, 2]>;
123 // If multiclass argument comes from loop variable,
124 // and field of argument is placed at foreach statement,
125 // the record field must be resolved correctly.