LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.capi.test.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op C API Tests *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10class FunctionOperationLinkTests : public CAPITest {};
11
13TEST_F(FunctionOperationLinkTests, IsA_Function_CallOp) {
14 auto testOperation = createIndexOperation();
15
16 // This will always return false since `createIndex*` returns an MLIR builtin
17 EXPECT_FALSE(llzkOperationIsA_Function_CallOp(testOperation));
18
19 mlirOperationDestroy(testOperation);
20}
21
22TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetArgOperandsCount) {
23 auto testOp = createIndexOperation();
24
27 }
28
29 mlirOperationDestroy(testOp);
30}
31
32TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetArgOperandsAt) {
33 auto testOp = createIndexOperation();
34
37 }
38
39 mlirOperationDestroy(testOp);
40}
41
42TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetArgOperands_Variadic) {
43 auto testOp = createIndexOperation();
44
46 auto dummyValue = mlirOperationGetResult(testOp, 0);
47 MlirValue values[] = {dummyValue};
48 llzkFunction_CallOpSetArgOperands(testOp, 1, values);
49 }
50
51 mlirOperationDestroy(testOp);
52}
53
54TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOperandsCount) {
55 auto testOp = createIndexOperation();
56
59 }
60
61 mlirOperationDestroy(testOp);
62}
63
64TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOperandsAt) {
65 auto testOp = createIndexOperation();
66
69 }
70
71 mlirOperationDestroy(testOp);
72}
73
74TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetMapOperands_VariadicOfVariadic) {
75 auto testOp = createIndexOperation();
76
78 auto dummyValue = mlirOperationGetResult(testOp, 0);
79 MlirValueRange groups[1];
80 groups[0].values = &dummyValue;
81 groups[0].size = 1;
82 llzkFunction_CallOpSetMapOperands(testOp, 1, groups);
83 }
84
85 mlirOperationDestroy(testOp);
86}
87
88TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetCalleeAttr) {
89 auto testOp = createIndexOperation();
90
92 (void)llzkFunction_CallOpGetCallee(testOp);
93 }
94
95 mlirOperationDestroy(testOp);
96}
97
98TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetCalleeAttr) {
99 auto testOp = createIndexOperation();
100
102 llzkFunction_CallOpSetCallee(testOp, createIndexAttribute());
103 }
104
105 mlirOperationDestroy(testOp);
106}
107
108TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTemplateParamsAttr) {
109 auto testOp = createIndexOperation();
110
113 }
114
115 mlirOperationDestroy(testOp);
116}
117
118TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetTemplateParamsAttr) {
119 auto testOp = createIndexOperation();
120
122 llzkFunction_CallOpSetTemplateParams(testOp, createIndexAttribute());
123 }
124
125 mlirOperationDestroy(testOp);
126}
127
128TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetNumDimsPerMapAttr) {
129 auto testOp = createIndexOperation();
130
133 }
134
135 mlirOperationDestroy(testOp);
136}
137
138TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetNumDimsPerMapAttr) {
139 auto testOp = createIndexOperation();
140
142 llzkFunction_CallOpSetNumDimsPerMap(testOp, createIndexAttribute());
143 }
144
145 mlirOperationDestroy(testOp);
146}
147
148TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOpGroupSizesAttr) {
149 auto testOp = createIndexOperation();
150
153 }
154
155 mlirOperationDestroy(testOp);
156}
157
158TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetMapOpGroupSizesAttr) {
159 auto testOp = createIndexOperation();
160
162 llzkFunction_CallOpSetMapOpGroupSizes(testOp, createIndexAttribute());
163 }
164
165 mlirOperationDestroy(testOp);
166}
167
168TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0Count) {
169 auto testOp = createIndexOperation();
170
173 }
174
175 mlirOperationDestroy(testOp);
176}
177
178TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0At) {
179 auto testOp = createIndexOperation();
180
182 (void)llzkFunction_CallOpGetResult0At(testOp, 0);
183 }
184
185 mlirOperationDestroy(testOp);
186}
187
189TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeContainsWitnessGen) {
190 auto testOperation = createIndexOperation();
191
192 if (llzkOperationIsA_Function_CallOp(testOperation)) {
193
195 }
196
197 mlirOperationDestroy(testOperation);
198}
199
201TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructCompute) {
202 auto testOperation = createIndexOperation();
203
204 if (llzkOperationIsA_Function_CallOp(testOperation)) {
205
206 (void)llzkFunction_CallOpCalleeIsStructCompute(testOperation);
207 }
208
209 mlirOperationDestroy(testOperation);
210}
211
213TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfCompute) {
214 auto testOperation = createIndexOperation();
215
216 if (llzkOperationIsA_Function_CallOp(testOperation)) {
217
219 }
220
221 mlirOperationDestroy(testOperation);
222}
223
225TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructConstrain) {
226 auto testOperation = createIndexOperation();
227
228 if (llzkOperationIsA_Function_CallOp(testOperation)) {
229
231 }
232
233 mlirOperationDestroy(testOperation);
234}
235
237TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromConstrain) {
238 auto testOperation = createIndexOperation();
239
240 if (llzkOperationIsA_Function_CallOp(testOperation)) {
241
243 }
244
245 mlirOperationDestroy(testOperation);
246}
247
249TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTypeSignature) {
250 auto testOperation = createIndexOperation();
251
252 if (llzkOperationIsA_Function_CallOp(testOperation)) {
253
254 (void)llzkFunction_CallOpGetTypeSignature(testOperation);
255 }
256
257 mlirOperationDestroy(testOperation);
258}
259
261TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsCompute) {
262 auto testOperation = createIndexOperation();
263
264 if (llzkOperationIsA_Function_CallOp(testOperation)) {
265
266 (void)llzkFunction_CallOpCalleeIsCompute(testOperation);
267 }
268
269 mlirOperationDestroy(testOperation);
270}
271
273TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsConstrain) {
274 auto testOperation = createIndexOperation();
275
276 if (llzkOperationIsA_Function_CallOp(testOperation)) {
277
278 (void)llzkFunction_CallOpCalleeIsConstrain(testOperation);
279 }
280
281 mlirOperationDestroy(testOperation);
282}
283
285TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsProduct) {
286 auto testOperation = createIndexOperation();
287
288 if (llzkOperationIsA_Function_CallOp(testOperation)) {
289
290 (void)llzkFunction_CallOpCalleeIsProduct(testOperation);
291 }
292
293 mlirOperationDestroy(testOperation);
294}
295
297TEST_F(FunctionOperationLinkTests, llzk_CallOp_ResolveCallable) {
298 auto testOperation = createIndexOperation();
299
300 if (llzkOperationIsA_Function_CallOp(testOperation)) {
301
302 (void)llzkFunction_CallOpResolveCallable(testOperation);
303 }
304
305 mlirOperationDestroy(testOperation);
306}
307
309TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructProduct) {
310 auto testOperation = createIndexOperation();
311
312 if (llzkOperationIsA_Function_CallOp(testOperation)) {
313
314 (void)llzkFunction_CallOpCalleeIsStructProduct(testOperation);
315 }
316
317 mlirOperationDestroy(testOperation);
318}
319
321TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromCompute) {
322 auto testOperation = createIndexOperation();
323
324 if (llzkOperationIsA_Function_CallOp(testOperation)) {
325
327 }
328
329 mlirOperationDestroy(testOperation);
330}
331
333TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfWitnessGen) {
334 auto testOperation = createIndexOperation();
335
336 if (llzkOperationIsA_Function_CallOp(testOperation)) {
337
339 }
340
341 mlirOperationDestroy(testOperation);
342}
343
345TEST_F(FunctionOperationLinkTests, IsA_Function_FuncDefOp) {
346 auto testOperation = createIndexOperation();
347
348 // This will always return false since `createIndex*` returns an MLIR builtin
349 EXPECT_FALSE(llzkOperationIsA_Function_FuncDefOp(testOperation));
350
351 mlirOperationDestroy(testOperation);
352}
353
355TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_Build) {
356 // Returns an `arith.constant` op, which will never match the FuncDefOp dialect check.
357 auto testOp = createIndexOperation();
358
359 // This condition is always false, so the function is never actually called.
360 // We only verify it compiles and links correctly.
362 MlirOpBuilder builder = mlirOpBuilderCreate(context);
363 MlirLocation location = mlirLocationUnknownGet(context);
364 auto dummyValue = mlirOperationGetResult(testOp, 0);
365 auto sym_nameAttr = mlirOperationGetName(testOp);
366 auto function_typeAttr = createIndexAttribute();
367 auto arg_attrsAttr = createIndexAttribute();
368 auto res_attrsAttr = createIndexAttribute();
369
370 (void)llzkFunction_FuncDefOpBuild(builder, location, sym_nameAttr, function_typeAttr, arg_attrsAttr, res_attrsAttr);
371 // No need to destroy builder or op since this code never runs.
372 }
373
374 mlirOperationDestroy(testOp);
375}
376
377struct FuncDefOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
378 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_FuncDefOp(op); }
382 static std::unique_ptr<FuncDefOpBuildFuncHelper> get();
383
384protected:
386};
387
390TEST_F(CAPITest, Function_FuncDefOp_build_pass) { FuncDefOpBuildFuncHelper::get()->run(*this); }
391
392TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSymNameAttr) {
393 auto testOp = createIndexOperation();
394
397 }
398
399 mlirOperationDestroy(testOp);
400}
401
402TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetSymNameAttr) {
403 auto testOp = createIndexOperation();
404
406 llzkFunction_FuncDefOpSetSymName(testOp, createIndexAttribute());
407 }
408
409 mlirOperationDestroy(testOp);
410}
411
412TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFunctionTypeAttr) {
413 auto testOp = createIndexOperation();
414
417 }
418
419 mlirOperationDestroy(testOp);
420}
421
422TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetFunctionTypeAttr) {
423 auto testOp = createIndexOperation();
424
426 llzkFunction_FuncDefOpSetFunctionType(testOp, createIndexAttribute());
427 }
428
429 mlirOperationDestroy(testOp);
430}
431
432TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetArgAttrsAttr) {
433 auto testOp = createIndexOperation();
434
437 }
438
439 mlirOperationDestroy(testOp);
440}
441
442TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetArgAttrsAttr) {
443 auto testOp = createIndexOperation();
444
446 llzkFunction_FuncDefOpSetArgAttrs(testOp, createIndexAttribute());
447 }
448
449 mlirOperationDestroy(testOp);
450}
451
452TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetResAttrsAttr) {
453 auto testOp = createIndexOperation();
454
457 }
458
459 mlirOperationDestroy(testOp);
460}
461
462TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetResAttrsAttr) {
463 auto testOp = createIndexOperation();
464
466 llzkFunction_FuncDefOpSetResAttrs(testOp, createIndexAttribute());
467 }
468
469 mlirOperationDestroy(testOp);
470}
471
472TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetBodyRegion) {
473 auto testOp = createIndexOperation();
474
476 (void)llzkFunction_FuncDefOpGetBody(testOp);
477 }
478
479 mlirOperationDestroy(testOp);
480}
481
483TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowNonNativeFieldOpsAttr) {
484 auto testOperation = createIndexOperation();
485
486 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
487 bool newValue = false;
488
489 (void)llzkFunction_FuncDefOpSetAllowNonNativeFieldOpsAttr(testOperation, newValue);
490 }
491
492 mlirOperationDestroy(testOperation);
493}
494
496TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructCompute) {
497 auto testOperation = createIndexOperation();
498
499 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
500
501 (void)llzkFunction_FuncDefOpIsStructCompute(testOperation);
502 }
503
504 mlirOperationDestroy(testOperation);
505}
506
508TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowNonNativeFieldOpsAttr) {
509 auto testOperation = createIndexOperation();
510
511 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
512
514 }
515
516 mlirOperationDestroy(testOperation);
517}
518
520TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsProduct) {
521 auto testOperation = createIndexOperation();
522
523 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
524
525 (void)llzkFunction_FuncDefOpNameIsProduct(testOperation);
526 }
527
528 mlirOperationDestroy(testOperation);
529}
530
532TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasArgPublicAttr) {
533 auto testOperation = createIndexOperation();
534
535 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
536 unsigned index = 0;
537
538 (void)llzkFunction_FuncDefOpHasArgPublicAttr(testOperation, index);
539 }
540
541 mlirOperationDestroy(testOperation);
542}
543
545TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructProduct) {
546 auto testOperation = createIndexOperation();
547
548 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
549
550 (void)llzkFunction_FuncDefOpIsStructProduct(testOperation);
551 }
552
553 mlirOperationDestroy(testOperation);
554}
555
557TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowWitnessAttr) {
558 auto testOperation = createIndexOperation();
559
560 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
561
563 }
564
565 mlirOperationDestroy(testOperation);
566}
567
569TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasResName) {
570 auto testOperation = createIndexOperation();
571
572 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
573 unsigned index = 0;
574
575 (void)llzkFunction_FuncDefOpHasResName(testOperation, index);
576 }
577
578 mlirOperationDestroy(testOperation);
579}
580
582TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructConstrain) {
583 auto testOperation = createIndexOperation();
584
585 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
586
587 (void)llzkFunction_FuncDefOpIsStructConstrain(testOperation);
588 }
589
590 mlirOperationDestroy(testOperation);
591}
592
594TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsCompute) {
595 auto testOperation = createIndexOperation();
596
597 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
598
599 (void)llzkFunction_FuncDefOpNameIsCompute(testOperation);
600 }
601
602 mlirOperationDestroy(testOperation);
603}
604
606TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsDeclaration) {
607 auto testOperation = createIndexOperation();
608
609 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
610
611 (void)llzkFunction_FuncDefOpIsDeclaration(testOperation);
612 }
613
614 mlirOperationDestroy(testOperation);
615}
616
618TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSingleResultTypeOfCompute) {
619 auto testOperation = createIndexOperation();
620
621 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
622
624 }
625
626 mlirOperationDestroy(testOperation);
627}
628
630TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromConstrain) {
631 auto testOperation = createIndexOperation();
632
633 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
634
636 }
637
638 mlirOperationDestroy(testOperation);
639}
640
642TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsConstrain) {
643 auto testOperation = createIndexOperation();
644
645 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
646
647 (void)llzkFunction_FuncDefOpNameIsConstrain(testOperation);
648 }
649
650 mlirOperationDestroy(testOperation);
651}
652
654TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetCallableRegion) {
655 auto testOperation = createIndexOperation();
656
657 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
658
659 (void)llzkFunction_FuncDefOpGetCallableRegion(testOperation);
660 }
661
662 mlirOperationDestroy(testOperation);
663}
664
666TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowConstraintAttr) {
667 auto testOperation = createIndexOperation();
668
669 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
670 bool newValue = false;
671
672 (void)llzkFunction_FuncDefOpSetAllowConstraintAttr(testOperation, newValue);
673 }
674
675 mlirOperationDestroy(testOperation);
676}
677
679TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowConstraintAttr) {
680 auto testOperation = createIndexOperation();
681
682 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
683
685 }
686
687 mlirOperationDestroy(testOperation);
688}
689
691TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsInStruct) {
692 auto testOperation = createIndexOperation();
693
694 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
695
696 (void)llzkFunction_FuncDefOpIsInStruct(testOperation);
697 }
698
699 mlirOperationDestroy(testOperation);
700}
701
703TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowWitnessAttr) {
704 auto testOperation = createIndexOperation();
705
706 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
707 bool newValue = false;
708
709 (void)llzkFunction_FuncDefOpSetAllowWitnessAttr(testOperation, newValue);
710 }
711
712 mlirOperationDestroy(testOperation);
713}
714
716TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromCompute) {
717 auto testOperation = createIndexOperation();
718
719 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
720
722 }
723
724 mlirOperationDestroy(testOperation);
725}
726
728TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasArgName) {
729 auto testOperation = createIndexOperation();
730
731 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
732 unsigned index = 0;
733
734 (void)llzkFunction_FuncDefOpHasArgName(testOperation, index);
735 }
736
737 mlirOperationDestroy(testOperation);
738}
739
741TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFullyQualifiedName) {
742 auto testOperation = createIndexOperation();
743
744 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
745 bool requireParent = false;
746
747 (void)llzkFunction_FuncDefOpGetFullyQualifiedName(testOperation, requireParent);
748 }
749
750 mlirOperationDestroy(testOperation);
751}
752
754TEST_F(FunctionOperationLinkTests, IsA_Function_ReturnOp) {
755 auto testOperation = createIndexOperation();
756
757 // This will always return false since `createIndex*` returns an MLIR builtin
758 EXPECT_FALSE(llzkOperationIsA_Function_ReturnOp(testOperation));
759
760 mlirOperationDestroy(testOperation);
761}
762
764TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_Build) {
765 // Returns an `arith.constant` op, which will never match the ReturnOp dialect check.
766 auto testOp = createIndexOperation();
767
768 // This condition is always false, so the function is never actually called.
769 // We only verify it compiles and links correctly.
771 MlirOpBuilder builder = mlirOpBuilderCreate(context);
772 MlirLocation location = mlirLocationUnknownGet(context);
773 auto dummyValue = mlirOperationGetResult(testOp, 0);
774 MlirValue operandsValues[] = {dummyValue};
775 intptr_t operandsSize = 0;
776
777 (void)llzkFunction_ReturnOpBuild(builder, location, operandsSize, operandsValues);
778 // No need to destroy builder or op since this code never runs.
779 }
780
781 mlirOperationDestroy(testOp);
782}
783
784struct ReturnOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
785 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_ReturnOp(op); }
789 static std::unique_ptr<ReturnOpBuildFuncHelper> get();
790
791protected:
793};
794
797TEST_F(CAPITest, Function_ReturnOp_build_pass) { ReturnOpBuildFuncHelper::get()->run(*this); }
798
799TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsCount) {
800 auto testOp = createIndexOperation();
801
804 }
805
806 mlirOperationDestroy(testOp);
807}
808
809TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsAt) {
810 auto testOp = createIndexOperation();
811
813 (void)llzkFunction_ReturnOpGetOperandsAt(testOp, 0);
814 }
815
816 mlirOperationDestroy(testOp);
817}
818
819TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_SetOperands_Variadic) {
820 auto testOp = createIndexOperation();
821
823 auto dummyValue = mlirOperationGetResult(testOp, 0);
824 MlirValue values[] = {dummyValue};
825 llzkFunction_ReturnOpSetOperands(testOp, 1, values);
826 }
827
828 mlirOperationDestroy(testOp);
829}
TEST_F(ArrayOperationLinkTests, IsA_Array_ArrayLengthOp)
This test ensures llzkOperationIsA_Array_ArrayLengthOp links properly.
MlirOpBuilder mlirOpBuilderCreate(MlirContext ctx)
Creates a new OpBuilder for the given MLIR context.
Definition Builder.cpp:78
bool llzkFunction_FuncDefOpNameIsProduct(MlirOperation inp)
Return true iff the function name is FUNC_NAME_PRODUCT (if needed, a check that this FuncDefOp is loc...
MlirRegion llzkFunction_FuncDefOpGetCallableRegion(MlirOperation inp)
Required by FunctionOpInterface.
void llzkFunction_FuncDefOpSetResAttrs(MlirOperation op, MlirAttribute attr)
Set ResAttrs attribute of llzk::function::FuncDefOp Operation.
MlirOperation llzkFunction_FuncDefOpBuild(MlirOpBuilder builder, MlirLocation location, MlirIdentifier sym_name, MlirAttribute function_type, MlirAttribute arg_attrs, MlirAttribute res_attrs)
Build a llzk::function::FuncDefOp Operation.
MlirValue llzkFunction_ReturnOpGetOperandsAt(MlirOperation op, intptr_t index)
Get Operands operand at index from llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpIsStructProduct(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_PRODUCT.
intptr_t llzkFunction_CallOpGetResult0Count(MlirOperation op)
Get number of Result0 results in llzk::function::CallOp Operation.
MlirAttribute llzkFunction_FuncDefOpGetFullyQualifiedName(MlirOperation inp, bool requireParent)
Return the full name for this function from the root module, including all surrounding symbol table n...
bool llzkFunction_CallOpCalleeIsStructConstrain(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
void llzkFunction_FuncDefOpSetFunctionType(MlirOperation op, MlirAttribute attr)
Set FunctionType attribute of llzk::function::FuncDefOp Operation.
MlirAttribute llzkFunction_CallOpGetMapOpGroupSizes(MlirOperation op)
Get MapOpGroupSizes attribute from llzk::function::CallOp Operation.
bool llzkFunction_CallOpCalleeIsCompute(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_COMPUTE (this does not check if the callee func...
MlirAttribute llzkFunction_CallOpGetTemplateParams(MlirOperation op)
Get TemplateParams attribute from llzk::function::CallOp Operation.
intptr_t llzkFunction_CallOpGetMapOperandsCount(MlirOperation op)
Get number of MapOperands operands in llzk::function::CallOp Operation.
intptr_t llzkFunction_CallOpGetArgOperandsCount(MlirOperation op)
Get number of ArgOperands operands in llzk::function::CallOp Operation.
void llzkFunction_CallOpSetMapOperands(MlirOperation op, intptr_t groupCount, MlirValueRange const *groups)
Set MapOperands operand groups of llzk::function::CallOp Operation.
void llzkFunction_ReturnOpSetOperands(MlirOperation op, intptr_t count, MlirValue const *values)
Set Operands operands of llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpHasAllowWitnessAttr(MlirOperation inp)
Return true iff the function def has the allow_witness attribute.
MlirValue llzkFunction_FuncDefOpGetSelfValueFromConstrain(MlirOperation inp)
Return the "self" value (i.e.
MlirAttribute llzkFunction_FuncDefOpGetResAttrs(MlirOperation op)
Get ResAttrs attribute from llzk::function::FuncDefOp Operation.
MlirType llzkFunction_CallOpGetSingleResultTypeOfCompute(MlirOperation inp)
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
MlirOperation llzkFunction_ReturnOpBuild(MlirOpBuilder builder, MlirLocation location, intptr_t operandsSize, MlirValue const *operands)
Build a llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpIsDeclaration(MlirOperation inp)
Required by SymbolOpInterface.
void llzkFunction_CallOpSetCallee(MlirOperation op, MlirAttribute attr)
Set Callee attribute of llzk::function::CallOp Operation.
bool llzkFunction_CallOpCalleeContainsWitnessGen(MlirOperation inp)
Return true iff the callee function can contain witness generation code (this does not check if the c...
bool llzkFunction_FuncDefOpHasAllowConstraintAttr(MlirOperation inp)
Return true iff the function def has the allow_constraint attribute.
bool llzkFunction_FuncDefOpIsInStruct(MlirOperation inp)
Return true iff the function is within a StructDefOp.
void llzkFunction_FuncDefOpSetArgAttrs(MlirOperation op, MlirAttribute attr)
Set ArgAttrs attribute of llzk::function::FuncDefOp Operation.
void llzkFunction_FuncDefOpSetAllowConstraintAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
void llzkFunction_CallOpSetArgOperands(MlirOperation op, intptr_t count, MlirValue const *values)
Set ArgOperands operands of llzk::function::CallOp Operation.
bool llzkFunction_FuncDefOpHasArgName(MlirOperation inp, unsigned index)
Return true iff the argument at the given index has a function.arg_name attribute.
MlirValue llzkFunction_CallOpGetSelfValueFromConstrain(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_FuncDefOpHasArgPublicAttr(MlirOperation inp, unsigned index)
Return true iff the argument at the given index has pub attribute.
void llzkFunction_FuncDefOpSetAllowNonNativeFieldOpsAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_non_native_field_ops attribute to (resp. from) the function def.
bool llzkFunction_CallOpCalleeIsStructProduct(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_PRODUCT within a StructDefOp.
bool llzkFunction_FuncDefOpIsStructConstrain(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
MlirValue llzkFunction_CallOpGetArgOperandsAt(MlirOperation op, intptr_t index)
Get ArgOperands operand at index from llzk::function::CallOp Operation.
MlirType llzkFunction_FuncDefOpGetSingleResultTypeOfCompute(MlirOperation inp)
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
void llzkFunction_CallOpSetTemplateParams(MlirOperation op, MlirAttribute attr)
Set TemplateParams attribute of llzk::function::CallOp Operation.
void llzkFunction_CallOpSetNumDimsPerMap(MlirOperation op, MlirAttribute attr)
Set NumDimsPerMap attribute of llzk::function::CallOp Operation.
bool llzkOperationIsA_Function_ReturnOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::ReturnOp.
bool llzkOperationIsA_Function_CallOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::CallOp.
MlirAttribute llzkFunction_CallOpGetCallee(MlirOperation op)
Get Callee attribute from llzk::function::CallOp Operation.
MlirType llzkFunction_CallOpGetSingleResultTypeOfWitnessGen(MlirOperation inp)
Assuming the callee contains witness generation code, return the single StructType result.
MlirAttribute llzkFunction_FuncDefOpGetArgAttrs(MlirOperation op)
Get ArgAttrs attribute from llzk::function::FuncDefOp Operation.
bool llzkFunction_FuncDefOpNameIsConstrain(MlirOperation inp)
Return true iff the function name is FUNC_NAME_CONSTRAIN (if needed, a check that this FuncDefOp is l...
MlirValue llzkFunction_FuncDefOpGetSelfValueFromCompute(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_FuncDefOpIsStructCompute(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_COMPUTE.
void llzkFunction_FuncDefOpSetAllowWitnessAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
intptr_t llzkFunction_ReturnOpGetOperandsCount(MlirOperation op)
Get number of Operands operands in llzk::function::ReturnOp Operation.
MlirValue llzkFunction_CallOpGetMapOperandsAt(MlirOperation op, intptr_t index)
Get MapOperands operand at index from llzk::function::CallOp Operation.
bool llzkFunction_FuncDefOpHasAllowNonNativeFieldOpsAttr(MlirOperation inp)
Return true iff the function def has the allow_non_native_field_ops attribute.
bool llzkFunction_CallOpCalleeIsProduct(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_PRODUCT (this does not check if the callee func...
void llzkFunction_FuncDefOpSetSymName(MlirOperation op, MlirAttribute attr)
Set SymName attribute of llzk::function::FuncDefOp Operation.
MlirRegion llzkFunction_FuncDefOpGetBody(MlirOperation op)
Get Body region from llzk::function::FuncDefOp Operation.
MlirType llzkFunction_CallOpGetTypeSignature(MlirOperation inp)
Return the FunctionType inferred from the arg operands and result types of this CallOp.
MlirValue llzkFunction_CallOpGetSelfValueFromCompute(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_CallOpCalleeIsStructCompute(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
MlirAttribute llzkFunction_FuncDefOpGetFunctionType(MlirOperation op)
Get FunctionType attribute from llzk::function::FuncDefOp Operation.
bool llzkFunction_FuncDefOpHasResName(MlirOperation inp, unsigned index)
Return true iff the result at the given index has a function.res_name attribute.
MlirValue llzkFunction_CallOpGetResult0At(MlirOperation op, intptr_t index)
Get Result0 result at index from llzk::function::CallOp Operation.
MlirOperation llzkFunction_CallOpResolveCallable(MlirOperation inp)
Required by CallOpInterface.
bool llzkFunction_FuncDefOpNameIsCompute(MlirOperation inp)
Return true iff the function name is FUNC_NAME_COMPUTE (if needed, a check that this FuncDefOp is loc...
bool llzkOperationIsA_Function_FuncDefOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::FuncDefOp.
void llzkFunction_CallOpSetMapOpGroupSizes(MlirOperation op, MlirAttribute attr)
Set MapOpGroupSizes attribute of llzk::function::CallOp Operation.
MlirAttribute llzkFunction_CallOpGetNumDimsPerMap(MlirOperation op)
Get NumDimsPerMap attribute from llzk::function::CallOp Operation.
MlirAttribute llzkFunction_FuncDefOpGetSymName(MlirOperation op)
Get SymName attribute from llzk::function::FuncDefOp Operation.
bool llzkFunction_CallOpCalleeIsConstrain(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_CONSTRAIN (this does not check if the callee fu...
static std::unique_ptr< FuncDefOpBuildFuncHelper > get()
This method must be implemented to return a subclass of FuncDefOpBuildFuncHelper that at least implem...
virtual bool callIsA(MlirOperation op) override
FuncDefOpBuildFuncHelper()=default
Representation of an mlir::ValueRange
Definition Support.h:47
MlirValue const * values
Pointer to the first value in the range.
Definition Support.h:49
intptr_t size
Number of values in the range.
Definition Support.h:51
ReturnOpBuildFuncHelper()=default
static std::unique_ptr< ReturnOpBuildFuncHelper > get()
This method must be implemented to return a subclass of ReturnOpBuildFuncHelper that at least impleme...
virtual bool callIsA(MlirOperation op) override