Skip to content

Commit 909fe79

Browse files
committed
Treat clang -Og as optimized for gdb tests
1 parent fa6a814 commit 909fe79

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/support/__init__.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -835,15 +835,18 @@ def gc_threshold(*args):
835835
finally:
836836
gc.set_threshold(*old_threshold)
837837

838-
839838
def python_is_optimized():
840839
"""Find if Python was built with optimizations."""
841840
cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
842841
final_opt = ""
843842
for opt in cflags.split():
844843
if opt.startswith('-O'):
845844
final_opt = opt
846-
return final_opt not in ('', '-O0', '-Og')
845+
if sysconfig.get_config_var("CC") == "gcc":
846+
non_opts = ('', '-O0', '-Og')
847+
else:
848+
non_opts = ('', '-O0')
849+
return final_opt not in non_opts
847850

848851

849852
def check_cflags_pgo():

0 commit comments

Comments
 (0)