]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) (GH-130573...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 27 Feb 2025 12:43:48 +0000 (13:43 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Feb 2025 12:43:48 +0000 (12:43 +0000)
Lib/test/support/__init__.py

index 059542c24335a2864aa9b1fedc2172c948c98c82..26cd880d2278553930f46f7da8a5d963e8043d5e 100644 (file)
@@ -768,7 +768,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():