Skip to content

Commit

Permalink
[3.13] GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550
Browse files Browse the repository at this point in the history
…) (#130572)

GH-130396: Treat clang -Og as optimized for gdb tests (GH-130550)
(cherry picked from commit 129db32)

Co-authored-by: Mark Shannon <[email protected]>
  • Loading branch information
miss-islington and markshannon authored Feb 26, 2025
1 parent 2ab7e11 commit 43a2a37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,15 +833,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

0 comments on commit 43a2a37

Please sign in to comment.