8000 GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550) · python/cpython@129db32 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 129db32

Browse files
authored
GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)
1 parent 263d56e commit 129db32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 5 additions & 2 deletions
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)
0