<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/95689>95689</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] fatal internal error: CHECK(tokens.SizeInTokens() == 1) failed at /root/llvm-project/flang/lib/Parser/prescan.cpp(190)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Reproducible on Godbolt:
https://godbolt.org/z/bexnKds9n
Reproducer:
```f90
integer :: i
i = 0
pr&
&i&
&nt *, i
end
```
Stack dump:
```console
fatal internal error: CHECK(tokens.SizeInTokens() == 1) failed at /root/llvm-project/flang/lib/Parser/prescan.cpp(190)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -S -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -mllvm -x86-asm-syntax=intel -resource-dir /opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/.. -mframe-pointer=all -o /app/output.s -x f95-cpp-input /app/example.f90
#0 0x00000000038654d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38654d8)
#1 0x0000000003862e4c SignalHandler(int) Signals.cpp:0:0
#2 0x00007a1a6b442520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x00007a1a6b4969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#4 0x00007a1a6b442476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#5 0x00007a1a6b4287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#6 0x0000000004e72a29 (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4e72a29)
#7 0x0000000004ac4c72 Fortran::parser::Prescanner::Statement() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4ac4c72)
#8 0x0000000004ac4d28 Fortran::parser::Prescanner::Prescan(Fortran::common::Interval<Fortran::parser::Provenance>) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4ac4d28)
#9 0x0000000004aac555 Fortran::parser::Parsing::Prescan(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Fortran::parser::Options) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x4aac555)
#10 0x00000000038b7cb3 Fortran::frontend::FrontendAction::runPrescan() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38b7cb3)
#11 0x0000000003be4bd0 Fortran::frontend::CodeGenAction::beginSourceFileAction() (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x3be4bd0)
#12 0x00000000038b6285 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38b6285)
#13 0x00000000038a5be7 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38a5be7)
#14 0x00000000038bc2cd Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x38bc2cd)
#15 0x0000000001fee0a8 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1fee0a8)
#16 0x0000000001ed6fe4 main (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1ed6fe4)
#17 0x00007a1a6b429d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#18 0x00007a1a6b429e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#19 0x0000000001fed00e _start (/opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin/flang-new+0x1fed00e)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git 85a7bba7d28365ff98dae74f20ebf9f53d42023a)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-llvmflang-trunk-20240616/bin
```
The following is the original reproducer:
https://github.com/lfortran/lfortran/blob/main/integration_tests/line_continuation_02.f90
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWFtv2zgW_jXyCyGBoi6WHvzgSeKZYhbYYtJ3gyKPZG4oUiCpxJ1fvyAlX-S22WZRA1O0hXk75_vOTeSh1opOAWyi4reoeFzR0R202bzE1Bj9ZleN5l83f8FgNB-ZaCQgrdDvmjdauijbRvgxwtuDc4P1I7KLyK6bVhNtuojs_o7IroGj-pPbWk3bp_9PQsGc5UQlnv62NZ5mhHLQgUF-S7ZF4lqAQFH2iPD11GAiUs4TpBTXA-VQRLYReVgKAcVvdF-vPjvKXhAf--FbjEwrqyVMsy11VCKP1igqERijPS308MfTw58RqZx-AWWTZ_E3fFJfwiAiVURqz8HTSP3vlgoJHFEPdWe0dhHZSfnax4PR_wHmh62kyptViiYiu8_UWDAR2Q0GLKMqYcMQkSqtcUTqCdnnfz1tn5-QHZteOERRM3bIwKCNQ06jG88JdxibhOl-VvytfmHtCDYiO0QVR0IxOXJA7gCIGWoPqKHsxRnKIPmhBXES4fqz0Z2hPaKmG3tQzoPwrPXgtTDdD0KCieE4SG0CReaZxx5OsEHszKheYoJJjsu09FEm1MlAsYI3FLcsRbEzYpCAjlW5L_N4VC9Kv6lYCjUe406NKH5GcW9Aakad0CruNQeJBsFQPAgWS3gFicg0E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