[llvm] [Sframe] Support cfi_escape directives compatibly with gnu-gas (PR #161927)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 23:00:05 PDT 2025


================
@@ -0,0 +1,37 @@
+# RUN: llvm-mc --filetype=obj --gsframe -triple x86_64 %s -o %t.o 2>&1 | FileCheck %s
+# RUN: llvm-readelf --sframe %t.o | FileCheck %s --check-prefix=NOFDES
+
+# Tests that .cfi_escape sequences that are unrepresentable in sframe warn
+# and do not produce FDEs.
+
+        .align 1024
+cfi_escape_sp:
+        .cfi_startproc
+        .long 0
+# Setting SP via other registers makes it unrepresentable in sframe
+# DW_CFA_expression,reg 0x7,length 2,DW_OP_breg6,SLEB(-8)
+# CHECK: skipping SFrame FDE; .cfi_escape DW_CFA_expression with SP reg 7
----------------
MaskRay wrote:

Should include file/line/col and the string `warning:` for warnings.

E.g. `# CHECK: {{.*}}.s:[[#@LINE+1]]:11: warning: ignoring non-zero fill value in BSS section '.bss'`


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


More information about the llvm-commits mailing list