[flang] COMMAND_ARGUMENT_COUNT runtime implementation
authorDiana Picus <diana.picus@linaro.org>
Wed, 25 Aug 2021 07:51:48 +0000 (07:51 +0000)
committerDiana Picus <diana.picus@linaro.org>
Fri, 3 Sep 2021 07:29:39 +0000 (07:29 +0000)
commit0c375296cc771af7279427e942a207e3cfe7695f
treecbdfe07355b9e659e3d08826174213767f414e33
parent7bb42dc6b114f57200abfebaaa01160914be6bba
[flang] COMMAND_ARGUMENT_COUNT runtime implementation

Grab whatever ProgramStart has stored in executionEnvironment.argc and
subtract 1 (based on the assumption that ProgramStart is called with
a C-style argc that counts the command name as an argument).

Spoiler alert: The tests will evolve into fixtures when we implement
GET_COMMAND_ARGUMENT etc.

Differential Revision: https://reviews.llvm.org/D109048
flang/runtime/CMakeLists.txt
flang/runtime/command.cpp [new file with mode: 0644]
flang/unittests/Runtime/CMakeLists.txt
flang/unittests/Runtime/CommandTest.cpp [new file with mode: 0644]