Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Treat clang -Og as optimized for gdb tests
  • Loading branch information
markshannon committed Feb 25, 2025
commit 909fe792fe0963b563cbc3fb08239d2b42702adc
7 changes: 5 additions & 2 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,18 @@ def gc_threshold(*args):
finally:
gc.set_threshold(*old_threshold)


def python_is_optimized():
"""Find if Python was built with optimizations."""
cflags = sysconfig.get_config_var('PY_CFLAGS') or ''
final_opt = ""
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():
Expand Down