[flang-commits] [flang] [flang] Allow extended char set in `BIND(C, name="...")` (PR #172457)
via flang-commits
flang-commits at lists.llvm.org
Sun Jan 25 06:13:47 PST 2026
================
@@ -1,10 +1,18 @@
! RUN: %python %S/test_errors.py %s %flang_fc1
-!ERROR: Symbol has a BIND(C) name that is not a valid C language identifier
subroutine bang() bind(C,name='!')
end
-!ERROR: Symbol has a BIND(C) name that is not a valid C language identifier
+!ERROR: Symbol has a BIND(C) name containing non-visible ASCII character(s)
subroutine cr() bind(C,name=achar(13))
end
-!ERROR: Symbol has a BIND(C) name that is not a valid C language identifier
+!! depending on used assembler it can be threated as error or not
----------------
foxtran wrote:
I have a look what other languages/compilers are actually testing if they allow free input for bind(C) analogues. D language has a limited set of allowed characters. Rust and Swift allow everything, only simple `foo`/`bar` are used in testing.
LLVM is able to work with `.L1` (and other local labels) by renaming labels. So, it is not a problem for LLVM while issues with `as` command can be observed for such cases. `.text` can be presented in final `.S`, but `as` may raise error on redefinition of `.text` section.
So, now, I left only tests that works on many platforms, like other compilers do.
https://github.com/llvm/llvm-project/pull/172457
More information about the flang-commits
mailing list