]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) (#130573)
authorVictor Stinner <vstinner@python.org>
Wed, 26 Feb 2025 11:38:21 +0000 (12:38 +0100)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 11:38:21 +0000 (12:38 +0100)
GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)

(cherry picked from commit 129db32d6f2d7f450d2741da6a222c18e458c61b)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Lib/test/support/__init__.py

index ba57eb307c0b8f7071be45185267c0ee38035f50..c8993476240de1ee73683687ce12dc832c14117e 100644 (file)
@@ -799,7 +799,11 @@ def python_is_optimized():
     for opt in cflags.split():
         if opt.startswith('-O'):
             final_opt = opt
-    return final_opt not in ('', '-O0', '-Og')
+    if sysconfig.get_config_var("CC") == "gcc":
+        non_opts = ('', '-O0', '-Og')
+    else:
+        non_opts = ('', '-O0')
+    return final_opt not in non_opts
 
 
 def check_cflags_pgo():