File tree 1 file changed +34
-1
lines changed
1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -1731,7 +1731,7 @@ def f5():
1731
1731
L0:
1732
1732
return 4
1733
1733
1734
- [case testI64Cast ]
1734
+ [case testI64Cast_64bit ]
1735
1735
from typing import cast
1736
1736
from mypy_extensions import i64
1737
1737
@@ -1772,6 +1772,39 @@ L2:
1772
1772
L3:
1773
1773
return r3
1774
1774
1775
+ [case testI64Cast_32bit]
1776
+ from typing import cast
1777
+ from mypy_extensions import i64
1778
+
1779
+ def cast_int(x: int) -> i64:
1780
+ return cast(i64, x)
1781
+ [out]
1782
+ def cast_int(x):
1783
+ x :: int
1784
+ r0 :: native_int
1785
+ r1 :: bit
1786
+ r2, r3, r4 :: int64
1787
+ r5 :: ptr
1788
+ r6 :: c_ptr
1789
+ r7 :: int64
1790
+ L0:
1791
+ r0 = x & 1
1792
+ r1 = r0 == 0
1793
+ if r1 goto L1 else goto L2 :: bool
1794
+ L1:
1795
+ r2 = extend signed x: builtins.int to int64
1796
+ r3 = r2 >> 1
1797
+ r4 = r3
1798
+ goto L3
1799
+ L2:
1800
+ r5 = x ^ 1
1801
+ r6 = r5
1802
+ r7 = CPyLong_AsInt64(r6)
1803
+ r4 = r7
1804
+ keep_alive x
1805
+ L3:
1806
+ return r4
1807
+
1775
1808
[case testI64ExplicitConversionFromVariousTypes]
1776
1809
from mypy_extensions import i64
1777
1810
You can’t perform that action at this time.
0 commit comments