]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116417: Add _testlimitedcapi C extension (#116419)
authorVictor Stinner <vstinner@python.org>
Thu, 7 Mar 2024 18:31:12 +0000 (19:31 +0100)
committerGitHub <noreply@github.com>
Thu, 7 Mar 2024 18:31:12 +0000 (18:31 +0000)
Add a new C extension "_testlimitedcapi" which is only built with the
limited C API.

Move heaptype_relative.c and vectorcall_limited.c from
Modules/_testcapi/ to Modules/_testlimitedcapi/.

* configure: add _testlimitedcapi test extension.
* Update generate_stdlib_module_names.py.
* Update make check-c-globals.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
23 files changed:
Lib/test/support/__init__.py
Lib/test/test_call.py
Lib/test/test_capi/test_misc.py
Modules/Setup.stdlib.in
Modules/_testcapi/clinic/vectorcall_limited.c.h [deleted file]
Modules/_testcapi/parts.h
Modules/_testcapimodule.c
Modules/_testlimitedcapi.c [new file with mode: 0644]
Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h [new file with mode: 0644]
Modules/_testlimitedcapi/heaptype_relative.c [moved from Modules/_testcapi/heaptype_relative.c with 98% similarity]
Modules/_testlimitedcapi/parts.h [new file with mode: 0644]
Modules/_testlimitedcapi/vectorcall_limited.c [moved from Modules/_testcapi/vectorcall_limited.c with 85% similarity]
PCbuild/_testcapi.vcxproj
PCbuild/_testlimitedcapi.vcxproj [new file with mode: 0644]
PCbuild/_testlimitedcapi.vcxproj.filters [new file with mode: 0644]
PCbuild/pcbuild.proj
PCbuild/pcbuild.sln
PCbuild/readme.txt
Tools/build/generate_stdlib_module_names.py
Tools/c-analyzer/c_parser/preprocessor/gcc.py
Tools/msi/test/test_files.wxs
configure
configure.ac

index 14e3766a34377b808e1ae9b8ea9623cd6d9a9ce8..505d4bea83fe8d59b33c512b9b867df2f141a96a 100644 (file)
@@ -1153,8 +1153,9 @@ def refcount_test(test):
 def requires_limited_api(test):
     try:
         import _testcapi
+        import _testlimitedcapi
     except ImportError:
-        return unittest.skip('needs _testcapi module')(test)
+        return unittest.skip('needs _testcapi and _testlimitedcapi modules')(test)
     return test
 
 def requires_specialization(test):
index 2a6a5d287b04ee97af04d3754d47f8b42b09d3c2..eaf919584b4c64cb808e6ceaa55e62b57d8533b6 100644 (file)
@@ -5,6 +5,10 @@ try:
     import _testcapi
 except ImportError:
     _testcapi = None
+try:
+    import _testlimitedcapi
+except ImportError:
+    _testlimitedcapi = None
 import struct
 import collections
 import itertools
@@ -837,12 +841,12 @@ class TestPEP590(unittest.TestCase):
     @requires_limited_api
     def test_vectorcall_limited_incoming(self):
         from _testcapi import pyobject_vectorcall
-        obj = _testcapi.LimitedVectorCallClass()
+        obj = _testlimitedcapi.LimitedVectorCallClass()
         self.assertEqual(pyobject_vectorcall(obj, (), ()), "vectorcall called")
 
     @requires_limited_api
     def test_vectorcall_limited_outgoing(self):
-        from _testcapi import call_vectorcall
+        from _testlimitedcapi import call_vectorcall
 
         args_captured = []
         kwargs_captured = []
@@ -858,7 +862,7 @@ class TestPEP590(unittest.TestCase):
 
     @requires_limited_api
     def test_vectorcall_limited_outgoing_method(self):
-        from _testcapi import call_vectorcall_method
+        from _testlimitedcapi import call_vectorcall_method
 
         args_captured = []
         kwargs_captured = []
index 67fbef4f269814691cf8f525dd0faf6195f04d66..64c0da6e3cc06ed0796390faf34e8925b544c341 100644 (file)
@@ -47,6 +47,7 @@ except ModuleNotFoundError:
 # Skip this test if the _testcapi module isn't available.
 _testcapi = import_helper.import_module('_testcapi')
 
+import _testlimitedcapi
 import _testinternalcapi
 
 
@@ -1124,7 +1125,7 @@ class TestHeapTypeRelative(unittest.TestCase):
         # Test subclassing using "relative" basicsize, see PEP 697
         def check(extra_base_size, extra_size):
             Base, Sub, instance, data_ptr, data_offset, data_size = (
-                _testcapi.make_sized_heaptypes(
+                _testlimitedcapi.make_sized_heaptypes(
                     extra_base_size, -extra_size))
 
             # no alignment shenanigans when inheriting directly
@@ -1152,11 +1153,11 @@ class TestHeapTypeRelative(unittest.TestCase):
 
                 # we don't reserve (requested + alignment) or more data
                 self.assertLess(data_size - extra_size,
-                                _testcapi.ALIGNOF_MAX_ALIGN_T)
+                                _testlimitedcapi.ALIGNOF_MAX_ALIGN_T)
 
             # The offsets/sizes we calculated should be aligned.
-            self.assertEqual(data_offset % _testcapi.ALIGNOF_MAX_ALIGN_T, 0)
-            self.assertEqual(data_size % _testcapi.ALIGNOF_MAX_ALIGN_T, 0)
+            self.assertEqual(data_offset % _testlimitedcapi.ALIGNOF_MAX_ALIGN_T, 0)
+            self.assertEqual(data_size % _testlimitedcapi.ALIGNOF_MAX_ALIGN_T, 0)
 
         sizes = sorted({0, 1, 2, 3, 4, 7, 8, 123,
                         object.__basicsize__,
@@ -1182,7 +1183,7 @@ class TestHeapTypeRelative(unittest.TestCase):
                         object.__basicsize__+1})
         for extra_size in sizes:
             with self.subTest(extra_size=extra_size):
-                Sub = _testcapi.subclass_var_heaptype(
+                Sub = _testlimitedcapi.subclass_var_heaptype(
                     _testcapi.HeapCCollection, -extra_size, 0, 0)
                 collection = Sub(1, 2, 3)
                 collection.set_data_to_3s()
@@ -1196,7 +1197,7 @@ class TestHeapTypeRelative(unittest.TestCase):
         with self.assertRaises(SystemError,
                                msg="Cannot extend variable-size class without "
                                + "Py_TPFLAGS_ITEMS_AT_END"):
-            _testcapi.subclass_heaptype(int, -8, 0)
+            _testlimitedcapi.subclass_heaptype(int, -8, 0)
 
     def test_heaptype_relative_members(self):
         """Test HeapCCollection subclasses work properly"""
@@ -1209,7 +1210,7 @@ class TestHeapTypeRelative(unittest.TestCase):
                 for offset in sizes:
                     with self.subTest(extra_base_size=extra_base_size, extra_size=extra_size, offset=offset):
                         if offset < extra_size:
-                            Sub = _testcapi.make_heaptype_with_member(
+                            Sub = _testlimitedcapi.make_heaptype_with_member(
                                 extra_base_size, -extra_size, offset, True)
                             Base = Sub.mro()[1]
                             instance = Sub()
@@ -1228,29 +1229,29 @@ class TestHeapTypeRelative(unittest.TestCase):
                                 instance.set_memb_relative(0)
                         else:
                             with self.assertRaises(SystemError):
-                                Sub = _testcapi.make_heaptype_with_member(
+                                Sub = _testlimitedcapi.make_heaptype_with_member(
                                     extra_base_size, -extra_size, offset, True)
                         with self.assertRaises(SystemError):
-                            Sub = _testcapi.make_heaptype_with_member(
+                            Sub = _testlimitedcapi.make_heaptype_with_member(
                                 extra_base_size, extra_size, offset, True)
                 with self.subTest(extra_base_size=extra_base_size, extra_size=extra_size):
                     with self.assertRaises(SystemError):
-                        Sub = _testcapi.make_heaptype_with_member(
+                        Sub = _testlimitedcapi.make_heaptype_with_member(
                             extra_base_size, -extra_size, -1, True)
 
     def test_heaptype_relative_members_errors(self):
         with self.assertRaisesRegex(
                 SystemError,
                 r"With Py_RELATIVE_OFFSET, basicsize must be negative"):
-            _testcapi.make_heaptype_with_member(0, 1234, 0, True)
+            _testlimitedcapi.make_heaptype_with_member(0, 1234, 0, True)
         with self.assertRaisesRegex(
                 SystemError, r"Member offset out of range \(0\.\.-basicsize\)"):
-            _testcapi.make_heaptype_with_member(0, -8, 1234, True)
+            _testlimitedcapi.make_heaptype_with_member(0, -8, 1234, True)
         with self.assertRaisesRegex(
                 SystemError, r"Member offset out of range \(0\.\.-basicsize\)"):
-            _testcapi.make_heaptype_with_member(0, -8, -1, True)
+            _testlimitedcapi.make_heaptype_with_member(0, -8, -1, True)
 
-        Sub = _testcapi.make_heaptype_with_member(0, -8, 0, True)
+        Sub = _testlimitedcapi.make_heaptype_with_member(0, -8, 0, True)
         instance = Sub()
         with self.assertRaisesRegex(
                 SystemError, r"PyMember_GetOne used with Py_RELATIVE_OFFSET"):
@@ -2264,10 +2265,19 @@ class TestThreadState(unittest.TestCase):
         _testcapi.test_current_tstate_matches()
 
 
+def get_test_funcs(mod, exclude_prefix=None):
+    funcs = {}
+    for name in dir(mod):
+        if not name.startswith('test_'):
+            continue
+        if exclude_prefix is not None and name.startswith(exclude_prefix):
+            continue
+        funcs[name] = getattr(mod, name)
+    return funcs
+
+
 class Test_testcapi(unittest.TestCase):
-    locals().update((name, getattr(_testcapi, name))
-                    for name in dir(_testcapi)
-                    if name.startswith('test_'))
+    locals().update(get_test_funcs(_testcapi))
 
     # Suppress warning from PyUnicode_FromUnicode().
     @warnings_helper.ignore_warnings(category=DeprecationWarning)
@@ -2278,11 +2288,13 @@ class Test_testcapi(unittest.TestCase):
         self.assertEqual(_testcapi.Py_Version, sys.hexversion)
 
 
+class Test_testlimitedcapi(unittest.TestCase):
+    locals().update(get_test_funcs(_testlimitedcapi))
+
+
 class Test_testinternalcapi(unittest.TestCase):
-    locals().update((name, getattr(_testinternalcapi, name))
-                    for name in dir(_testinternalcapi)
-                    if name.startswith('test_')
-                    and not name.startswith('test_lock_'))
+    locals().update(get_test_funcs(_testinternalcapi,
+                                   exclude_prefix='test_lock_'))
 
 
 @threading_helper.requires_working_threading()
index 73b082691a3fd493cbe54fd3f81785c30f28670f..d2acbc2a568726ee594269d63abf3838a19460e1 100644 (file)
 @MODULE__XXTESTFUZZ_TRUE@_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
 @MODULE__TESTBUFFER_TRUE@_testbuffer _testbuffer.c
 @MODULE__TESTINTERNALCAPI_TRUE@_testinternalcapi _testinternalcapi.c _testinternalcapi/test_lock.c _testinternalcapi/pytime.c _testinternalcapi/set.c _testinternalcapi/test_critical_sections.c
-@MODULE__TESTCAPI_TRUE@_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/vectorcall_limited.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/bytearray.c _testcapi/bytes.c _testcapi/unicode.c _testcapi/dict.c _testcapi/set.c _testcapi/list.c _testcapi/tuple.c _testcapi/getargs.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/complex.c _testcapi/numbers.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyatomic.c _testcapi/pyos.c _testcapi/file.c _testcapi/codec.c _testcapi/immortal.c _testcapi/heaptype_relative.c _testcapi/gc.c _testcapi/sys.c _testcapi/hash.c _testcapi/time.c
+@MODULE__TESTCAPI_TRUE@_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/bytearray.c _testcapi/bytes.c _testcapi/unicode.c _testcapi/dict.c _testcapi/set.c _testcapi/list.c _testcapi/tuple.c _testcapi/getargs.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/complex.c _testcapi/numbers.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyatomic.c _testcapi/pyos.c _testcapi/file.c _testcapi/codec.c _testcapi/immortal.c _testcapi/gc.c _testcapi/sys.c _testcapi/hash.c _testcapi/time.c
+@MODULE__TESTLIMITEDCAPI_TRUE@_testlimitedcapi _testlimitedcapi.c _testlimitedcapi/vectorcall_limited.c _testlimitedcapi/heaptype_relative.c
 @MODULE__TESTCLINIC_TRUE@_testclinic _testclinic.c
 @MODULE__TESTCLINIC_LIMITED_TRUE@_testclinic_limited _testclinic_limited.c
 
diff --git a/Modules/_testcapi/clinic/vectorcall_limited.c.h b/Modules/_testcapi/clinic/vectorcall_limited.c.h
deleted file mode 100644 (file)
index a233aef..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*[clinic input]
-preserve
-[clinic start generated code]*/
-
-PyDoc_STRVAR(_testcapi_call_vectorcall__doc__,
-"call_vectorcall($module, callable, /)\n"
-"--\n"
-"\n");
-
-#define _TESTCAPI_CALL_VECTORCALL_METHODDEF    \
-    {"call_vectorcall", (PyCFunction)_testcapi_call_vectorcall, METH_O, _testcapi_call_vectorcall__doc__},
-
-PyDoc_STRVAR(_testcapi_call_vectorcall_method__doc__,
-"call_vectorcall_method($module, callable, /)\n"
-"--\n"
-"\n");
-
-#define _TESTCAPI_CALL_VECTORCALL_METHOD_METHODDEF    \
-    {"call_vectorcall_method", (PyCFunction)_testcapi_call_vectorcall_method, METH_O, _testcapi_call_vectorcall_method__doc__},
-/*[clinic end generated code: output=e980906a39602528 input=a9049054013a1b77]*/
index e8cfb2423500d4b27a370337d1d8b6fc667640e4..2a043cfa73fa8b80f62fe66010ea26ce151ab1b2 100644 (file)
@@ -61,7 +61,4 @@ int _PyTestCapi_Init_Sys(PyObject *module);
 int _PyTestCapi_Init_Hash(PyObject *module);
 int _PyTestCapi_Init_Time(PyObject *module);
 
-int _PyTestCapi_Init_VectorcallLimited(PyObject *module);
-int _PyTestCapi_Init_HeaptypeRelative(PyObject *module);
-
 #endif // Py_TESTCAPI_PARTS_H
index b03f871b089c8a39b03c8ad7500d393f3d3839d3..b6536045e645f93f1005f85323e1e1919ec076b0 100644 (file)
@@ -4098,12 +4098,6 @@ PyInit__testcapi(void)
     if (_PyTestCapi_Init_PyAtomic(m) < 0) {
         return NULL;
     }
-    if (_PyTestCapi_Init_VectorcallLimited(m) < 0) {
-        return NULL;
-    }
-    if (_PyTestCapi_Init_HeaptypeRelative(m) < 0) {
-        return NULL;
-    }
     if (_PyTestCapi_Init_Hash(m) < 0) {
         return NULL;
     }
diff --git a/Modules/_testlimitedcapi.c b/Modules/_testlimitedcapi.c
new file mode 100644 (file)
index 0000000..da09e3f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Test the limited C API.
+ *
+ * The 'test_*' functions exported by this module are run as part of the
+ * standard Python regression test, via Lib/test/test_capi.py.
+ */
+
+#include "_testlimitedcapi/parts.h"
+
+static PyMethodDef TestMethods[] = {
+    {NULL, NULL} /* sentinel */
+};
+
+static struct PyModuleDef _testlimitedcapimodule = {
+    PyModuleDef_HEAD_INIT,
+    .m_name = "_testlimitedcapi",
+    .m_size = 0,
+    .m_methods = TestMethods,
+};
+
+PyMODINIT_FUNC
+PyInit__testlimitedcapi(void)
+{
+    PyObject *mod = PyModule_Create(&_testlimitedcapimodule);
+    if (mod == NULL) {
+        return NULL;
+    }
+
+    if (_PyTestCapi_Init_VectorcallLimited(mod) < 0) {
+        return NULL;
+    }
+    if (_PyTestCapi_Init_HeaptypeRelative(mod) < 0) {
+        return NULL;
+    }
+    return mod;
+}
diff --git a/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h b/Modules/_testlimitedcapi/clinic/vectorcall_limited.c.h
new file mode 100644 (file)
index 0000000..6631a9c
--- /dev/null
@@ -0,0 +1,20 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_testlimitedcapi_call_vectorcall__doc__,
+"call_vectorcall($module, callable, /)\n"
+"--\n"
+"\n");
+
+#define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHODDEF    \
+    {"call_vectorcall", (PyCFunction)_testlimitedcapi_call_vectorcall, METH_O, _testlimitedcapi_call_vectorcall__doc__},
+
+PyDoc_STRVAR(_testlimitedcapi_call_vectorcall_method__doc__,
+"call_vectorcall_method($module, callable, /)\n"
+"--\n"
+"\n");
+
+#define _TESTLIMITEDCAPI_CALL_VECTORCALL_METHOD_METHODDEF    \
+    {"call_vectorcall_method", (PyCFunction)_testlimitedcapi_call_vectorcall_method, METH_O, _testlimitedcapi_call_vectorcall_method__doc__},
+/*[clinic end generated code: output=5976b9b360e1ff30 input=a9049054013a1b77]*/
similarity index 98%
rename from Modules/_testcapi/heaptype_relative.c
rename to Modules/_testlimitedcapi/heaptype_relative.c
index 52bda75736b31679c758453a95442adc76387d2b..9878a4daf1b2cbe40d8435276f71bee4f71fe45d 100644 (file)
@@ -1,9 +1,3 @@
-#include "pyconfig.h"   // Py_GIL_DISABLED
-
-#ifndef Py_GIL_DISABLED
-#define Py_LIMITED_API 0x030c0000 // 3.12
-#endif
-
 #include "parts.h"
 #include <stddef.h>               // max_align_t
 #include <string.h>               // memset
diff --git a/Modules/_testlimitedcapi/parts.h b/Modules/_testlimitedcapi/parts.h
new file mode 100644 (file)
index 0000000..83590a7
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef Py_TESTLIMITEDCAPI_PARTS_H
+#define Py_TESTLIMITEDCAPI_PARTS_H
+
+// Always enable assertions
+#undef NDEBUG
+
+#include "pyconfig.h"   // Py_GIL_DISABLED
+
+// Use the limited C API
+#ifndef Py_GIL_DISABLED
+#  define Py_LIMITED_API 0x030c0000  // 3.12
+#endif
+
+// Make sure that the internal C API cannot be used.
+#undef Py_BUILD_CORE_MODULE
+#undef Py_BUILD_CORE_BUILTIN
+
+#include "Python.h"
+
+#ifdef Py_BUILD_CORE
+#  error "Py_BUILD_CORE macro must not be defined"
+#endif
+
+int _PyTestCapi_Init_VectorcallLimited(PyObject *module);
+int _PyTestCapi_Init_HeaptypeRelative(PyObject *module);
+
+#endif // Py_TESTLIMITEDCAPI_PARTS_H
similarity index 85%
rename from Modules/_testcapi/vectorcall_limited.c
rename to Modules/_testlimitedcapi/vectorcall_limited.c
index d7070d37bb9e9bd047bf94e2dea12041167a02cd..24aa5e991eca3fe0e30bca98a2918179dcb1748a 100644 (file)
@@ -1,18 +1,12 @@
 /* Test Vectorcall in the limited API */
 
-#include "pyconfig.h"   // Py_GIL_DISABLED
-
-#ifndef Py_GIL_DISABLED
-#define Py_LIMITED_API 0x030c0000 // 3.12
-#endif
-
 #include "parts.h"
 #include "clinic/vectorcall_limited.c.h"
 
 /*[clinic input]
-module _testcapi
+module _testlimitedcapi
 [clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=6361033e795369fc]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=2700057f9c1135ba]*/
 
 static PyObject *
 LimitedVectorCallClass_tpcall(PyObject *self, PyObject *args, PyObject *kwargs) {
@@ -40,15 +34,15 @@ LimitedVectorCallClass_new(PyTypeObject *tp, PyTypeObject *a, PyTypeObject *kw)
 }
 
 /*[clinic input]
-_testcapi.call_vectorcall
+_testlimitedcapi.call_vectorcall
 
     callable: object
     /
 [clinic start generated code]*/
 
 static PyObject *
-_testcapi_call_vectorcall(PyObject *module, PyObject *callable)
-/*[clinic end generated code: output=bae81eec97fcaad7 input=55d88f92240957ee]*/
+_testlimitedcapi_call_vectorcall(PyObject *module, PyObject *callable)
+/*[clinic end generated code: output=9cbb7832263a8eef input=0743636c12dccb28]*/
 {
     PyObject *args[3] = { NULL, NULL, NULL };
     PyObject *kwname = NULL, *kwnames = NULL, *result = NULL;
@@ -93,15 +87,15 @@ leave:
 }
 
 /*[clinic input]
-_testcapi.call_vectorcall_method
+_testlimitedcapi.call_vectorcall_method
 
     callable: object
     /
 [clinic start generated code]*/
 
 static PyObject *
-_testcapi_call_vectorcall_method(PyObject *module, PyObject *callable)
-/*[clinic end generated code: output=e661f48dda08b6fb input=5ba81c27511395b6]*/
+_testlimitedcapi_call_vectorcall_method(PyObject *module, PyObject *callable)
+/*[clinic end generated code: output=4558323a46cc09eb input=a736f7dbf15f1be5]*/
 {
     PyObject *args[3] = { NULL, NULL, NULL };
     PyObject *name = NULL, *kwname = NULL,
@@ -167,7 +161,7 @@ static PyType_Slot LimitedVectorallClass_slots[] = {
 };
 
 static PyType_Spec LimitedVectorCallClass_spec = {
-    .name = "_testcapi.LimitedVectorCallClass",
+    .name = "_testlimitedcapi.LimitedVectorCallClass",
     .basicsize = (int)(sizeof(PyObject) + sizeof(vectorcallfunc)),
     .flags = Py_TPFLAGS_DEFAULT
         | Py_TPFLAGS_HAVE_VECTORCALL
@@ -176,8 +170,8 @@ static PyType_Spec LimitedVectorCallClass_spec = {
 };
 
 static PyMethodDef TestMethods[] = {
-    _TESTCAPI_CALL_VECTORCALL_METHODDEF
-    _TESTCAPI_CALL_VECTORCALL_METHOD_METHODDEF
+    _TESTLIMITEDCAPI_CALL_VECTORCALL_METHODDEF
+    _TESTLIMITEDCAPI_CALL_VECTORCALL_METHOD_METHODDEF
     {NULL},
 };
 
index 66df0a61b5b5a66c7a7623a53064079babbf4b42..3ca4c5f86c783c8050dcde4c2c4a6454fda2c257 100644 (file)
@@ -96,9 +96,7 @@
     <ClCompile Include="..\Modules\_testcapimodule.c" />
     <ClCompile Include="..\Modules\_testcapi\getargs.c" />
     <ClCompile Include="..\Modules\_testcapi\vectorcall.c" />
-    <ClCompile Include="..\Modules\_testcapi\vectorcall_limited.c" />
     <ClCompile Include="..\Modules\_testcapi\heaptype.c" />
-    <ClCompile Include="..\Modules\_testcapi\heaptype_relative.c" />
     <ClCompile Include="..\Modules\_testcapi\abstract.c" />
     <ClCompile Include="..\Modules\_testcapi\bytearray.c" />
     <ClCompile Include="..\Modules\_testcapi\bytes.c" />
diff --git a/PCbuild/_testlimitedcapi.vcxproj b/PCbuild/_testlimitedcapi.vcxproj
new file mode 100644 (file)
index 0000000..1b27942
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|ARM">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|ARM64">
+      <Configuration>Debug</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGInstrument|ARM">
+      <Configuration>PGInstrument</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGInstrument|ARM64">
+      <Configuration>PGInstrument</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGInstrument|Win32">
+      <Configuration>PGInstrument</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGInstrument|x64">
+      <Configuration>PGInstrument</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGUpdate|ARM">
+      <Configuration>PGUpdate</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGUpdate|ARM64">
+      <Configuration>PGUpdate</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGUpdate|Win32">
+      <Configuration>PGUpdate</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="PGUpdate|x64">
+      <Configuration>PGUpdate</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM">
+      <Configuration>Release</Configuration>
+      <Platform>ARM</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}</ProjectGuid>
+    <RootNamespace>_testlimitedcapi</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+    <SupportPGO>false</SupportPGO>
+  </PropertyGroup>
+  <Import Project="python.props" />
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <PropertyGroup>
+    <TargetExt>$(PyStdlibPydExt)</TargetExt>
+  </PropertyGroup>
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="pyproject.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+  </PropertyGroup>
+  <ItemGroup>
+    <ClCompile Include="..\Modules\_testlimitedcapi.c" />
+    <ClCompile Include="..\Modules\_testlimitedcapi\vectorcall_limited.c" />
+    <ClCompile Include="..\Modules\_testlimitedcapi\heaptype_relative.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="..\PC\python_nt.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="pythoncore.vcxproj">
+      <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="python3dll.vcxproj">
+      <Project>{885d4898-d08d-4091-9c40-c700cfe3fc5a}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/PCbuild/_testlimitedcapi.vcxproj.filters b/PCbuild/_testlimitedcapi.vcxproj.filters
new file mode 100644 (file)
index 0000000..c4764a5
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{a76a90d8-8e8b-4c36-8f58-8bd46abe9f5e}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{071b2ff4-e5a1-4e79-b0c5-cf46b0094a80}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\Modules\_testlimitedcapi\vectorcall_limited.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\Modules\_testlimitedcapi\heaptype_relative.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\Modules\_testlimitedcapi.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="..\PC\python_nt.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
index b7b78be768d7ecfba2f6aac4f0334c050ea812c9..a2a637a304437389e9ce5f46756bbc52cfa26505 100644 (file)
@@ -77,7 +77,7 @@
     <ExtensionModules Include="@(ExternalModules->'%(Identity)')" Condition="$(IncludeExternals)" />
     <Projects Include="@(ExtensionModules->'%(Identity).vcxproj')" Condition="$(IncludeExtensions)" />
     <!-- Test modules -->
-    <TestModules Include="_ctypes_test;_testbuffer;_testcapi;_testinternalcapi;_testembed;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testclinic;_testclinic_limited" />
+    <TestModules Include="_ctypes_test;_testbuffer;_testcapi;_testlimitedcapi;_testinternalcapi;_testembed;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testclinic;_testclinic_limited" />
     <TestModules Include="xxlimited" Condition="'$(Configuration)' == 'Release'" />
     <TestModules Include="xxlimited_35" Condition="'$(Configuration)' == 'Release'" />
     <Projects Include="@(TestModules->'%(Identity).vcxproj')" Condition="$(IncludeTests)">
index a0b5fbd1304b418674107a3e6a90e1de809613f6..d10e1c46a9148049d89d278004711fa309197a97 100644 (file)
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30028.174
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34525.116
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{553EC33E-9816-4996-A660-5D6186A0B0B3}"
        ProjectSection(SolutionItems) = preProject
@@ -159,6 +159,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_wmi", "_wmi.vcxproj", "{54
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testclinic_limited", "_testclinic_limited.vcxproj", "{01FDF29A-40A1-46DF-84F5-85EBBD2A2410}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testlimitedcapi", "_testlimitedcapi.vcxproj", "{7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|ARM = Debug|ARM
@@ -1648,6 +1650,38 @@ Global
                {01FDF29A-40A1-46DF-84F5-85EBBD2A2410}.Release|Win32.Build.0 = Release|Win32
                {01FDF29A-40A1-46DF-84F5-85EBBD2A2410}.Release|x64.ActiveCfg = Release|x64
                {01FDF29A-40A1-46DF-84F5-85EBBD2A2410}.Release|x64.Build.0 = Release|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|ARM.ActiveCfg = Debug|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|ARM.Build.0 = Debug|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|ARM64.ActiveCfg = Debug|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|ARM64.Build.0 = Debug|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|Win32.ActiveCfg = Debug|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|Win32.Build.0 = Debug|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|x64.ActiveCfg = Debug|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Debug|x64.Build.0 = Debug|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGInstrument|x64.Build.0 = PGInstrument|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.PGUpdate|x64.Build.0 = PGUpdate|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|ARM.ActiveCfg = Release|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|ARM.Build.0 = Release|ARM
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|ARM64.ActiveCfg = Release|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|ARM64.Build.0 = Release|ARM64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|Win32.ActiveCfg = Release|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|Win32.Build.0 = Release|Win32
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|x64.ActiveCfg = Release|x64
+               {7467D86C-1CEB-4CB9-B65E-E9A54ABDC933}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index a7c2a68928ca849fb11027a1cc481df65e2d838d..1fdd8a4a5ab52bddc29f0b148326761ee50264c9 100644 (file)
@@ -131,29 +131,31 @@ xxlimited_35
 The following sub-projects are for individual modules of the standard
 library which are implemented in C; each one builds a DLL (renamed to
 .pyd) of the same name as the project:
-_asyncio
-_ctypes
-_ctypes_test
-_zoneinfo
-_decimal
-_elementtree
-_hashlib
-_multiprocessing
-_overlapped
-_socket
-_testbuffer
-_testcapi
-_testclinic
-_testclinic_limited
-_testconsole
-_testimportmultiple
-_testmultiphase
-_testsinglephase
-_tkinter
-pyexpat
-select
-unicodedata
-winsound
+ * _asyncio
+ * _ctypes
+ * _ctypes_test
+ * _zoneinfo
+ * _decimal
+ * _elementtree
+ * _hashlib
+ * _multiprocessing
+ * _overlapped
+ * _socket
+ * _testbuffer
+ * _testcapi
+ * _testlimitedcapi
+ * _testinternalcapi
+ * _testclinic
+ * _testclinic_limited
+ * _testconsole
+ * _testimportmultiple
+ * _testmultiphase
+ * _testsinglephase
+ * _tkinter
+ * pyexpat
+ * select
+ * unicodedata
+ * winsound
 
 The following Python-controlled sub-projects wrap external projects.
 Note that these external libraries are not necessary for a working
@@ -309,6 +311,8 @@ _testclinic_limited extension, the file Modules/_testclinic_limited.c:
 * In PCbuild/, copy _testclinic.vcxproj to _testclinic_limited.vcxproj,
   replace RootNamespace value with `_testclinic_limited`, replace
   `_asyncio.c` with `_testclinic_limited.c`.
+* In PCbuild/, copy _testclinic.vcxproj.filters to
+  _testclinic_limited.vcxproj.filters, edit the list of files in the new file.
 * Open Visual Studio, open PCbuild\pcbuild.sln solution, add the
   PCbuild\_testclinic_limited.vcxproj project to the solution ("add existing
   project).
index 588dfda50658be3e93c6cbb7fd61bc9a4fec3556..69dc74e7f25ec989a05aee148de38142b77afa53 100644 (file)
@@ -32,6 +32,7 @@ IGNORE = {
     '_testconsole',
     '_testimportmultiple',
     '_testinternalcapi',
+    '_testlimitedcapi',
     '_testmultiphase',
     '_testsinglephase',
     '_testexternalinspection',
index 6ece70c77fd55c3947f2ebca7c32bb1da64dac23..cc3a9be2104dbe84515bdbeea1eeb43f5ee4f7a4 100644 (file)
@@ -15,8 +15,8 @@ FILES_WITHOUT_INTERNAL_CAPI = frozenset((
 # C files in the fhe following directories must not be built with
 # Py_BUILD_CORE.
 DIRS_WITHOUT_INTERNAL_CAPI = frozenset((
-    # Modules/_testcapi/
-    '_testcapi',
+    '_testcapi',            # Modules/_testcapi/
+    '_testlimitedcapi',     # Modules/_testlimitedcapi/
 ))
 
 TOOL = 'gcc'
index bb9b258692a62fbf53d7199eb7ba504fe5815e06..6862a5899db2bac59d46fe6b7a93fdc47c168b18 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-    <?define exts=_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited ?>
+    <?define exts=_testcapi;_testlimitedcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited ?>
     <Fragment>
         <ComponentGroup Id="test_extensions">
             <?foreach ext in $(var.exts)?>
index e62cb2baa29a785bb72e2530a7067fe2f438768b..44bd54023551a961fce0daa3814ddf589ffae8a3 100755 (executable)
--- a/configure
+++ b/configure
@@ -671,6 +671,8 @@ MODULE__TESTBUFFER_FALSE
 MODULE__TESTBUFFER_TRUE
 MODULE__TESTINTERNALCAPI_FALSE
 MODULE__TESTINTERNALCAPI_TRUE
+MODULE__TESTLIMITEDCAPI_FALSE
+MODULE__TESTLIMITEDCAPI_TRUE
 MODULE__TESTCLINIC_LIMITED_FALSE
 MODULE__TESTCLINIC_LIMITED_TRUE
 MODULE__TESTCLINIC_FALSE
@@ -27301,6 +27303,7 @@ SRCDIRS="\
   Modules/_sre \
   Modules/_testcapi \
   Modules/_testinternalcapi \
+  Modules/_testlimitedcapi \
   Modules/_xxtestfuzz \
   Modules/cjkcodecs \
   Modules/expat \
 printf "%s\n" "$py_cv_module__testclinic_limited" >&6; }
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _testlimitedcapi" >&5
+printf %s "checking for stdlib extension module _testlimitedcapi... " >&6; }
+        if test "$py_cv_module__testlimitedcapi" != "n/a"
+then :
+
+    if test "$TEST_MODULES" = yes
+then :
+  if true
+then :
+  py_cv_module__testlimitedcapi=yes
+else $as_nop
+  py_cv_module__testlimitedcapi=missing
+fi
+else $as_nop
+  py_cv_module__testlimitedcapi=disabled
+fi
+
+fi
+  as_fn_append MODULE_BLOCK "MODULE__TESTLIMITEDCAPI_STATE=$py_cv_module__testlimitedcapi$as_nl"
+  if test "x$py_cv_module__testlimitedcapi" = xyes
+then :
+
+
+
+
+fi
+   if test "$py_cv_module__testlimitedcapi" = yes; then
+  MODULE__TESTLIMITEDCAPI_TRUE=
+  MODULE__TESTLIMITEDCAPI_FALSE='#'
+else
+  MODULE__TESTLIMITEDCAPI_TRUE='#'
+  MODULE__TESTLIMITEDCAPI_FALSE=
+fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $py_cv_module__testlimitedcapi" >&5
+printf "%s\n" "$py_cv_module__testlimitedcapi" >&6; }
+
+
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdlib extension module _testinternalcapi" >&5
 printf %s "checking for stdlib extension module _testinternalcapi... " >&6; }
         if test "$py_cv_module__testinternalcapi" != "n/a"
@@ -31557,6 +31598,10 @@ if test -z "${MODULE__TESTCLINIC_LIMITED_TRUE}" && test -z "${MODULE__TESTCLINIC
   as_fn_error $? "conditional \"MODULE__TESTCLINIC_LIMITED\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${MODULE__TESTLIMITEDCAPI_TRUE}" && test -z "${MODULE__TESTLIMITEDCAPI_FALSE}"; then
+  as_fn_error $? "conditional \"MODULE__TESTLIMITEDCAPI\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${MODULE__TESTINTERNALCAPI_TRUE}" && test -z "${MODULE__TESTINTERNALCAPI_FALSE}"; then
   as_fn_error $? "conditional \"MODULE__TESTINTERNALCAPI\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index 990215b613aef4baffdbd406c8f406b27bbfb549..bf5680e8ac2eddb72a09e67e7490cc1530d8160c 100644 (file)
@@ -6813,6 +6813,7 @@ SRCDIRS="\
   Modules/_sre \
   Modules/_testcapi \
   Modules/_testinternalcapi \
+  Modules/_testlimitedcapi \
   Modules/_xxtestfuzz \
   Modules/cjkcodecs \
   Modules/expat \
@@ -7622,6 +7623,7 @@ PY_STDLIB_MOD([_testcapi],
     [], [], [$LIBATOMIC])
 PY_STDLIB_MOD([_testclinic], [test "$TEST_MODULES" = yes])
 PY_STDLIB_MOD([_testclinic_limited], [test "$TEST_MODULES" = yes])
+PY_STDLIB_MOD([_testlimitedcapi], [test "$TEST_MODULES" = yes])
 PY_STDLIB_MOD([_testinternalcapi], [test "$TEST_MODULES" = yes])
 PY_STDLIB_MOD([_testbuffer], [test "$TEST_MODULES" = yes])
 PY_STDLIB_MOD([_testimportmultiple], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_dlopen" = yes])