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

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Fri May 24 06:56:33 PDT 2024


================
@@ -967,4 +967,35 @@ program test_etime
     print *, tarray(1)
     print *, tarray(2)
 end program test_etime
+```
+
+### Non-Standard Intrinsics: GETCWD
+
+#### Description
+`GETCWD(C, STATUS)` returns current working directory.
+
+This intrinsic is provided in both subroutine and function forms; however, only one form can be used in any given program unit.
+
+*C* and *STATUS* are `INTENT(OUT)` and provide the following:
+
+|            |                                                                                                   |
+|------------|---------------------------------------------------------------------------------------------------|
+| `C`        | Current work directory. The type shall be `CHARACTER` and of default kind.       |
+| `STATUS`   | (Optional) status flag. Returns 0 on success, a system specific and nonzero error code otherwise. The type shall be `INTEGER` and of a kind that greater or equal to 4. |
----------------
kkwli wrote:

Nit: 
- To be consistent: status → Status
- I don't think we need "that" here.

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


More information about the flang-commits mailing list