[flang-commits] [flang] [flang] Add GETCWD runtime and lowering intrinsics implementation (PR #92746)

jiajie zhang via flang-commits flang-commits at lists.llvm.org
Tue May 21 20:33:17 PDT 2024


================
@@ -239,4 +241,22 @@ std::int32_t RTNAME(GetEnvVariable)(const Descriptor &name,
   return StatOk;
 }
 
+std::int32_t RTNAME(GetCwd)(
+    const Descriptor &cwd, const char *sourceFile, int line) {
+  Terminator terminator{sourceFile, line};
+
+  RUNTIME_CHECK(terminator, IsValidCharDescriptor(&cwd));
+
+  char *buf = getcwd(nullptr, 0);
----------------
JumpMasterJJ wrote:

It is indeed unspecified in some standards. Thank you for pointing out!

https://github.com/llvm/llvm-project/pull/92746


More information about the flang-commits mailing list