File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -311,22 +311,6 @@ static FunctionTest FieldSensitiveMultiDefUseLiveRangeTest(
311
311
boundary.print (llvm::errs ());
312
312
});
313
313
314
- // Arguments:
315
- // - SILValue: value to canonicalize
316
- // Dumps:
317
- // - function after value canonicalization
318
- static FunctionTest CanonicalizeBorrowScopeTest (
319
- " canonicalize-borrow-scope" ,
320
- [](auto &function, auto &arguments, auto &test) {
321
- auto value = arguments.takeValue ();
322
- auto borrowedValue = BorrowedValue (value);
323
- assert (borrowedValue && " specified value isn't a BorrowedValue!?" );
324
- InstructionDeleter deleter;
325
- CanonicalizeBorrowScope canonicalizer (value->getFunction (), deleter);
326
- canonicalizer.canonicalizeBorrowScope (borrowedValue);
327
- function.dump ();
328
- });
329
-
330
314
// Arguments:
331
315
// - instruction
332
316
// Dumps:
Original file line number Diff line number Diff line change 26
26
#include " swift/Basic/Defer.h"
27
27
#include " swift/SIL/InstructionUtils.h"
28
28
#include " swift/SIL/OwnershipUtils.h"
29
+ #include " swift/SIL/Test.h"
29
30
#include " swift/SILOptimizer/Utils/CFGOptUtils.h"
30
31
#include " swift/SILOptimizer/Utils/CanonicalizeOSSALifetime.h"
31
32
#include " swift/SILOptimizer/Utils/DebugOptUtils.h"
@@ -851,3 +852,21 @@ canonicalizeBorrowScope(BorrowedValue borrowedValue) {
851
852
852
853
return true ;
853
854
}
855
+
856
+ namespace swift ::test {
857
+ // Arguments:
858
+ // - SILValue: value to canonicalize
859
+ // Dumps:
860
+ // - function after value canonicalization
861
+ static FunctionTest CanonicalizeBorrowScopeTest (
862
+ " canonicalize-borrow-scope" ,
863
+ [](auto &function, auto &arguments, auto &test) {
864
+ auto value = arguments.takeValue ();
865
+ auto borrowedValue = BorrowedValue (value);
866
+ assert (borrowedValue && " specified value isn't a BorrowedValue!?" );
867
+ InstructionDeleter deleter;
868
+ CanonicalizeBorrowScope canonicalizer (value->getFunction (), deleter);
869
+ canonicalizer.canonicalizeBorrowScope (borrowedValue);
870
+ function.dump ();
871
+ });
872
+ } // end namespace swift::test
You can’t perform that action at this time.
0 commit comments