Add the new test suite.

This test suite has been in use for a long time now, in place of the obsolete and unmanageable testparser.py and testfuncs.py. It verifies the complete optimizer output to stdout and stderr, to ensure that the output matches the expectations.

See unit_tests/README.txt for more info.
This commit is contained in:
Sei Lisa 2019-01-04 20:26:26 +01:00
parent 7fbde0269c
commit 1867dc78e7
547 changed files with 11680 additions and 0 deletions

View file

@ -0,0 +1,9 @@
default{timer(){
integer a = llGetLinkNumber();
integer b = a = a;
a = a = b = b;
llOwnerSay((string)(++b));
}}

View file

@ -0,0 +1,10 @@
default
{
timer()
{
integer a = llGetLinkNumber();
integer b = a;
a = b;
llOwnerSay((string)(++b));
}
}

View file

@ -0,0 +1 @@
main.py - -O -dcr

View file

@ -0,0 +1,12 @@
default{timer(){
integer x = 1;
integer y = x << 31;
integer z = (integer)-0x80000000;
llOwnerSay((string)y);
z += 1;
y += 1;
x += 1;
}}

View file

@ -0,0 +1,13 @@
default
{
timer()
{
integer x = 1;
integer y = x * ((integer)-2147483648);
integer z = ((integer)-2147483648);
llOwnerSay((string)y);
z = -~z;
y = -~y;
x = -~x;
}
}

View file

@ -0,0 +1,10 @@
default{timer(){
integer a = llGetUnixTime();
llBreakLink(a & 3 | a & 5);
llBreakLink((a | 3) & (a | 5));
llBreakLink(a | (a & 5));
llBreakLink(llGetAgentInfo(llGetOwner()) | (llGetAgentInfo(llGetOwner()) & 5));
llBreakLink(llGetAgentInfo(llGetOwner()) & 3 | llGetAgentInfo(llGetOwner()) & 5);
llBreakLink(llGetAgentInfo(llGetOwner()) & 2 && llGetAgentInfo(llGetOwner()) & 4);
}}

View file

@ -0,0 +1,13 @@
default
{
timer()
{
integer a = llGetUnixTime();
llBreakLink(a & 7);
llBreakLink(a | 1);
llBreakLink(a);
llBreakLink(llGetAgentInfo(llGetOwner()));
llBreakLink(llGetAgentInfo(llGetOwner()) & 7);
llBreakLink(!~(llGetAgentInfo(llGetOwner()) | ((integer)-7)));
}
}

View file

@ -0,0 +1,15 @@
default{timer(){
string s = llGetObjectDesc();
key k = llGenerateKey();
integer i = llGetLinkNumber();
if (s == "A" && k != llGenerateKey() && !~llSubStringIndex(s, "B"))
llDie();
/* Chance for a future optimization - this is always false */
if (i == 5 && i == 9 && llGetLinkNumber())
llDie();
if (i != 5 && i != 9 && llGetLinkNumber())
llDie();
if (1 & i == 5 && i == 7 && i == 9 && llGetLinkNumber())
llDie();
}}

View file

@ -0,0 +1,17 @@
default
{
timer()
{
string s = llGetObjectDesc();
key k = llGenerateKey();
integer i = llGetLinkNumber();
if (!((!(s == "A")) | k == llGenerateKey() | (~llSubStringIndex(s, "B"))))
llDie();
if (-!(i ^ 5 | i ^ 9) & llGetLinkNumber())
llDie();
if (-!(i == 5 | i == 9) & llGetLinkNumber())
llDie();
if (-!(i ^ 5 | i ^ 7 | i ^ 9) & llGetLinkNumber())
llDie();
}
}

View file

@ -0,0 +1,10 @@
default{touch(integer n){
if (llSameGroup(llGetOwner()) && llDetectedGroup(0)) llDie();
// TODO
// llGetEnergy() has min=0 and max=1, therefore (integer)llGetEnergy() is bool,
// however we don't yet handle it.
if ((integer)llGetEnergy() && llSameGroup(llGetOwner())) llDie();
}}

View file

@ -0,0 +1,10 @@
default
{
touch(integer n)
{
if (llSameGroup(llGetOwner()) & llDetectedGroup(0))
llDie();
if ((integer)llGetEnergy() & -llSameGroup(llGetOwner()))
llDie();
}
}

View file

@ -0,0 +1,27 @@
//Sei's test break/continue
default
{
state_entry()
{
integer i = 0;
while (i < 10)
{
integer j = 0;
while (j < 10)
{
if (j == 5)
break 2;
if (j == 6)
continue 2;
if (j == 7)
break;
if (j == 8)
continue;
++j;
}
++i;
if (llFrand(5) < 3)
break;
}
}
}

View file

@ -0,0 +1,34 @@
default
{
state_entry()
{
integer i = 0;
{
while (i < 10)
{
integer j = 0;
{
while (j < 10)
{
if (j == 5)
jump J_autoGen00001;
if (j == 6)
jump J_autoGen00002;
if (j == 7)
jump J_autoGen00003;
if (j == 8)
jump J_autoGen00004;
++j;
@J_autoGen00004;
}
@J_autoGen00003;
}
++i;
if (llFrand(5) < 3)
jump J_autoGen00001;
@J_autoGen00002;
}
@J_autoGen00001;
}
}
}

View file

@ -0,0 +1 @@
main.py -O clear,breakcont -

View file

@ -0,0 +1,11 @@
default{timer(){
(integer)1;
(float)2.0;
(string)"abc";
(key)NULL_KEY;
(vector)<1,2,3>;
(rotation)<0,0,1,0>;
(list)[1,2,3,4,5];
}}

View file

@ -0,0 +1,19 @@
default
{
timer()
{
(integer)1;
(float)2.;
(string)"abc";
(key)"00000000-0000-0000-0000-000000000000";
(vector)<1, 2, 3>;
(rotation)<0, 0, 1, 0>;
(list)
[ 1
, 2
, 3
, 4
, 5
];
}
}

View file

@ -0,0 +1 @@
./main.py - -O clear

View file

@ -0,0 +1,3 @@
(vector)-<1,2,3>;
^
(Line 3 char 10): ERROR: Syntax error

View file

@ -0,0 +1,6 @@
default{timer(){
(vector)-<1,2,3>;
}}

View file

@ -0,0 +1 @@
./main.py - -O clear

View file

@ -0,0 +1,3 @@
(list)-[1,2,3,4,5];
^
(Line 3 char 8): ERROR: Syntax error

View file

@ -0,0 +1,6 @@
default{timer(){
(list)-[1,2,3,4,5];
}}

View file

@ -0,0 +1 @@
./main.py - -O clear

View file

@ -0,0 +1,3 @@
(vector)-ZERO_VECTOR;
^
(Line 3 char 10): ERROR: Syntax error

View file

@ -0,0 +1,5 @@
default{timer(){
(vector)-ZERO_VECTOR;
}}

View file

@ -0,0 +1 @@
./main.py - -O clear

View file

@ -0,0 +1,8 @@
default{timer(){
key k;
string s;
s == k;
k == s;
}}

View file

@ -0,0 +1,10 @@
default
{
timer()
{
key k;
string s;
(key)s == k;
(string)k == s;
}
}

View file

@ -0,0 +1 @@
./main.py - -O clear,explicitcast

View file

@ -0,0 +1,14 @@
default{timer(){
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, -1)
+ [3];
// this should produce (key)"3" -> can't be switched to llList2Key
key a = llList2String(L, 0);
// this should produce "" -> can't be switched to llList2String
string b = llList2Key(L, 0);
llParticleSystem([a,b]);
}}

View file

@ -0,0 +1,10 @@
default
{
timer()
{
list L = (list)3;
key a = (key)llList2String(L, 0);
string b = (string)llList2Key(L, 0);
llParticleSystem((list)a + b);
}
}

View file

@ -0,0 +1 @@
main.py -O explicitcast -

View file

@ -0,0 +1,29 @@
default{timer(){
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, 99999)
+ [0.9999997, 0.000111222, 2, 2147483647];
// this returns 1, but llList2Integer returns 0
integer a = (integer)llList2String(L, 0);
// this returns 0.000111, but llList2Float returns 0.000111222
float b = (float)llList2String(L, 1);
// test consistency
string c = (string)llList2String(L, 0);
// this returns (key)"2", but llList2Key returns (key)""
key d = (key)llList2String(L, 2);
// same as above, the typecast is implicit
key e = llList2String(L, 2);
// this returns 0, but llList2Float would return 0.000111222
float f = (float)llList2Integer(L, 1);
// this returns -2147483648, but llList2Integer returns 2147483647
integer g = (integer)llList2Float(L, 3);
llParticleSystem([a,b,c,d,e]);
}}

View file

@ -0,0 +1,13 @@
default
{
timer()
{
list L = llDeleteSubList(llGetPhysicsMaterial(), 0, 99999) + 0.9999997 + 0.000111222 + 2 + 2147483647;
integer a = (integer)llList2String(L, 0);
float b = (float)llList2String(L, 1);
string c = llList2String(L, 0);
key d = (key)llList2String(L, 2);
key e = llList2String(L, 2);
llParticleSystem((list)a + b + c + d + e);
}
}

View file

@ -0,0 +1,6 @@
default{timer(){
integer a;
integer b = a = a = a = 3;
}}

View file

@ -0,0 +1,8 @@
default
{
timer()
{
integer a;
integer b = a = a = a = 3;
}
}

View file

@ -0,0 +1 @@
main.py - -O clear

View file

@ -0,0 +1,16 @@
default{timer(){
// Stable function
if (llGetPermissions() & 2 || llGetPermissions() & 4) llDie();
// Unstable function
if (llGetUsedMemory() & 2 || llGetUsedMemory() & 4) llDie();
// Stable function with typecast
if ((integer)llGetTime() == (integer)llGetTime()) llDie();
if ((integer)llGetTime() != (integer)llGetTime()) llDie();
// Unstable function with typecast
if ((integer)llFrand(2) == (integer)llFrand(2)) llDie();
}}

View file

@ -0,0 +1,13 @@
default
{
timer()
{
if (llGetPermissions() & 6)
llDie();
if (llGetUsedMemory() & 2 | llGetUsedMemory() & 4)
llDie();
llDie();
if ((integer)llFrand(2) == (integer)llFrand(2))
llDie();
}
}

View file

@ -0,0 +1,41 @@
default
{
changed(integer ch)
{
if (llListFindList(llGetPrimitiveParams([PRIM_TYPE]), ["a"]) < 0)
llDie();
if (llSameGroup(llGetOwner()) < -3)
llOwnerSay("a");
if (llSameGroup(llGetOwner()) < -2)
llOwnerSay("b");
if (llSameGroup(llGetOwner()) < -1)
llOwnerSay("c");
if (llSameGroup(llGetOwner()) < 0)
llOwnerSay("d");
if (llSameGroup(llGetOwner()) < 1)
llOwnerSay("e");
if (llSameGroup(llGetOwner()) < 2)
llOwnerSay("f");
if (llSameGroup(llGetOwner()) < 3)
llOwnerSay("g");
if (llSameGroup(llGetOwner()) < 4)
llOwnerSay("h");
if (llSameGroup(llGetOwner()) > -3)
llOwnerSay("A");
if (llSameGroup(llGetOwner()) > -2)
llOwnerSay("B");
if (llSameGroup(llGetOwner()) > -1)
llOwnerSay("C");
if (llSameGroup(llGetOwner()) > 0)
llOwnerSay("D");
if (llSameGroup(llGetOwner()) > 1)
llOwnerSay("E");
if (llSameGroup(llGetOwner()) > 2)
llOwnerSay("F");
if (llSameGroup(llGetOwner()) > 3)
llOwnerSay("G");
if (llSameGroup(llGetOwner()) > 4)
llOwnerSay("H");
}
}

View file

@ -0,0 +1,18 @@
default
{
changed(integer ch)
{
if (~llListFindList(llGetPrimitiveParams((list)9), (list)"a"))
llDie();
if (!llSameGroup(llGetOwner()))
llOwnerSay("e");
llOwnerSay("f");
llOwnerSay("g");
llOwnerSay("h");
llOwnerSay("A");
llOwnerSay("B");
llOwnerSay("C");
if (llSameGroup(llGetOwner()))
llOwnerSay("D");
}
}

View file

@ -0,0 +1,19 @@
default{timer(){
integer a = (integer)llFrand(100);
integer b = (integer)llFrand(100);
llParticleSystem([
!(a - 1),
!(a ^ 1),
!(a != 1),
!(a == 2),
!(a - 3),
!(a + -3),
!(a + 3),
!(a + -b),
!(-a + b),
!(a + b),
-a == -b,
""]);
}}

View file

@ -0,0 +1,22 @@
default
{
timer()
{
integer a = (integer)llFrand(100);
integer b = (integer)llFrand(100);
llParticleSystem(
[ !~-a
, !~-a
, !~-a
, !(a == 2)
, 3 == a
, 3 == a
, ((integer)-3) == a
, a == b
, a == b
, -a == b
, a == b
, ""
]);
}
}

View file

@ -0,0 +1 @@
./main.py - -O -listadd,-dcr

View file

@ -0,0 +1,33 @@
// Functions for which certain parameters produce predictable results.
default
{
timer()
{
llSetPrimitiveParams( // won't be optimized out because it has side effects
[ llFrand(0.0)
, llFrand(-0.0)
, llFrand(1.4e-45)
, llFrand(-1.4e-45)
, llFrand(1.1754942e-38) // denormal - loses 1 bit precision
, llFrand(1e40)
, llFrand(-1e40)
, llFrand(1e40*0)
, llFrand(-1e40*0)
, llCloud(<0,1,2>)
, llAvatarOnLinkSitTarget(256)
, llEdgeOfWorld(<0,1,2>,<0,0,1>)
, llGetAgentInfo(".")
, llGetAgentLanguage("")
, llGetAgentList(3, [])
, llGetAgentSize(NULL_KEY)
, llGetAlpha(9)
, llGetAnimation("0")
, llGetAnimationList("")
, llGetBoundingBox("")
, llGetColor(9)
, llGetDisplayName("")
, llGetEnv("")
, llGetEnv("yadda")
]);
}
}

View file

@ -0,0 +1,32 @@
default
{
timer()
{
llSetPrimitiveParams(
[ 0.
, 0.
, 0.
, -0.
, 0.
, 0.
, 0.
, (1e40*0)
, (-1e40*0)
, 0.
, ((key)"00000000-0000-0000-0000-000000000000")
, 1
, 0
, ""
, ["INVALID_SCOPE"]
, <0., 0., 0.>
, 1.
, ""
, []
, []
, <1., 1., 1.>
, ""
, ""
, ""
]);
}
}

View file

@ -0,0 +1 @@
main.py -O -dcr,addstrings,-optfloats,-listadd -

View file

@ -0,0 +1,46 @@
default
{
timer()
{
if ("") llOwnerSay("\"\"");
if ("a") llOwnerSay("\"a\"");
if ("ab") llOwnerSay("\"ab\"");
if ((key)"") llOwnerSay("(key)\"\"");
if ((key)NULL_KEY) llOwnerSay("(key)NULL_KEY");
if ((key)TEXTURE_BLANK) llOwnerSay("(key)TEXTURE_BLANK");
// check also upper-case key
if ((key)"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF") llOwnerSay("(key)\"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF\"");
if (<0,0,0>) llOwnerSay("<0,0,0>");
if (<1,0,0>) llOwnerSay("<1,0,0>");
if (<1e40*0,1e40*0,1e40*0>) llOwnerSay("<NaN,NaN,NaN>");
if (<0,0,0,1>) llOwnerSay("<0,0,0,1>");
if (<0,0,0,-1>) llOwnerSay("<0,0,0,-1>");
if (<0,0,0,0>) llOwnerSay("<0,0,0,0>");
if (<0,0,1,0>) llOwnerSay("<0,0,1,0>");
if (3) llOwnerSay("3");
if (0) llOwnerSay("0");
if (3.) llOwnerSay("3.");
if (0.) llOwnerSay("0.");
if (1e40) llOwnerSay("inf");
if (1e40*0) llOwnerSay("NaN");
if ([]) llOwnerSay("[]");
if ([""]) llOwnerSay("[\"\"]");
if (["",""]) llOwnerSay("[\"\",\"\"]");
if ((integer)llFrand(1)+1) llOwnerSay("(integer)llFrand(1)+1");
if (llFrand(1)+1) llOwnerSay("llFrand(1)+1");
if ((string)llFrand(1)) llOwnerSay("(string)llFrand(1)");
if ((key)((string)llFrand(1))) llOwnerSay("(key)((string)llFrand(1))");
if (<llFrand(1)+1,0,0>) llOwnerSay("<llFrand(1)+1,0,0>");
if (<llFrand(1)+1,0,0,1>) llOwnerSay("<llFrand(1)+1,0,0,1>");
if ([llFrand(1)]) llOwnerSay("[llFrand(1)]");
do llDie(); while (0);
do llDie(); while (0.);
do llDie(); while ("");
do llDie(); while ((key)"");
do llDie(); while (<0,0,0>);
do llDie(); while ([]);
do llDie(); while (<0,0,0,1>);
do llDie(); while (<0,0,0,-1>);
}
}

View file

@ -0,0 +1,45 @@
default
{
timer()
{
llOwnerSay("\"a\"");
llOwnerSay("\"ab\"");
llOwnerSay("(key)TEXTURE_BLANK");
llOwnerSay("(key)\"ABCDEFAB-ABCD-ABCD-ABCD-ABCDEFABCDEF\"");
llOwnerSay("<1,0,0>");
llOwnerSay("<NaN,NaN,NaN>");
llOwnerSay("<0,0,0,-1>");
llOwnerSay("<0,0,0,0>");
llOwnerSay("<0,0,1,0>");
llOwnerSay("3");
llOwnerSay("3.");
llOwnerSay("inf");
llOwnerSay("NaN");
llOwnerSay("[\"\"]");
llOwnerSay("[\"\",\"\"]");
if (~(integer)llFrand(1))
llOwnerSay("(integer)llFrand(1)+1");
if (!(1 + llFrand(1) == ((float)0)))
llOwnerSay("llFrand(1)+1");
if (!((string)llFrand(1) == ""))
llOwnerSay("(string)llFrand(1)");
if ((key)((string)llFrand(1)))
llOwnerSay("(key)((string)llFrand(1))");
if (!(<1 + llFrand(1), 0, 0> == <((float)0), ((float)0), ((float)0)>))
llOwnerSay("<llFrand(1)+1,0,0>");
if (!(<1 + llFrand(1), 0, 0, 1> == <((float)0), ((float)0), ((float)0), ((float)1)>))
llOwnerSay("<llFrand(1)+1,0,0,1>");
if ((list)llFrand(1) != [])
llOwnerSay("[llFrand(1)]");
llDie();
llDie();
llDie();
llDie();
llDie();
llDie();
llDie();
do
llDie();
while (1);
}
}

View file

@ -0,0 +1,7 @@
default{state_entry(){
integer a = 3;
integer b = a;
integer c = b;
integer d = c;
llOwnerSay("x" + (string)d);
}}

View file

@ -0,0 +1,7 @@
default
{
state_entry()
{
llOwnerSay("x" + "3");
}
}

View file

@ -0,0 +1,80 @@
// Test functions inside and outside a detection event that can be precomputed.
default
{
// non-detection event
state_entry()
{
llSetPrimitiveParams(
[ llDetectedGrab(0)
, llDetectedGroup(0)
, llDetectedKey(0)
, llDetectedLinkNumber(0)
, llDetectedName(0)
, llDetectedOwner(0)
, llDetectedPos(0)
, llDetectedRot(0)
, llDetectedTouchBinormal(0)
, llDetectedTouchFace(0)
, llDetectedTouchNormal(0)
, llDetectedTouchPos(0)
, llDetectedTouchST(0)
, llDetectedTouchUV(0)
, llDetectedType(0)
, llDetectedVel(0)
]);
}
// non-touch event
collision_start(integer n)
{
llSetPrimitiveParams(
[ llDetectedGrab(0)
//, llDetectedGroup(0)
//, llDetectedKey(0)
//, llDetectedLinkNumber(0)
//, llDetectedName(0)
//, llDetectedOwner(0)
//, llDetectedPos(0)
//, llDetectedRot(0)
, llDetectedTouchBinormal(0)
, llDetectedTouchFace(0)
, llDetectedTouchNormal(0)
, llDetectedTouchPos(0)
, llDetectedTouchST(0)
, llDetectedTouchUV(0)
//, llDetectedType(0)
//, llDetectedVel(0)
]);
}
// touch event but not touch()
touch_start(integer n)
{
llSetPrimitiveParams(
[ llDetectedGrab(0) // only works in touch()
, llDetectedGrab(-1) // only works in touch()
, llDetectedGroup(16)
, llDetectedKey(-1)
, llDetectedLinkNumber(17)
, llDetectedName(-1)
, llDetectedOwner(32)
, llDetectedPos(-1)
, llDetectedRot(-1)
, llDetectedTouchBinormal(-1)
, llDetectedTouchFace(-1)
, llDetectedTouchNormal(-1)
, llDetectedTouchPos(-1)
, llDetectedTouchST(-1)
, llDetectedTouchUV(-1)
, llDetectedType(-1)
, llDetectedVel(-1)
]);
}
touch(integer n)
{
llSetPrimitiveParams(
[ llDetectedGrab(-1)
]);
}
}

View file

@ -0,0 +1,65 @@
default
{
state_entry()
{
llSetPrimitiveParams(
[ <0., 0., 0.>
, 0
, ((key)"00000000-0000-0000-0000-000000000000")
, 0
, "00000000-0000-0000-0000-000000000000"
, ((key)"00000000-0000-0000-0000-000000000000")
, <0., 0., 0.>
, <0., 0., 0., 1.>
, <0., 0., 0.>
, 0
, <0., 0., 0.>
, <0., 0., 0.>
, <0., 0., 0.>
, <0., 0., 0.>
, 0
, <0., 0., 0.>
]);
}
collision_start(integer n)
{
llSetPrimitiveParams(
[ <0., 0., 0.>
, <0., 0., 0.>
, -1
, <0., 0., 0.>
, <0., 0., 0.>
, <-1., -1., 0.>
, <-1., -1., 0.>
]);
}
touch_start(integer n)
{
llSetPrimitiveParams(
[ <0., 0., 0.>
, <0., 0., 0.>
, 0
, ((key)"00000000-0000-0000-0000-000000000000")
, 0
, "00000000-0000-0000-0000-000000000000"
, ((key)"00000000-0000-0000-0000-000000000000")
, <0., 0., 0.>
, <0., 0., 0., 1.>
, <0., 0., 0.>
, 0
, <0., 0., 0.>
, <0., 0., 0.>
, <0., 0., 0.>
, <0., 0., 0.>
, 0
, <0., 0., 0.>
]);
}
touch(integer n)
{
llSetPrimitiveParams((list)<0., 0., 0.>);
}
}

View file

@ -0,0 +1 @@
main.py -O -dcr,addstrings,-optfloats,-optsigns,-listadd -

View file

@ -0,0 +1,25 @@
// Test functions in a detection event that can't be precomputed.
default
{
touch(integer n)
{
llSetPrimitiveParams(
[ llDetectedGrab(0)
, llDetectedGroup(0)
, llDetectedKey(0)
, llDetectedLinkNumber(0)
, llDetectedName(0)
, llDetectedOwner(0)
, llDetectedPos(0)
, llDetectedRot(0)
, llDetectedTouchBinormal(0)
, llDetectedTouchFace(0)
, llDetectedTouchNormal(0)
, llDetectedTouchPos(0)
, llDetectedTouchST(0)
, llDetectedTouchUV(0)
, llDetectedType(0)
, llDetectedVel(0)
]);
}
}

View file

@ -0,0 +1,24 @@
default
{
touch(integer n)
{
llSetPrimitiveParams(
[ llDetectedGrab(0)
, llDetectedGroup(0)
, llDetectedKey(0)
, llDetectedLinkNumber(0)
, llDetectedName(0)
, llDetectedOwner(0)
, llDetectedPos(0)
, llDetectedRot(0)
, llDetectedTouchBinormal(0)
, llDetectedTouchFace(0)
, llDetectedTouchNormal(0)
, llDetectedTouchPos(0)
, llDetectedTouchST(0)
, llDetectedTouchUV(0)
, llDetectedType(0)
, llDetectedVel(0)
]);
}
}

View file

@ -0,0 +1 @@
main.py -O -dcr,addstrings,-optfloats,-listadd -

View file

@ -0,0 +1,20 @@
default
{
state_entry()
{
string a = llGetObjectName();
vector b = llGetPos();
float c = llGetMass();
llOwnerSay(llDumpList2String([a, b, c], "/"));
llOwnerSay(llDumpList2String([], llGetObjectName()));
llOwnerSay(llDumpList2String([1,2,3], a));
llOwnerSay(llDumpList2String([llGetObjectName()], a));
llOwnerSay(llDumpList2String([llGetObjectName(), llGetObjectName(), llGetObjectName()], a));
llOwnerSay(llDumpList2String([a, b, c, llGetObjectName()], a));
// TODO: This isn't properly optimized because the lists can't be merged:
llOwnerSay(llDumpList2String([a] + [b, c, a + a + a], a));
llOwnerSay(llDumpList2String([a, b, c, a + a + a], a));
llOwnerSay(llDumpList2String([llSetRegionPos(<1,1,1>)], a));
llOwnerSay(llDumpList2String([llSetRegionPos(<1,1,1>)], (string)llSetRegionPos(<1,1,1>)));
}
}

View file

@ -0,0 +1,19 @@
default
{
state_entry()
{
string a = llGetObjectName();
vector b = llGetPos();
float c = llGetMass();
llOwnerSay(a + ("/" + ((string)((list)b) + ("/" + (string)c))));
llOwnerSay("");
llOwnerSay("1" + (a + ("2" + (a + "3"))));
llOwnerSay(llGetObjectName());
llOwnerSay(llGetObjectName() + (a + (llGetObjectName() + (a + llGetObjectName()))));
llOwnerSay(a + (a + ((string)((list)b) + (a + ((string)c + (a + llGetObjectName()))))));
llOwnerSay(llDumpList2String(a + ((list)b + c + (a + a + a)), a));
llOwnerSay(a + (a + ((string)((list)b) + (a + ((string)c + (a + (a + a + a)))))));
llOwnerSay((string)llSetRegionPos(<((float)1), ((float)1), ((float)1)>));
llOwnerSay(llDumpList2String((list)llSetRegionPos(<((float)1), ((float)1), ((float)1)>), (string)llSetRegionPos(<((float)1), ((float)1), ((float)1)>)));
}
}

View file

@ -0,0 +1,3 @@
@x;
^
(Line 3 char 4): ERROR: Name previously declared within scope

View file

@ -0,0 +1,4 @@
default{timer(){
integer x;
@x;
}}

View file

@ -0,0 +1,3 @@
x()
^
(Line 2 char 2): ERROR: Name previously declared within scope

View file

@ -0,0 +1,6 @@
integer x;
x()
{
}
default{timer(){}}

View file

@ -0,0 +1,3 @@
llDie()
^
(Line 1 char 6): ERROR: Name previously declared within scope

View file

@ -0,0 +1,5 @@
llDie()
{
}
default{timer(){}}

View file

@ -0,0 +1,3 @@
integer llDie;
^
(Line 1 char 14): ERROR: Name previously declared within scope

View file

@ -0,0 +1,3 @@
integer llDie;
default{timer(){}}

View file

@ -0,0 +1,3 @@
state x
^
(Line 3 char 7): ERROR: Name previously declared within scope

View file

@ -0,0 +1,4 @@
integer x;
default{timer(){}}
state x
{timer(){}}

View file

@ -0,0 +1,3 @@
state x
^
(Line 3 char 7): ERROR: Name previously declared within scope

View file

@ -0,0 +1,4 @@
x(){}
default{timer(){}}
state x
{timer(){}}

View file

@ -0,0 +1,3 @@
^
(Line 1 char 1): ERROR: Unexpected EOF

View file

View file

@ -0,0 +1,9 @@
default
{
state_entry()
{
key k = llList2String(llGetAgentList(AGENT_LIST_REGION, []), 0);
float f = llGetAgentInfo(llGetOwner());
llOwnerSay((string)[k, f]);
}
}

View file

@ -0,0 +1,9 @@
default
{
state_entry()
{
key k = (key)llList2String(llGetAgentList(4, []), 0);
float f = (float)llGetAgentInfo(llGetOwner());
llOwnerSay((string)[k, f]);
}
}

View file

@ -0,0 +1 @@
main.py -O explicitcast,-optimize -

View file

@ -0,0 +1,3 @@
-[1,2,3,4,5];
^
(Line 3 char 13): ERROR: Type mismatch

View file

@ -0,0 +1,5 @@
default{timer(){
-[1,2,3,4,5];
}}

View file

@ -0,0 +1 @@
./main.py - -O clear

View file

@ -0,0 +1,12 @@
default{timer(){
while (1)
{
jump bis;
}
@bis;
llDie();
}}

View file

@ -0,0 +1,12 @@
default
{
timer()
{
while (1)
{
jump bis;
}
@bis;
llDie();
}
}

View file

@ -0,0 +1,10 @@
default{touch(integer llList2Float){
integer llList2String = llGetNumberOfPrims();
rotation q = <llList2Float, llList2String, llList2Float, llList2String>;
list L = llGetPhysicsMaterial();
llParticleSystem([llList2Float(L, 0), llList2String(L, 1), q]);
}}

View file

@ -0,0 +1,10 @@
default
{
touch(integer llList2Float)
{
integer llList2String = llGetNumberOfPrims();
rotation q = <llList2Float, llList2String, llList2Float, llList2String>;
list L = llGetPhysicsMaterial();
llParticleSystem((list)llList2Float(L, 0) + llList2String(L, 1) + q);
}
}

View file

@ -0,0 +1,3 @@
integer y = x;
^
(Line 3 char 13): ERROR: Name not defined within scope

View file

@ -0,0 +1,5 @@
integer x(){return 0;}
integer y = x;
default{timer(){}}

View file

@ -0,0 +1,4 @@
integer a = llList2Integer;
rotation q = <llList2Float, llList2Float, llList2Float, llList2Float>;
default{timer(){}}

View file

@ -0,0 +1,9 @@
integer a = llList2Integer;
rotation q = <llList2Float, llList2Float, llList2Float, llList2Float>;
default
{
timer()
{
}
}

View file

@ -0,0 +1 @@
main.py -O clear -

View file

@ -0,0 +1,3 @@
integer a = llList2String;
^
(Line 1 char 26): ERROR: Type mismatch

View file

@ -0,0 +1,3 @@
integer a = llList2String;
default{timer(){}}

View file

@ -0,0 +1,3 @@
integer a = (integer)llList2Integer;
^
(Line 4 char 22): ERROR: Name not defined within scope

View file

@ -0,0 +1,6 @@
default{timer(){
integer a = (integer)llList2Integer;
}}

View file

@ -0,0 +1,7 @@
default
{
state_entry()
{
llSensor("", "", AGENT, 10., PI);
}
}

View file

@ -0,0 +1,7 @@
default
{
state_entry()
{
llSensor("", "", 1, ((float)10), ((float)4));
}
}

View file

@ -0,0 +1,7 @@
// Check constant folding of global lists
// Exposed ConstFold+DCR+ExtendedGlobalExpr bug, related to Issue #3.
key k = TEXTURE_BLANK;
list L = [k,""];
default{timer(){
llBreakLink(llListFindList(L, (list)k));
}}

View file

@ -0,0 +1,10 @@
key k = "5748decc-f629-461c-9a36-a35a221fe21f";
list L = [k, ""];
default
{
timer()
{
llBreakLink(llListFindList(L, (list)k));
}
}

View file

@ -0,0 +1 @@
main.py -O clear,optimize,constfold,dcr,extendedglobalexpr -

View file

@ -0,0 +1,7 @@
// Check constant folding of global lists
// Exposed ConstFold+DCR+ExtendedGlobalExpr bug, Issue #3.
key k = TEXTURE_BLANK;
list L = [k,""];
default{timer(){
L += "";
}}

View file

@ -0,0 +1,10 @@
key k = "5748decc-f629-461c-9a36-a35a221fe21f";
list L = [k, ""];
default
{
timer()
{
L = L + "";
}
}

View file

@ -0,0 +1,6 @@
key k;
list L = [k];
default{timer(){
L += "";
llSetPrimitiveParams(L);
}}

Some files were not shown because too many files have changed in this diff Show more