[llvm] [MC] Increase asm-macro-max-nesting-depth default to 100 (PR #218455)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 22:07:43 PDT 2026


================
@@ -1,20 +1,36 @@
-// RUN: llvm-mc -triple x86_64-unknown-unknown -asm-macro-max-nesting-depth=42 %s | FileCheck %s -check-prefix=CHECK_PASS
-// RUN: not llvm-mc -triple x86_64-unknown-unknown %s 2> %t
-// RUN: FileCheck -check-prefix=CHECK_FAIL < %t %s
+/// The default nesting limit is pinned to max_macro_nest in GNU as (gas/as.c),
+/// including the boundary: gas tests macro_nest > max_macro_nest, so 100 levels
+/// assemble and 101 do not.
+///
+/// The limit has to clear what hand-written assembly actually reaches.  The
+/// shape below is glibc's, from sysdeps/unix/sysv/linux/alpha/rt_sigaction.S,
+/// where SIGCONTEXT_REGS_I recurses once per register to emit a cfi_offset and
+/// so nests 31 deep -- well over the 20 this used to default to.
 
-.macro rec head, tail:vararg
- .ifnb \tail
- rec \tail
+// RUN: llvm-mc -triple x86_64-unknown-unknown -defsym DEPTH=30 %s \
----------------
MaskRay wrote:

Prefer `-triple x86_64` to `x86_64-unknown-unknown`

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


More information about the llvm-commits mailing list