[flang] Fix test_folding.sh to work on MacOS
authorTim Keith <tkeith@nvidia.com>
Mon, 3 Jun 2019 20:21:35 +0000 (13:21 -0700)
committerTim Keith <tkeith@nvidia.com>
Mon, 3 Jun 2019 20:21:35 +0000 (13:21 -0700)
commit473658dd866c1af4e9cc3c6475bc88412d98c884
tree1ac5019e70897548e604de9b14b7e82479780c1d
parent017ed5292ba7ae2a5ac92cfb1bb5f101921ca47a
[flang] Fix test_folding.sh to work on MacOS

There were a couple of small incompatibilities:
- There is no `ldd` on MacOS; instead use `otools -L`.
  This has not been tested when libpgmath is linked in to f18.
- `wc` outputs spaces where on Linux it outputs tabs; change how
  the number of lines is extracted to work on both.

Also, fix a bug: change `passed_warnings` to `$passed_warnings`.

Original-commit: flang-compiler/f18@5bede9e188e0f5e6b8ac922725d9d19a6aae96e6
Reviewed-on: https://github.com/flang-compiler/f18/pull/475
flang/test/evaluate/test_folding.sh