mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add string length constant folding test
This commit is contained in:
parent
d35c4e7b7d
commit
67b9e834fa
1 changed files with 11 additions and 0 deletions
|
@ -1168,6 +1168,17 @@ RETURN R0 1
|
||||||
)");
|
)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("ConstantFoldStringLen")
|
||||||
|
{
|
||||||
|
CHECK_EQ("\n" + compileFunction0("return #'string', #'', #'a', #('b')"), R"(
|
||||||
|
LOADN R0 6
|
||||||
|
LOADN R1 0
|
||||||
|
LOADN R2 1
|
||||||
|
LOADN R3 1
|
||||||
|
RETURN R0 4
|
||||||
|
)");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("ConstantFoldCompare")
|
TEST_CASE("ConstantFoldCompare")
|
||||||
{
|
{
|
||||||
// ordered comparisons
|
// ordered comparisons
|
||||||
|
|
Loading…
Add table
Reference in a new issue