File tree Expand file tree Collapse file tree
de.peeeq.wurstscript/src/test/java/tests/wurstscript/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2048,8 +2048,12 @@ public void tinyMonomorphicMethodsInlineOnLua() {
20482048 String body = topLevelFunctionBodyWithPrefix (compiled , "hotLoop" );
20492049 assertFalse ("a tiny method with exactly one implementation must inline in optimized Lua:\n " + body ,
20502050 body .contains ("Accumulator_add(" ));
2051- assertTrue ("the inlined method must retain its field read:\n " + body ,
2052- body .contains ("Accumulator_offset_storage[" ));
2051+ java .util .regex .Matcher offsetAlias = java .util .regex .Pattern
2052+ .compile ("local (\\ w+) = Accumulator_offset_storage" ).matcher (body );
2053+ assertTrue ("the inlined method's field storage must be localized:\n " + body ,
2054+ offsetAlias .find ());
2055+ assertTrue ("the inlined method must retain its field read through the local alias:\n " + body ,
2056+ body .contains (offsetAlias .group (1 ) + "[" ));
20532057 String dynamicBody = topLevelFunctionBodyWithPrefix (compiled , "dynamicCall" );
20542058 assertTrue ("a genuinely virtual method call must retain dispatch:\n " + dynamicBody ,
20552059 dynamicBody .contains ("dispatch_" ));
You can’t perform that action at this time.
0 commit comments