File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 22
22
#include " swift/SIL/AbstractionPattern.h"
23
23
#include " swift/SIL/SILFunctionConventions.h"
24
24
#include " swift/SIL/SILModule.h"
25
+ #include " swift/SIL/Test.h"
25
26
#include " swift/SIL/TypeLowering.h"
26
27
#include < tuple>
27
28
@@ -1287,3 +1288,21 @@ SILType SILType::removingMoveOnlyWrapperToBoxedType(const SILFunction *fn) {
1287
1288
bool SILType::isSendable (SILFunction *fn) const {
1288
1289
return getASTType ()->isSendableType ();
1289
1290
}
1291
+
1292
+ namespace swift ::test {
1293
+ // Arguments:
1294
+ // - SILValue: value
1295
+ // Dumps:
1296
+ // - message
1297
+ static FunctionTest IsSILTrivial (" is-sil-trivial" , [](auto &function,
1298
+ auto &arguments,
1299
+ auto &test) {
1300
+ SILValue value = arguments.takeValue ();
1301
+ llvm::outs () << value;
1302
+ if (value->getType ().isTrivial (value->getFunction ())) {
1303
+ llvm::outs () << " is trivial\n " ;
1304
+ } else {
1305
+ llvm::outs () << " is not trivial\n " ;
1306
+ }
1307
+ });
1308
+ } // end namespace swift::test
Original file line number Diff line number Diff line change 10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
- #include " swift/SIL/SILVisitor.h"
14
13
#include " swift/SIL/SILBuiltinVisitor.h"
15
14
#include " swift/SIL/SILModule.h"
15
+ #include " swift/SIL/SILVisitor.h"
16
+ #include " swift/SIL/Test.h"
16
17
17
18
using namespace swift ;
18
19
@@ -690,3 +691,17 @@ ValueOwnershipKind ValueBase::getOwnershipKind() const {
690
691
assert (result && " Returned ownership kind invalid on values" );
691
692
return result;
692
693
}
694
+
695
+ namespace swift ::test {
696
+ // Arguments:
697
+ // - SILValue: value
698
+ // Dumps:
699
+ // - message
700
+ static FunctionTest GetOwnershipKind (" get-ownership-kind" , [](auto &function,
701
+ auto &arguments,
702
+ auto &test) {
703
+ SILValue value = arguments.takeValue ();
704
+ llvm::outs () << value;
705
+ llvm::outs () << " OwnershipKind: " << value->getOwnershipKind () << " \n " ;
706
+ });
707
+ } // end namespace swift::test
You can’t perform that action at this time.
0 commit comments