================
@@ -190,6 +190,26 @@ TEST_F(CommandLineTest, 
BoolOptionDefaultTrueSingleFlagPresent) {
   ASSERT_THAT(GeneratedArgs, Contains(StrEq("-fno-temp-file")));
 }
 
+TEST_F(CommandLineTest, MSAnonymousStructsFlagPresent) {
+  const char *Args[] = {"-cc1", "-fms-anonymous-structs"};
+
+  ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
+
+  EXPECT_TRUE(Invocation.getLangOpts().MSAnonymousStructs);
+
+  Invocation.generateCC1CommandLine(GeneratedArgs, *this);
+
+  ASSERT_THAT(GeneratedArgs, Contains(StrEq("-fms-anonymous-structs")));
+}
+
+TEST_F(CommandLineTest, MSAnonymousStructsEnabledByMSExtensions) {
+  const char *Args[] = {"clang", "-fms-extensions"};
+
+  ASSERT_TRUE(CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags));
+
+  EXPECT_TRUE(Invocation.getLangOpts().MSAnonymousStructs);
+}
+
----------------
hubert-reinterpretcast wrote:

Same comment as above re: not needing to update this test.

https://github.com/llvm/llvm-project/pull/176551
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to