File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -486,6 +486,23 @@ void testExternalPass(void) {
486486 exit (EXIT_FAILURE );
487487 }
488488
489+ // Run the pass again and confirm that the initializeCallCount is still 1.
490+ MlirLogicalResult second_success = mlirPassManagerRunOnOp (pm , module );
491+ if (mlirLogicalResultIsFailure (second_success )) {
492+ fprintf (stderr , "Unexpected failure running external pass.\n" );
493+ exit (EXIT_FAILURE );
494+ }
495+
496+ if (userData .initializeCallCount != 1 ) {
497+ fprintf (stderr , "Expected initializeCallCount to be 1\n" );
498+ exit (EXIT_FAILURE );
499+ }
500+
501+ if (userData .runCallCount != 2 ) {
502+ fprintf (stderr , "Expected runCallCount to be 2\n" );
503+ exit (EXIT_FAILURE );
504+ }
505+
489506 mlirPassManagerDestroy (pm );
490507
491508 if (userData .destructCallCount != userData .constructCallCount ) {
You can’t perform that action at this time.
0 commit comments