[llvm] [MC][Support] Track macro definition locations for improved diagnostics (PR #198936)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 13 15:33:13 PDT 2026
================
@@ -1,19 +1,42 @@
# RUN: not llvm-mc -triple x86_64 %s -o /dev/null 2>&1 | FileCheck %s --match-full-lines --strict-whitespace
-# CHECK:<instantiation>:1:1: error: unknown directive
-# CHECK-NEXT:.macrobody0
-# CHECK-NEXT:^
-# CHECK-NEXT:<instantiation>:1:1: note: while in macro instantiation
-# CHECK-NEXT:.test0
-# CHECK-NEXT:^
-# CHECK-NEXT:{{.*}}.s:[[#@LINE+10]]:1: note: while in macro instantiation
-# CHECK-NEXT:.test1
-# CHECK-NEXT:^
+## This test verifies that:
+## * Macro instantiation notes point directly to the `.macro` signature line itself
+## (e.g. `.macro .test1` instead of the first statement of the macro body).
+## * Nested active macro instantiation stacks unwind cleanly.
+## * Column numbers and caret alignments inside `<instantiation>` virtual buffers
+## are reported correctly (e.g. matching `.macrobody0` at column 7 on line 2).
+
+
+# CHECK:<instantiation>:2:7: error: unknown directive
----------------
MaskRay wrote:
I am not clear about the desired output; can you try ask agents to get inspiration from clang macro expansion?
https://github.com/llvm/llvm-project/pull/198936
More information about the llvm-commits
mailing list