[Lldb-commits] [lldb] [NFCI][lldb][test] Avoid GNU extension for specifying mangling (PR #167221)

Raul Tambre via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 9 07:43:52 PST 2025


tambry wrote:

@Michael137 The error:
```******************** TEST 'lldb-shell :: Unwind/thread-step-out-ret-addr-check.test' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 7
/home/tambre/dev/llvm/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution --target=x86_64-pc-linux-gnu -pthread -fmodules-cache-path=/home/tambre/dev/llvm/build/lldb-test-build.noindex/module-cache-clang/lldb-shell /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/call-asm.c -x assembler-with-cpp /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s -o /home/tambre/dev/llvm/build/tools/lldb/test/Shell/Unwind/Output/thread-step-out-ret-addr-check.test.tmp
# executed command: /home/tambre/dev/llvm/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution --target=x86_64-pc-linux-gnu -pthread -fmodules-cache-path=/home/tambre/dev/llvm/build/lldb-test-build.noindex/module-cache-clang/lldb-shell /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/call-asm.c -x assembler-with-cpp /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/thread-step-out-ret-addr-check.s -o /home/tambre/dev/llvm/build/tools/lldb/test/Shell/Unwind/Output/thread-step-out-ret-addr-check.test.tmp
# .---command stderr------------
# | clang: warning: argument unused during compilation: '-fmodules-cache-path=/home/tambre/dev/llvm/build/lldb-test-build.noindex/module-cache-clang/lldb-shell' [-Wunused-command-line-argument]
# | /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/call-asm.c:2:16: error: expected function body after function declarator
# |     2 | int asm_main() asm("asm_main");
# |       |                ^
# | /home/tambre/dev/llvm/lldb/test/Shell/Unwind/Inputs/call-asm.c:3:21: error: use of undeclared identifier 'asm_main'
# |     3 | int main() { return asm_main(); }
# |       |                     ^~~~~~~~
# | 2 errors generated.
# `-----------------------------
# error: command failed with exit status: 1
```
The `asm()` syntax [is C++/GNU-only](https://github.com/llvm/llvm-project/blob/2095ea5b407fb82da5c8188af6f51811f2947390/clang/include/clang/Basic/TokenKinds.def#L357) (or with `-fgnu-keywords`). I'll add the `__asm` syntax to documentation ().

https://github.com/llvm/llvm-project/pull/167221


More information about the lldb-commits mailing list