Daniel Sun created GROOVY-12806:
-----------------------------------

             Summary: SC: postfix ++ and -- on a local int still do not emit 
IINC
                 Key: GROOVY-12806
                 URL: https://issues.apache.org/jira/browse/GROOVY-12806
             Project: Groovy
          Issue Type: Improvement
          Components: Static compilation
            Reporter: Daniel Sun


org.codehaus.groovy.classgen.asm.sc.StaticCompilationTest#testPlusPlus and 
#testMinusMinus in 
src/test/groovy/org/codehaus/groovy/classgen/asm/sc/StaticCompilationTest.groovy
 are @Disabled with no message. Under @CompileStatic,

  void m(int i) { i++ }

and i-- are expected to compile to a bytecode sequence containing IINC. 
Neighbouring tests for << and += already pass.

This is an optimization (the programs are still correct); the tests document an 
expected instruction that is not yet emitted. Related closed work on peephole 
compaction (GROOVY-12162) does not mention IINC.

Scanned SHA: ca71425976fd2e3da6db9634955ba0d39550a6d4 (apache/groovy master).

Acceptance criterion: Both tests' hasStrictSequence(['IINC']) assertions pass, 
and @Disabled is removed.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to