Skip to content

Commit 8e97165

Browse files
committed
add ir test
1 parent 85652a2 commit 8e97165

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mypyc/test-data/irbuild-int.test

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,22 @@ L0:
214214
[case testIntToBytes]
215215
def f(x: int) -> bytes:
216216
return x.to_bytes(2, "big")
217+
def g(x: int) -> bytes:
218+
return x.to_bytes(4, "little", True)
217219
[out]
218220
def f(x):
219221
x :: int
220222
r0 :: str
221223
r1 :: bytes
222224
L0:
223225
r0 = 'big'
224-
r1 = CPyTagged_ToBytes(x, 4, r1, 0)
225-
return r0
226+
r1 = CPyTagged_ToBytes(x, 4, r0, 0)
227+
return r1
228+
def g(x):
229+
x :: int
230+
r0 :: str
231+
r1 :: bytes
232+
L0:
233+
r0 = 'little'
234+
r1 = CPyTagged_ToBytes(x, 8, r0, 1)
235+
return r1

0 commit comments

Comments
 (0)