diff options
author | Yi Wu <43659785+yi-wu-arm@users.noreply.github.com> | 2024-01-29 16:34:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 16:34:04 +0000 |
commit | 7c8ef76500b40c3b7cb65b839b61345b713aeb5a (patch) | |
tree | d0b9146278b3a84a6a5a363389f049b8930c037e /flang/lib/Evaluate/intrinsics.cpp | |
parent | 169553688ca40d9a495f19e8ba2af1137e13cff8 (diff) | |
download | llvm-7c8ef76500b40c3b7cb65b839b61345b713aeb5a.zip llvm-7c8ef76500b40c3b7cb65b839b61345b713aeb5a.tar.gz llvm-7c8ef76500b40c3b7cb65b839b61345b713aeb5a.tar.bz2 |
[flang] add SYSTEM runtime and lowering intrinsics support (#74309)
Calls std::system() function and pass the command,
cmd on Windows or shell on Linux.
Command parameter is required, exitstatus is optional.
call system(command)
call system(command, exitstatus)
It calls `execute_command_line` runtime function with `wait` set to true.
---------
Co-authored-by: Yi Wu <yiwu02@wdev-yiwu02.arm.com>
Diffstat (limited to 'flang/lib/Evaluate/intrinsics.cpp')
-rw-r--r-- | flang/lib/Evaluate/intrinsics.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/flang/lib/Evaluate/intrinsics.cpp b/flang/lib/Evaluate/intrinsics.cpp index 10e66d7..d822413 100644 --- a/flang/lib/Evaluate/intrinsics.cpp +++ b/flang/lib/Evaluate/intrinsics.cpp @@ -1396,6 +1396,11 @@ static const IntrinsicInterface intrinsicSubroutine[]{ {"get", DefaultInt, Rank::vector, Optionality::optional, common::Intent::Out}}, {}, Rank::elemental, IntrinsicClass::impureSubroutine}, + {"system", + {{"command", DefaultChar, Rank::scalar}, + {"exitstat", DefaultInt, Rank::scalar, Optionality::optional, + common::Intent::Out}}, + {}, Rank::elemental, IntrinsicClass::impureSubroutine}, {"system_clock", {{"count", AnyInt, Rank::scalar, Optionality::optional, common::Intent::Out}, |