File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,23 @@ inline RT_API_ATTRS RESULT ApplyType(
206
206
default :
207
207
terminator.Crash (" not yet implemented: INTEGER(KIND=%d)" , kind);
208
208
}
209
+ case TypeCategory::Unsigned:
210
+ switch (kind) {
211
+ case 1 :
212
+ return FUNC<TypeCategory::Unsigned, 1 >{}(std::forward<A>(x)...);
213
+ case 2 :
214
+ return FUNC<TypeCategory::Unsigned, 2 >{}(std::forward<A>(x)...);
215
+ case 4 :
216
+ return FUNC<TypeCategory::Unsigned, 4 >{}(std::forward<A>(x)...);
217
+ case 8 :
218
+ return FUNC<TypeCategory::Unsigned, 8 >{}(std::forward<A>(x)...);
219
+ #if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T
220
+ case 16 :
221
+ return FUNC<TypeCategory::Unsigned, 16 >{}(std::forward<A>(x)...);
222
+ #endif
223
+ default :
224
+ terminator.Crash (" not yet implemented: UNSIGNED(KIND=%d)" , kind);
225
+ }
209
226
case TypeCategory::Real:
210
227
switch (kind) {
211
228
#if 0 // TODO: REAL(2 & 3)
Original file line number Diff line number Diff line change @@ -67,3 +67,14 @@ TEST(IsAssumedSize, Basic) {
67
67
std::vector<int >{}, std::vector<std::int32_t >{0 })};
68
68
EXPECT_FALSE (RTNAME (IsAssumedSize)(*scalar));
69
69
}
70
+
71
+ TEST (DescriptorBytesFor, Basic) {
72
+ for (size_t i = 0 ; i < Fortran::common::TypeCategory_enumSize; ++i) {
73
+ auto tc{static_cast <TypeCategory>(i)};
74
+ if (tc == TypeCategory::Derived)
75
+ continue ;
76
+
77
+ auto b{Descriptor::BytesFor (tc, 4 )};
78
+ EXPECT_GT (b, 0U );
79
+ }
80
+ }
You can’t perform that action at this time.
0 commit comments