[flang] [llvm] [flang/flang-rt] Implement show_descriptor intrinsic, a non-standard extension. (PR #170389)
Slava Zakharin via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 15:27:16 PST 2025
================
@@ -158,3 +159,125 @@ TEST(Descriptor, FixedStride) {
EXPECT_TRUE(descriptor.IsContiguous());
EXPECT_EQ(descriptor.FixedStride().value_or(-666), 0);
}
+
+// The test below uses file operations that have nuances across multiple
+// platforms. Hence limit coverage by linux only unless wider coverage
+// should be required.
+#if defined(__linux__) && !defined(__ANDROID__)
+TEST(Descriptor, Dump) {
+ StaticDescriptor<4> staticDesc[2];
+ Descriptor &descriptor{staticDesc[0].descriptor()};
+ using Type = std::int32_t;
+ Type data[8][8][8];
+ constexpr int four{static_cast<int>(sizeof data[0][0][0])};
+ TypeCode integer{TypeCategory::Integer, four};
+ // Scalar
+ descriptor.Establish(integer, four, data, 0);
+ FILE *tmpf = nullptr;
----------------
vzakhari wrote:
```suggestion
FILE *tmpf{nullptr};
```
https://github.com/llvm/llvm-project/pull/170389
More information about the llvm-commits
mailing list