@@ -2455,7 +2455,7 @@ def testfunc(x):
2455
2455
opt = _testinternalcapi .get_uop_optimizer ()
2456
2456
2457
2457
with temporary_optimizer (opt ):
2458
- testfunc (10 )
2458
+ testfunc (20 )
2459
2459
2460
2460
ex = get_first_executor (testfunc )
2461
2461
self .assertIsNotNone (ex )
@@ -2470,7 +2470,7 @@ def testfunc(n):
2470
2470
2471
2471
opt = _testinternalcapi .get_uop_optimizer ()
2472
2472
with temporary_optimizer (opt ):
2473
- testfunc (10 )
2473
+ testfunc (20 )
2474
2474
2475
2475
ex = get_first_executor (testfunc )
2476
2476
self .assertIsNotNone (ex )
@@ -2485,7 +2485,7 @@ def testfunc(a):
2485
2485
2486
2486
opt = _testinternalcapi .get_uop_optimizer ()
2487
2487
with temporary_optimizer (opt ):
2488
- testfunc (range (10 ))
2488
+ testfunc (range (20 ))
2489
2489
2490
2490
ex = get_first_executor (testfunc )
2491
2491
self .assertIsNotNone (ex )
@@ -2495,12 +2495,13 @@ def testfunc(a):
2495
2495
def test_pop_jump_if_not_none (self ):
2496
2496
def testfunc (a ):
2497
2497
for x in a :
2498
+ x = None
2498
2499
if x is not None :
2499
2500
x = 0
2500
2501
2501
2502
opt = _testinternalcapi .get_uop_optimizer ()
2502
2503
with temporary_optimizer (opt ):
2503
- testfunc (range (10 ))
2504
+ testfunc (range (20 ))
2504
2505
2505
2506
ex = get_first_executor (testfunc )
2506
2507
self .assertIsNotNone (ex )
@@ -2515,7 +2516,7 @@ def testfunc(n):
2515
2516
2516
2517
opt = _testinternalcapi .get_uop_optimizer ()
2517
2518
with temporary_optimizer (opt ):
2518
- testfunc (10 )
2519
+ testfunc (20 )
2519
2520
2520
2521
ex = get_first_executor (testfunc )
2521
2522
self .assertIsNotNone (ex )
@@ -2530,7 +2531,7 @@ def testfunc(n):
2530
2531
2531
2532
opt = _testinternalcapi .get_uop_optimizer ()
2532
2533
with temporary_optimizer (opt ):
2533
- testfunc (10 )
2534
+ testfunc (20 )
2534
2535
2535
2536
ex = get_first_executor (testfunc )
2536
2537
self .assertIsNotNone (ex )
@@ -2550,7 +2551,7 @@ def testfunc(n):
2550
2551
2551
2552
opt = _testinternalcapi .get_uop_optimizer ()
2552
2553
with temporary_optimizer (opt ):
2553
- testfunc (10 )
2554
+ testfunc (20 )
2554
2555
2555
2556
ex = get_first_executor (testfunc )
2556
2557
self .assertIsNotNone (ex )
@@ -2568,8 +2569,8 @@ def testfunc(n):
2568
2569
2569
2570
opt = _testinternalcapi .get_uop_optimizer ()
2570
2571
with temporary_optimizer (opt ):
2571
- total = testfunc (10 )
2572
- self .assertEqual (total , 45 )
2572
+ total = testfunc (20 )
2573
+ self .assertEqual (total , 190 )
2573
2574
2574
2575
ex = get_first_executor (testfunc )
2575
2576
self .assertIsNotNone (ex )
@@ -2589,9 +2590,9 @@ def testfunc(a):
2589
2590
2590
2591
opt = _testinternalcapi .get_uop_optimizer ()
2591
2592
with temporary_optimizer (opt ):
2592
- a = list (range (10 ))
2593
+ a = list (range (20 ))
2593
2594
total = testfunc (a )
2594
- self .assertEqual (total , 45 )
2595
+ self .assertEqual (total , 190 )
2595
2596
2596
2597
ex = get_first_executor (testfunc )
2597
2598
self .assertIsNotNone (ex )
@@ -2611,9 +2612,9 @@ def testfunc(a):
2611
2612
2612
2613
opt = _testinternalcapi .get_uop_optimizer ()
2613
2614
with temporary_optimizer (opt ):
2614
- a = tuple (range (10 ))
2615
+ a = tuple (range (20 ))
2615
2616
total = testfunc (a )
2616
- self .assertEqual (total , 45 )
2617
+ self .assertEqual (total , 190 )
2617
2618
2618
2619
ex = get_first_executor (testfunc )
2619
2620
self .assertIsNotNone (ex )
@@ -2647,7 +2648,7 @@ def dummy(x):
2647
2648
2648
2649
opt = _testinternalcapi .get_uop_optimizer ()
2649
2650
with temporary_optimizer (opt ):
2650
- testfunc (10 )
2651
+ testfunc (20 )
2651
2652
2652
2653
ex = get_first_executor (testfunc )
2653
2654
self .assertIsNotNone (ex )
@@ -2656,6 +2657,5 @@ def dummy(x):
2656
2657
self .assertIn ("_BINARY_OP_ADD_INT" , uops )
2657
2658
2658
2659
2659
-
2660
2660
if __name__ == "__main__" :
2661
2661
unittest .main ()
0 commit comments