[flang][driver] Copy test file into a temp dir when testing (nfc)
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Fri, 15 Jan 2021 16:45:01 +0000 (16:45 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Fri, 15 Jan 2021 17:12:42 +0000 (17:12 +0000)
commitb6e06a740c26b2b9d91455ad49a5009335089242
treeff92643cd739ee1514b0d01b467035e2a8ba911c
parent4c5066b0789d9c38d6362a684346b68261911d29
[flang][driver] Copy test file into a temp dir when testing (nfc)

The following driver invocation will generate an output file
in the same directory as the input file:

```
flang-new -fc1 -test-io test-input.f90
```

This is the desired behaviour. However, when testing we need to make
sure that we don't pollute the source directory. To this end, copy the
input file into a temporary directory before testing.

This is similar to https://reviews.llvm.org/D94243.
flang/test/Frontend/input-output-file.f90