================
@@ -466,6 +584,38 @@ inline T Foo<T>::bar(const T& t, const U& u) { return {}; }
   }
 }
 
+TEST_F(DefineOutlineTest, DeclspecAttributes) {
+  FileName = "Test.hpp";
+  ExtraFiles["Test.cpp"] = "";
+  ExtraArgs.push_back("-fdeclspec");
+
+  struct {
+    llvm::StringRef Test;
+    llvm::StringRef ExpectedHeader;
+    llvm::StringRef ExpectedSource;
+  } Cases[] = {
+      {
+          R"cpp(
+            struct A {
+              __declspec(noinline) int ^foo() { return 0; }
+            };
+)cpp",
+          R"cpp(
+            struct A {
+              __declspec(noinline) int foo() ;
+            };
+)cpp",
+          "int A::foo() { return 0; }\n"},
+  };
+  llvm::StringMap<std::string> EditedFiles;
+  for (auto &Case : Cases) {
+    apply(Case.Test, &EditedFiles);
----------------
ckandeler wrote:

**[LLM-generated]** Nit: the result of this first `apply()` call is discarded 
and the same thing is applied again on the next line. It looks like this was 
copied from an existing test (which has the same pattern), but it seems 
redundant here.

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

Reply via email to