diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 44c0f0c..9a5232d 100644
--- a/tests/aggregation_regress/tests.py
+++ b/tests/aggregation_regress/tests.py
@@ -926,6 +926,21 @@ class AggregationTests(TestCase):
             lambda b: (b.name, b.authorCount)
         )
 
+    def test_double_annotation_filter(self):
+        qs = Book.objects.values("name").annotate(
+            n_authors=Count("authors"),
+        ).filter(
+            authors__name__startswith="Adrian",
+        ).annotate(
+            n_authors2=Count("authors"),
+        )
+        self.assertQuerysetEqual(
+            qs, [
+                ("The Definitive Guide to Django: Web Development Done Right", 2, 1)
+            ],
+            lambda b: (b["name"], b["n_authors"], b["n_authors2"])
+        )
+
     @skipUnlessDBFeature('supports_stddev')
     def test_stddev(self):
         self.assertEqual(
