File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1648,6 +1648,23 @@ def testfunc(n):
16481648 self .assertNotIn ("_COMPARE_OP_STR" , uops )
16491649 self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
16501650
1651+ def test_compare_op_float_pop_two_load_const_inline_borrow (self ):
1652+ def testfunc (n ):
1653+ x = 0
1654+ for _ in range (n ):
1655+ a = 1.0
1656+ b = 1.0
1657+ if a == b :
1658+ x += 1
1659+ return x
1660+
1661+ res , ex = self ._run_with_optimizer (testfunc , TIER2_THRESHOLD )
1662+ self .assertEqual (res , TIER2_THRESHOLD )
1663+ self .assertIsNotNone (ex )
1664+ uops = get_opnames (ex )
1665+ self .assertNotIn ("_COMPARE_OP_FLOAT" , uops )
1666+ self .assertNotIn ("_POP_TWO_LOAD_CONST_INLINE_BORROW" , uops )
1667+
16511668 def test_to_bool_bool_contains_op_set (self ):
16521669 """
16531670 Test that _TO_BOOL_BOOL is removed from code like:
Original file line number Diff line number Diff line change 2828#include "pycore_range.h"
2929#include "pycore_unicodeobject.h"
3030#include "pycore_ceval.h"
31+ #include "pycore_floatobject.h"
3132
3233#include <stdarg.h>
3334#include <stdbool.h>
You can’t perform that action at this time.
0 commit comments