[clang] [llvm] [Clang][AIX] Add -mloadtime-comment-vars flag to preserve identifying variables (PR #187986)
Tony Varghese via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 5 22:02:15 PDT 2026
================
@@ -0,0 +1,291 @@
+// Test -mloadtime-comment-vars= IR output for C++ on AIX. Four scenarios
+// are covered, each with its own set of named variables and check prefix:
+//
+// CHECK — mangled-name matching: file- and namespace-scope variables
+// receive !loadtime_comment metadata and are added to
+// llvm.compiler.used; name-matched static data members are
+// diagnosed and left unpreserved (still emitted as ordinary
+// definitions). A second pass (NOEMIT) over the same output
+// proves that listed variables of non-plain-char element type
+// (wchar_t, char16_t, char8_t) and of non-character type are
+// not preserved and not emitted. Their diagnostic is covered
+// by the Sema tests and silenced here.
+//
+// STORAGE — storage-duration filtering: thread_local variables are
+// diagnosed by Sema and receive no metadata; a function-local
+// static is diagnosed and receives no metadata.
+//
+// SPACE/DUP — list-parsing edge cases: a name with a leading space matches
+// nothing; a duplicate name preserves the variable exactly once.
----------------
tonykuttai wrote:
moved the storage-duration and list-parsing scenarios into `loadtime-comment-vars.c` test. C++ now has only the name-mangled matching runs.
https://github.com/llvm/llvm-project/pull/187986
More information about the cfe-commits
mailing list