Skip to content

Commit 4f9ddf6

Browse files
committed
irtest
1 parent 41a196f commit 4f9ddf6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

mypyc/test-data/irbuild-constant-fold.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ L0:
186186
big5 = r4
187187
return 1
188188

189+
[case testConstantFoldFormatArgs]
190+
# This only tests that the callee and args are constant folded,
191+
# it is not intended to test the result.
192+
from typing import Any, Final
193+
194+
FMT: Final = "{:d} {}"
195+
196+
def f() -> str:
197+
return FMT.format(400 + 20, "roll" + "up")
198+
[out]
199+
def f():
200+
r0, r1, r2, r3 :: str
201+
L0:
202+
r0 = '420'
203+
r1 = ' '
204+
r2 = 'rollup'
205+
r3 = CPyStr_Build(3, r0, r1, r2)
206+
return r3
207+
189208
[case testIntConstantFoldingFinal]
190209
from typing import Final
191210
X: Final = 5

0 commit comments

Comments
 (0)