|
69 | 69 | #include "swift/AST/Type.h"
|
70 | 70 | #include "swift/Basic/TaggedUnion.h"
|
71 | 71 | #include "swift/SIL/MemAccessUtils.h"
|
| 72 | +#include "swift/SIL/OSSALifetimeCompletion.h" |
72 | 73 | #include "swift/SIL/OwnershipLiveness.h"
|
73 | 74 | #include "swift/SIL/PrunedLiveness.h"
|
74 | 75 | #include "swift/SIL/SILArgumentArrayRef.h"
|
@@ -602,6 +603,21 @@ struct ExtendedLinearLivenessTest : UnitTest {
|
602 | 603 | }
|
603 | 604 | };
|
604 | 605 |
|
| 606 | +// Arguments: |
| 607 | +// - SILValue: value |
| 608 | +// Dumps: |
| 609 | +// - function |
| 610 | +struct OSSALifetimeCompletionTest : UnitTest { |
| 611 | + OSSALifetimeCompletionTest(UnitTestRunner *pass) : UnitTest(pass) {} |
| 612 | + void invoke(Arguments &arguments) override { |
| 613 | + SILValue value = arguments.takeValue(); |
| 614 | + llvm::dbgs() << "OSSA lifetime completion: " << value; |
| 615 | + OSSALifetimeCompletion completion(getFunction(), /*domInfo*/nullptr); |
| 616 | + completion.completeOSSALifetime(value); |
| 617 | + getFunction()->dump(); |
| 618 | + } |
| 619 | +}; |
| 620 | + |
605 | 621 | //===----------------------------------------------------------------------===//
|
606 | 622 | // MARK: SimplifyCFG Unit Tests
|
607 | 623 | //===----------------------------------------------------------------------===//
|
@@ -778,6 +794,7 @@ void UnitTestRunner::withTest(StringRef name, Doit doit) {
|
778 | 794 | ADD_UNIT_TEST_SUBCLASS("is-lexical", IsLexicalTest)
|
779 | 795 | ADD_UNIT_TEST_SUBCLASS("linear-liveness", LinearLivenessTest)
|
780 | 796 | ADD_UNIT_TEST_SUBCLASS("multidef-liveness", MultiDefLivenessTest)
|
| 797 | + ADD_UNIT_TEST_SUBCLASS("ossa-lifetime-completion", OSSALifetimeCompletionTest) |
781 | 798 | ADD_UNIT_TEST_SUBCLASS("pruned-liveness-boundary-with-list-of-last-users-insertion-points", PrunedLivenessBoundaryWithListOfLastUsersInsertionPointsTest)
|
782 | 799 | ADD_UNIT_TEST_SUBCLASS("shrink-borrow-scope", ShrinkBorrowScopeTest)
|
783 | 800 |
|
|
0 commit comments