[Lldb-commits] [lldb] [NFCI][lldb][test] Avoid unnecessary GNU extension for assembly call (PR #167221)

Raul Tambre via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 9 05:33:06 PST 2025


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

>From 20ed954eacc87fa9c386f75feaf557a1fcf3219d Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul at tambre.ee>
Date: Thu, 6 Nov 2025 14:45:27 +0200
Subject: [PATCH] [NFCI][lldb][test] Avoid GNU extension for specifying
 mangling

`asm()` on function declarations is used for specifying the mangling.
But that specific spelling is a GNU extension unlike `__asm()`.

Found by building with `-std=c2y` in Clang's C frontend's config file.
---
 lldb/test/Shell/Unwind/Inputs/call-asm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/test/Shell/Unwind/Inputs/call-asm.c b/lldb/test/Shell/Unwind/Inputs/call-asm.c
index b154c1ac1385d..778c16b36a761 100644
--- a/lldb/test/Shell/Unwind/Inputs/call-asm.c
+++ b/lldb/test/Shell/Unwind/Inputs/call-asm.c
@@ -1,3 +1,3 @@
-int asm_main() asm("asm_main");
-
+// Explicit mangling is necessary as on Darwin an underscore is prepended to the symbol.
+int asm_main() __asm("asm_main");
 int main() { return asm_main(); }



More information about the lldb-commits mailing list