[clang] [llvm] [Clang][AIX] Add -mloadtime-comment-vars flag to preserve identifying variables (PR #187986)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 28 16:56:44 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.
+// MULTI — multiple occurrences of the option on the command line combine
+// the lists; cc1 receives every occurrence in order and combines
+// them internally.
----------------
hubert-reinterpretcast wrote:
Fold this test point into one of the other tests that have multiple symbol names specified.
https://github.com/llvm/llvm-project/pull/187986
More information about the cfe-commits
mailing list