<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85420>85420</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
HLFIR error in flang-new
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
eschnett
</td>
</tr>
</table>
<pre>
I am building on macOS with a MacPorts-provided flang-new:
```
$ flang-new-mp-18 --version
flang-new version 18.1.1
Target: x86_64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-18/bin
```
I see this error:
```
$ flang-new-mp-18 -c hello-world-fortran08.f90
error: loc("/tmp/f/hello-world-fortran08.f90":4:3): /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-18/flang-18/work/llvm-project-18.1.1.src/flang/lib/Lower/ConvertExprToHLFIR.cpp:309: not yet implemented: lowering symbol to HLFIR
LLVM ERROR: aborting
```
The same code works with LLVM version 17.
The source code is spread over several source files (several modules and one main program). I tried to reduce the number of modules but this made the error go away. I am thus submitting several files. I did reduce the test case to 71 lines overall. I am also including a script `build.sh` that builds the modules in a correct order.
(The instructions for reporting an LLVM bug don't quite work because they assume I'm using the C/C++ compiler clang, and flang-new doesn't accept the same command line options.)
[files.tar.gz](https://github.com/llvm/llvm-project/files/14617895/files.tar.gz)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVdtu4zYQ_Rr6ZWBBoiVZfvBDslmhAbLYIg36alDk2GLLizqk7KRfX5Cyk227LbBAgCjDM5dz5hIRgj45xD1r7lnzsBJzHD3tMcjRYYyrwau3_SMIC8OsjdLuBN6BFfLrL3DRcQQBX4T82VMM64n8WStUcDTCndYOL2xzx8oHVt6xtrz-LH_y-gO0ttO66mC9PiMF7d0CeX-GqxmqrqiKanl9EXTCyDZ38Nq1h7Zei2kyuFaCLtrxT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