Skip to content

Commit c4aeb4c

Browse files
[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 129db32) Co-authored-by: Mark Shannon <mark@hotpy.org>
1 parent 7575abb commit c4aeb4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/support/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,11 @@ def python_is_optimized():
799799
for opt in cflags.split():
800800
if opt.startswith('-O'):
801801
final_opt = opt
802-
return final_opt not in ('', '-O0', '-Og')
802+
if sysconfig.get_config_var("CC") == "gcc":
803+
non_opts = ('', '-O0', '-Og')
804+
else:
805+
non_opts = ('', '-O0')
806+
return final_opt not in non_opts
803807

804808

805809
def check_cflags_pgo():

0 commit comments

Comments
 (0)