[flang-commits] [flang] [flang] add SYSTEM runtime and lowering intrinsics support (PR #74309)

Yi Wu via flang-commits flang-commits at lists.llvm.org
Fri Jan 5 09:23:11 PST 2024


yi-wu-arm wrote:

> Fortran compilers pass character lengths after the actual arguments, not between them.

Thanks, I was reading at the assembly to see if it is some bugs that have not been noticed. This solved the problem for `call system("echo hi", returnVal)` but when the input is only `call system("echo hi")`, it will still cause a problem that end up with segfault. I think that is because the `length` is now at `returnVal`, and caused a type mismatch, beside I tried but didn't find a way to do function overloading inside `extension.cpp`.
if I change `returnVal` to `std::int64_t` and test it with `call system("echo hi")`, `returnVal` will print 7, and value of `length` would be random numbers. But this would still cause a problem with `call system("echo hi", returnVal)`

```
echo hi��ڏ���
7
6869199260697904452
```
I would prefer to use lowering if the overloading problem cannot be solved.

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


More information about the flang-commits mailing list