[clang] [Frontend][Sema] Add CC1-only -fms-anonymous-structs to enable Microsoft anonymous struct/union feature (PR #176551)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 21 09:43:46 PST 2026
================
@@ -0,0 +1,15 @@
+// Test that -fms-anonymous-structs is a CC1-only option and properly rejected by driver
+
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fms-anonymous-structs %s -fsyntax-only 2>&1 | \
+// RUN: FileCheck --check-prefix=CC1-OK %s --allow-empty
+// CC1-OK-NOT: error: unknown argument
+
+// Test that multiple occurrences are handled
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fms-anonymous-structs -fms-anonymous-structs %s -fsyntax-only 2>&1 | \
+// RUN: FileCheck --check-prefix=MULTI-OK %s --allow-empty
+// MULTI-OK-NOT: error: unknown argument
+
+// Test with other MS-related options
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fms-extensions -fms-anonymous-structs %s -fsyntax-only 2>&1 | \
+// RUN: FileCheck --check-prefix=WITH-MS-EXT %s --allow-empty
+// WITH-MS-EXT-NOT: error: unknown argument
----------------
hubert-reinterpretcast wrote:
Is there a negative form of the option? Either we expect that it does not exist (and generates an error) or it should be tested as being accepted.
https://github.com/llvm/llvm-project/pull/176551
More information about the cfe-commits
mailing list