summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_list.py8
-rw-r--r--Lib/test/test_tuple.py8
2 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index d7e6629..84b8afe 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -70,6 +70,14 @@ class ListTest(list_tests.CommonTest):
check(1000000)
+ def test_no_comdat_folding(self):
+ # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
+ # optimization causes failures in code that relies on distinct
+ # function addresses.
+ class L(list): pass
+ with self.assertRaises(TypeError):
+ (3,) + L([1,2])
+
def test_main(verbose=None):
support.run_unittest(ListTest)
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index 1464a0e..6e934fb 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -164,6 +164,14 @@ class TupleTest(seq_tests.CommonTest):
check(10) # check our checking code
check(1000000)
+ def test_no_comdat_folding(self):
+ # Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
+ # optimization causes failures in code that relies on distinct
+ # function addresses.
+ class T(tuple): pass
+ with self.assertRaises(TypeError):
+ [3,] + T((1,2))
+
def test_main():
support.run_unittest(TupleTest)