[3.12] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) (#130573)

GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)

(cherry picked from commit 129db32d6f)

Co-authored-by: Mark Shannon <mark@hotpy.org>
This commit is contained in:
Victor Stinner 2025-02-26 12:38:21 +01:00 committed by GitHub
parent 7575abb9d9
commit c4aeb4c444
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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():