[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,28 @@
+// RUN: %clang -### -target powerpc-ibm-aix -mloadtime-comment-vars=sccsid,version %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target x86_64-linux-gnu -mloadtime-comment-vars=sccsid,version %s 2>&1 | FileCheck %s --check-prefix=NONAIX
+
+// RUN: %clang -### -target powerpc-ibm-aix -mloadtime-comment-vars=sccsid -mloadtime-comment-vars=version,build %s 2>&1 | FileCheck %s --check-prefix=MULTI
+// RUN: %clang -### -target x86_64-linux-gnu -mloadtime-comment-vars=sccsid -mloadtime-comment-vars=version %s 2>&1 | FileCheck %s --check-prefix=NONAIX-MULTI
+
+// Verify the option is forwarded verbatim to cc1 for a supported target.
+// CHECK: "-cc1"
+// CHECK-SAME: "-mloadtime-comment-vars=sccsid,version"
+
+// Verify a warning is emitted and the option is NOT forwarded for an
+// unsupported target.
+// NONAIX: warning: ignoring '-mloadtime-comment-vars=' option as it is not currently supported for target 'x86_64-unknown-linux-gnu'
+// NONAIX: "-cc1"
----------------
hubert-reinterpretcast wrote:
This would cause unintentional scoping of the negative test on the next line.
```suggestion
```
https://github.com/llvm/llvm-project/pull/187986
More information about the cfe-commits
mailing list