From 4eceb95409e844fdc33c9c706e1dc307bfd40303 Mon Sep 17 00:00:00 2001 From: Yohann Roussel Date: Wed, 19 Mar 2014 16:25:37 +0100 Subject: Initial Jack import. Change-Id: I953cf0a520195a7187d791b2885848ad0d5a9b43 --- .../dfa/reachingdefs/test001/jack/Dfa001.java | 40 + .../android/jack/annotation/test001/dx/Tests.java | 238 ++ .../jack/annotation/test001/jack/Annotated1.java | 80 + .../jack/annotation/test001/jack/Annotated2.java | 21 + .../jack/annotation/test001/jack/Annotated3.java | 21 + .../jack/annotation/test001/jack/Annotated4.java | 21 + .../jack/annotation/test001/jack/Annotated5.java | 21 + .../jack/annotation/test001/jack/Annotation1.java | 25 + .../jack/annotation/test001/jack/Annotation10.java | 27 + .../jack/annotation/test001/jack/Annotation11.java | 25 + .../jack/annotation/test001/jack/Annotation12.java | 25 + .../jack/annotation/test001/jack/Annotation13.java | 28 + .../jack/annotation/test001/jack/Annotation14.java | 28 + .../jack/annotation/test001/jack/Annotation2.java | 26 + .../jack/annotation/test001/jack/Annotation3.java | 27 + .../jack/annotation/test001/jack/Annotation4.java | 25 + .../jack/annotation/test001/jack/Annotation5.java | 25 + .../jack/annotation/test001/jack/Annotation6.java | 27 + .../jack/annotation/test001/jack/Annotation7.java | 25 + .../jack/annotation/test001/jack/Annotation8.java | 25 + .../jack/annotation/test001/jack/Annotation9.java | 25 + .../jack/annotation/test001/jack/Constants.java | 26 + .../jack/annotation/test001/jack/OneEnum.java | 22 + .../android/jack/annotation/test002/dx/Tests.java | 38 + .../jack/annotation/test002/jack/Annotated.java | 26 + .../android/jack/annotation/test003/dx/Tests.java | 33 + .../jack/annotation/test003/jack/Target.java | 24 + .../android/jack/annotation/test004/jack/Data.java | 31 + .../android/jack/annotation/test005/dx/Tests.java | 62 + .../annotation/test005/dx/empty/package-info.java | 3 + .../jack/annotation/test005/dx/sub/Dummy.java | 21 + .../annotation/test005/dx/sub/package-info.java | 3 + .../annotation/test005/jack/PackageAnnotation.java | 28 + .../test005/jack/empty/package-info.java | 3 + .../jack/annotation/test005/jack/sub/Dummy.java | 21 + .../annotation/test005/jack/sub/package-info.java | 3 + .../android/jack/annotation/test006/dx/Tests.java | 328 ++ .../test006/jack/ReflectAnnotationsTest.java | 42 + .../test006/jack/ReflectAnnotationsTest2.java | 58 + .../jack/annotation/test006/jack/SuperClass.java | 20 + .../annotation/test006/jack/SuperInterface1.java | 21 + .../annotation/test006/jack/SuperInterface2.java | 21 + .../android/jack/annotation/test007/dx/Tests.java | 39 + .../jack/annotation/test007/jack/Thrower.java | 23 + .../android/jack/annotation/test008/dx/Ref008.java | 27 + .../android/jack/annotation/test008/dx/Tests.java | 53 + .../annotation/test008/jack/Annotation008.java | 27 + .../annotation/test009/dx/Annotation009Ref.java | 69 + .../android/jack/annotation/test009/dx/Tests.java | 61 + .../annotation/test009/jack/Annotation009.java | 69 + .../android/jack/arithmetic/test001/dx/Tests.java | 61 + .../android/jack/arithmetic/test001/jack/Add.java | 76 + .../android/jack/arithmetic/test001/jack/And.java | 28 + .../android/jack/arithmetic/test001/jack/Div.java | 28 + .../android/jack/arithmetic/test001/jack/Mod.java | 28 + .../android/jack/arithmetic/test001/jack/Mul.java | 28 + .../android/jack/arithmetic/test001/jack/Or.java | 28 + .../android/jack/arithmetic/test001/jack/Shl.java | 28 + .../android/jack/arithmetic/test001/jack/Shr.java | 28 + .../android/jack/arithmetic/test001/jack/Sub.java | 28 + .../android/jack/arithmetic/test001/jack/Ushr.java | 28 + .../android/jack/arithmetic/test001/jack/Xor.java | 28 + .../android/jack/arithmetic/test002/dx/Tests.java | 63 + .../android/jack/arithmetic/test002/jack/Add.java | 28 + .../android/jack/arithmetic/test002/jack/And.java | 35 + .../android/jack/arithmetic/test002/jack/Div.java | 29 + .../android/jack/arithmetic/test002/jack/Mod.java | 29 + .../android/jack/arithmetic/test002/jack/Mul.java | 29 + .../android/jack/arithmetic/test002/jack/Or.java | 36 + .../android/jack/arithmetic/test002/jack/Shl.java | 29 + .../android/jack/arithmetic/test002/jack/Shr.java | 29 + .../android/jack/arithmetic/test002/jack/Sub.java | 29 + .../android/jack/arithmetic/test002/jack/Ushr.java | 29 + .../android/jack/arithmetic/test002/jack/Xor.java | 35 + .../android/jack/arithmetic/test003/dx/Tests.java | 85 + .../jack/arithmetic/test003/jack/ZeroUsage.java | 55 + .../com/android/jack/array/test001/dx/Tests.java | 46 + .../android/jack/array/test001/jack/ArrayTest.java | 35 + .../android/jack/assertion/test001/dx/Tests.java | 89 + .../android/jack/assertion/test001/jack/Data.java | 36 + .../android/jack/assertion/test002/dx/Tests.java | 40 + .../android/jack/assertion/test002/jack/Data.java | 26 + .../android/jack/assertion/test003/dx/Tests.java | 72 + .../android/jack/assertion/test003/jack/Data.java | 25 + .../tests/com/android/jack/assign/dx/Tests.java | 42 + .../com/android/jack/assign/jack/Assignments.java | 36 + .../block/test001/jack/ImplicitBlockSample.java | 106 + .../com/android/jack/box/test001/dx/Tests.java | 286 ++ .../com/android/jack/box/test001/jack/Box001.java | 338 ++ .../com/android/jack/bridge/test001/dx/Tests.java | 36 + .../com/android/jack/bridge/test001/jack/A.java | 28 + .../com/android/jack/bridge/test001/jack/B.java | 28 + .../com/android/jack/bridge/test002/dx/Tests.java | 28 + .../jack/bridge/test002/dx/TestsWithDx.java | 73 + .../com/android/jack/bridge/test002/jack/A.java | 23 + .../com/android/jack/bridge/test002/jack/B.java | 23 + .../com/android/jack/bridge/test002/jack/C.java | 33 + .../android/jack/bridge/test002/jack/Generic.java | 33 + .../jack/bridge/test002/jack/TestsWithJack.java | 66 + .../com/android/jack/bridge/test003/dx/Tests.java | 55 + .../com/android/jack/bridge/test003/jack/Data.java | 60 + .../com/android/jack/bridge/test004/dx/Tests.java | 36 + .../com/android/jack/bridge/test004/jack/Data.java | 38 + .../com/android/jack/bridge/test005/dx/Tests.java | 45 + .../com/android/jack/bridge/test005/jack/Data.java | 41 + .../com/android/jack/bridge/test006/dx/Tests.java | 37 + .../com/android/jack/bridge/test006/jack/Data.java | 52 + .../com/android/jack/bridge/test007/dx/Tests.java | 29 + .../android/jack/bridge/test007/jack/Caller.java | 26 + .../test007/jack/sub/GenericPackageProtected.java | 25 + .../test007/jack/sub/PublicExtendsGeneric.java | 21 + .../android/jack/cast/explicit001/dx/Tests.java | 86 + .../android/jack/cast/explicit001/jack/Data.java | 120 + .../android/jack/cast/implicit001/dx/Tests.java | 165 + .../android/jack/cast/implicit001/jack/Data.java | 132 + .../android/jack/cast/implicit002/dx/Tests.java | 59 + .../android/jack/cast/implicit002/jack/Data.java | 52 + .../android/jack/cast/implicit003/dx/Tests.java | 49 + .../android/jack/cast/implicit003/jack/Data.java | 30 + .../android/jack/cast/implicit004/dx/Tests.java | 86 + .../android/jack/cast/implicit004/jack/Data.java | 59 + .../android/jack/cast/implicit005/jack/Data.java | 30 + .../com/android/jack/cast/useless001/dx/Tests.java | 59 + .../android/jack/cast/useless001/jack/Data.java | 79 + .../com/android/jack/cast/useless002/dx/Tests.java | 35 + .../jack/cast/useless002/jack/UselessCast.java | 32 + .../jack/cast/useless003/jack/UselessCast.java | 31 + .../jack/classpath/test001/jack/Classpath001.java | 26 + .../classpath/test001/lib/Classpath001Lib.java | 23 + .../jack/classpath/test002/jack/Classpath002.java | 26 + .../com/android/jack/classpath/test002/lib1/A.java | 25 + .../jack/classpath/test002/lib1override/A.java | 21 + .../com/android/jack/classpath/test002/lib2/B.java | 30 + .../tests/com/android/jack/clinit/jack/ClInit.java | 21 + .../jack/clinit/jack/ClInitWithVariableInit.java | 24 + .../android/jack/comparison/test001/dx/Tests.java | 89 + .../android/jack/comparison/test001/jack/Data.java | 128 + .../android/jack/conditional/test001/dx/Tests.java | 49 + .../jack/conditional/test001/jack/Conditional.java | 135 + .../android/jack/conditional/test002/dx/Tests.java | 34 + .../android/jack/conditional/test002/jack/C.java | 21 + .../android/jack/conditional/test002/jack/C1.java | 21 + .../android/jack/conditional/test002/jack/C2.java | 21 + .../conditional/test002/jack/Conditional2.java | 40 + .../android/jack/conditional/test002/jack/I1.java | 21 + .../android/jack/conditional/test002/jack/I2.java | 21 + .../android/jack/conditional/test003/dx/Tests.java | 30 + .../jack/conditional/test003/jack/Data.java | 24 + .../android/jack/conditional/test004/dx/Tests.java | 47 + .../conditional/test004/jack/Conditional004.java | 30 + .../android/jack/conditional/test005/dx/Tests.java | 61 + .../conditional/test005/jack/Conditional005.java | 61 + .../android/jack/conditional/test006/dx/Tests.java | 40 + .../test006/jack/ConditionalTest006.java | 34 + .../android/jack/conditional/test007/dx/Tests.java | 64 + .../test007/jack/ConditionalTest007.java | 99 + .../com/android/jack/constant/clazz/dx/Tests.java | 80 + .../com/android/jack/constant/clazz/jack/Data.java | 60 + .../android/jack/constant/test001/dx/Tests.java | 106 + .../jack/constant/test001/jack/Constant.java | 80 + .../android/jack/constant/test002/dx/Tests.java | 37 + .../jack/constant/test002/jack/ConstantReuse.java | 81 + .../android/jack/constant/test003/dx/Tests.java | 44 + .../jack/constant/test003/jack/Constant003.java | 38 + .../android/jack/constant/test004/dx/Tests.java | 31 + .../jack/constant/test004/jack/Constant004.java | 29 + .../android/jack/constant/test005/dx/Tests.java | 31 + .../jack/constant/test005/jack/Constant005.java | 45 + .../android/jack/constant/test006/dx/Tests.java | 31 + .../jack/constant/test006/jack/Constant006.java | 29 + .../android/jack/constant/test007/dx/Tests.java | 33 + .../jack/constant/test007/jack/Constant007.java | 31 + .../jack/constant/test008/jack/Constant008.java | 35 + .../com/android/jack/debug/test001/dx/Tests.java | 38 + .../com/android/jack/debug/test001/jack/Data.java | 24 + .../tests/com/android/jack/debug/test001/test.mk | 25 + .../com/android/jack/debug/test002/dx/Tests.java | 31 + .../android/jack/debug/test002/jack/Debug002.java | 43 + .../android/jack/debug/test003/jack/Debug003.java | 30 + .../com/android/jack/debug/test004/dx/Tests.java | 32 + .../android/jack/debug/test004/jack/Debug004.java | 30 + .../jack/debug/test005/jack/ImplicitReturn.java | 31 + .../debug/test006/jack/MultipleLineStatement.java | 37 + .../android/jack/debug/test007/jack/Test007.java | 29 + .../android/jack/debug/test008/jack/Test008.java | 36 + .../android/jack/debug/test009/jack/Test009.java | 67 + .../android/jack/debug/test010/jack/Test010.java | 37 + .../android/jack/debug/test011/jack/Test011.java | 25 + .../android/jack/debug/test012/jack/Debug012.java | 29 + .../android/jack/debug/test013/jack/Debug013.java | 25 + .../android/jack/debug/test014/jack/Debug014.java | 29 + .../android/jack/debug/test019/jack/Debug019.java | 28 + .../com/android/jack/dx/compiler/dx/Tests.java | 44 + .../com/android/jack/dx/compiler/jack/Data.java | 4316 ++++++++++++++++++++ .../com/android/jack/dx/optimizer/dx/Tests.java | 34 + .../com/android/jack/dx/optimizer/jack/Data.java | 29 + .../com/android/jack/dx/overlapping/dx/Tests.java | 39 + .../com/android/jack/dx/overlapping/jack/Data.java | 47 + .../android/jack/dx/regallocator/jack/Data.java | 36 + .../com/android/jack/enums/test001/dx/Tests.java | 60 + .../com/android/jack/enums/test001/jack/Data.java | 21 + .../com/android/jack/enums/test002/dx/Tests.java | 30 + .../com/android/jack/enums/test002/jack/Data.java | 46 + .../com/android/jack/enums/test003/dx/Tests.java | 47 + .../com/android/jack/enums/test003/jack/Data.java | 75 + .../com/android/jack/enums/test003/jack/Other.java | 22 + .../android/jack/enums/test003/jack/Values.java | 22 + .../com/android/jack/enums/test003/link/Other.java | 23 + .../android/jack/enums/test003/link/Values.java | 23 + .../tests/com/android/jack/enums/test003/test.mk | 26 + .../com/android/jack/error/test001/jack/A.java | 24 + .../com/android/jack/error/test002/jack/A.java | 27 + .../android/jack/external/test001/dx/Tests.java | 32 + .../android/jack/external/test001/jack/Data.java | 26 + .../android/jack/external/test001/lib/Data2.java | 21 + .../tests/com/android/jack/fibonacci/dx/Tests.java | 61 + .../com/android/jack/fibonacci/jack/Fibo.java | 34 + .../jack/fibonacci/jack/FibonacciThreeAddress.java | 38 + .../android/jack/field/instance001/dx/Tests.java | 44 + .../android/jack/field/instance001/jack/Data.java | 30 + .../android/jack/field/instance002/dx/Tests.java | 44 + .../android/jack/field/instance002/jack/Data.java | 30 + .../android/jack/field/instance003/dx/Tests.java | 37 + .../android/jack/field/instance003/jack/Data.java | 49 + .../instance003/jack/other/ProtectedClass.java | 25 + .../field/instance003/jack/other/PublicClass.java | 35 + .../android/jack/field/instance004/dx/Tests.java | 114 + .../android/jack/field/instance004/jack/Data.java | 27 + .../jack/field/instance004/jack/Data10.java | 35 + .../jack/field/instance004/jack/Data11.java | 36 + .../android/jack/field/instance004/jack/Data2.java | 27 + .../android/jack/field/instance004/jack/Data3.java | 29 + .../android/jack/field/instance004/jack/Data4.java | 27 + .../android/jack/field/instance004/jack/Data5.java | 34 + .../android/jack/field/instance004/jack/Data6.java | 35 + .../android/jack/field/instance004/jack/Data7.java | 27 + .../android/jack/field/instance004/jack/Data8.java | 33 + .../android/jack/field/instance004/jack/Data9.java | 29 + .../jack/field/instance005/jack/InstanceField.java | 47 + .../com/android/jack/field/static001/dx/Tests.java | 42 + .../android/jack/field/static001/jack/Data.java | 30 + .../com/android/jack/field/static002/dx/Tests.java | 30 + .../android/jack/field/static002/jack/Data.java | 31 + .../jack/field/static003/jack/StaticField.java | 28 + .../com/android/jack/field/static004/dx/Tests.java | 82 + .../android/jack/field/static004/jack/Data1.java | 43 + .../android/jack/field/static004/jack/Data2.java | 23 + .../android/jack/field/static004/jack/Data3.java | 27 + .../android/jack/field/static004/jack/Data4.java | 33 + .../android/jack/field/static004/jack/Data5.java | 41 + .../android/jack/field/static004/jack/Data6.java | 22 + .../com/android/jack/field/static005/dx/Tests.java | 34 + .../android/jack/field/static005/jack/Data.java | 32 + .../com/android/jack/flow/cfg001/dx/Tests.java | 39 + .../jack/flow/cfg001/jack/LinkIterator.java | 76 + .../tests/com/android/jack/flow/loop/dx/Tests.java | 171 + .../android/jack/flow/loop/jack/InfiniteLoop.java | 78 + .../jack/flow/loop/jack/LoopDoWhileBreak.java | 62 + .../jack/flow/loop/jack/LoopDoWhileContinue.java | 64 + .../jack/flow/loop/jack/LoopDoWhileLiteral.java | 39 + .../android/jack/flow/loop/jack/LoopForBreak.java | 56 + .../jack/flow/loop/jack/LoopForContinue.java | 56 + .../android/jack/flow/loop/jack/LoopInInit.java | 29 + .../jack/flow/loop/jack/LoopWhileBreak.java | 66 + .../jack/flow/loop/jack/LoopWhileContinue.java | 66 + .../jack/flow/loop/jack/NoMoreStatementBug.java | 32 + .../android/jack/generic/basic/jack/Generic.java | 41 + .../jack/ifstatement/advancedTest/dx/Tests.java | 117 + .../ifstatement/advancedTest/jack/IfAdvanced.java | 154 + .../android/jack/ifstatement/cfgTest/dx/Tests.java | 84 + .../jack/ifstatement/cfgTest/jack/IfCfg.java | 115 + .../jack/ifstatement/fastpath/dx/Tests.java | 36 + .../jack/ifstatement/fastpath/jack/Data.java | 36 + .../jack/ifstatement/simpleTest/dx/Tests.java | 112 + .../jack/ifstatement/simpleTest/jack/If.java | 134 + .../jack/init/test001/jack/EmptyConstructor.java | 21 + .../com/android/jack/init/test002/dx/Tests.java | 31 + .../android/jack/init/test002/jack/EmptyClass.java | 21 + .../com/android/jack/inner/test001/dx/Tests.java | 39 + .../com/android/jack/inner/test001/jack/Data.java | 62 + .../com/android/jack/inner/test002/dx/Tests.java | 31 + .../com/android/jack/inner/test002/jack/Data.java | 37 + .../com/android/jack/inner/test003/dx/Tests.java | 31 + .../com/android/jack/inner/test003/jack/Data.java | 37 + .../com/android/jack/inner/test004/dx/Tests.java | 35 + .../com/android/jack/inner/test004/jack/Data.java | 47 + .../com/android/jack/inner/test005/dx/Tests.java | 35 + .../com/android/jack/inner/test005/jack/Data.java | 47 + .../com/android/jack/inner/test006/dx/Tests.java | 35 + .../com/android/jack/inner/test006/jack/Data.java | 50 + .../com/android/jack/inner/test007/dx/Tests.java | 32 + .../com/android/jack/inner/test007/jack/Data.java | 35 + .../com/android/jack/inner/test008/dx/Tests.java | 32 + .../com/android/jack/inner/test008/jack/Data.java | 36 + .../com/android/jack/inner/test008/lib/Data2.java | 21 + .../com/android/jack/inner/test009/dx/Tests.java | 30 + .../com/android/jack/inner/test009/jack/Data.java | 31 + .../com/android/jack/inner/test010/dx/Tests.java | 32 + .../com/android/jack/inner/test010/jack/Data.java | 41 + .../com/android/jack/inner/test011/dx/Tests.java | 32 + .../com/android/jack/inner/test011/jack/Data.java | 34 + .../com/android/jack/inner/test011/jack/Data2.java | 21 + .../com/android/jack/inner/test012/dx/Tests.java | 32 + .../com/android/jack/inner/test012/jack/Data.java | 45 + .../com/android/jack/inner/test012/lib/Data2.java | 30 + .../com/android/jack/inner/test013/dx/Tests.java | 31 + .../com/android/jack/inner/test013/jack/Data.java | 30 + .../com/android/jack/inner/test014/dx/Tests.java | 31 + .../com/android/jack/inner/test014/jack/Data.java | 34 + .../com/android/jack/inner/test015/dx/Tests.java | 32 + .../com/android/jack/inner/test015/jack/B.java | 41 + .../com/android/jack/inner/test015/lib/A.java | 21 + .../com/android/jack/inner/test016/dx/Tests.java | 31 + .../com/android/jack/inner/test016/jack/A.java | 32 + .../com/android/jack/inner/test016/jack/bis/B.java | 23 + .../com/android/jack/inner/test017/dx/Tests.java | 31 + .../com/android/jack/inner/test017/jack/Data.java | 34 + .../com/android/jack/inner/test018/dx/Tests.java | 31 + .../com/android/jack/inner/test018/jack/A.java | 34 + .../com/android/jack/inner/test019/dx/Tests.java | 31 + .../com/android/jack/inner/test019/jack/Data.java | 36 + .../com/android/jack/inner/test020/dx/Tests.java | 31 + .../com/android/jack/inner/test020/jack/Data.java | 53 + .../com/android/jack/inner/test021/dx/Tests.java | 35 + .../com/android/jack/inner/test021/jack/Outer.java | 66 + .../com/android/jack/inner/test022/dx/Tests.java | 30 + .../com/android/jack/inner/test022/jack/Data.java | 37 + .../com/android/jack/inner/test022/jack/Sum.java | 24 + .../com/android/jack/inner/test023/dx/Tests.java | 30 + .../com/android/jack/inner/test023/jack/Data.java | 22 + .../com/android/jack/inner/test024/dx/Tests.java | 30 + .../com/android/jack/inner/test024/jack/Data.java | 34 + .../com/android/jack/inner/test025/jack/Data.java | 23 + .../com/android/jack/inner/test026/dx/Tests.java | 36 + .../com/android/jack/inner/test026/jack/D.java | 48 + .../com/android/jack/inner/test026/jack/pkg/C.java | 23 + .../jack/instance/test001/jack/Instance.java | 24 + .../com/android/jack/invoke/test001/dx/Tests.java | 77 + .../jack/invoke/test001/jack/InvokeClone.java | 25 + .../jack/invoke/test001/jack/InvokeDirect.java | 39 + .../jack/invoke/test001/jack/InvokeInterface.java | 31 + .../test001/jack/InvokeInterfaceComputation.java | 23 + .../jack/InvokeInterfaceComputationImpl.java | 29 + .../jack/invoke/test001/jack/InvokeStatic.java | 39 + .../jack/invoke/test001/jack/InvokeSuper.java | 42 + .../test001/jack/InvokeSuperSuperClass1.java | 31 + .../test001/jack/InvokeSuperSuperClass2.java | 35 + .../jack/invoke/test001/jack/InvokeVirtual.java | 39 + .../com/android/jack/invoke/test002/dx/Tests.java | 37 + .../com/android/jack/invoke/test002/jack/Data.java | 30 + .../com/android/jack/invoke/test003/dx/Tests.java | 37 + .../com/android/jack/invoke/test003/jack/C.java | 31 + .../com/android/jack/invoke/test003/jack/Data.java | 27 + .../android/jack/invoke/test003/jack/sub/A.java | 25 + .../android/jack/invoke/test003/jack/sub/B.java | 21 + .../com/android/jack/invoke/test004/dx/Tests.java | 33 + .../com/android/jack/invoke/test004/jack/A.java | 27 + .../com/android/jack/invoke/test004/jack/B.java | 27 + .../com/android/jack/invoke/test004/jack/Data.java | 25 + .../com/android/jack/invoke/test004/jack/I.java | 22 + .../com/android/jack/invoke/test005/dx/Tests.java | 30 + .../android/jack/invoke/test005/jack/Caller.java | 27 + .../android/jack/invoke/test005/lib/SubClass.java | 21 + .../jack/invoke/test005/lib/SuperClass.java | 23 + .../com/android/jack/invoke/test006/dx/Tests.java | 31 + .../com/android/jack/invoke/test006/jack/A.java | 21 + .../com/android/jack/invoke/test006/jack/B.java | 26 + .../com/android/jack/invoke/test006/jack/Data.java | 25 + .../com/android/jack/invoke/test006/jack/I.java | 22 + .../com/android/jack/jarjar/test001/dx/Tests.java | 49 + .../com/android/jack/jarjar/test001/jack/A.java | 76 + .../com/android/jack/jarjar/test001/jack/B.java | 28 + .../jack/jarjar/test001/jack/DummyAnnot.java | 9 + .../test001/jack/complex/one/sep/sub/two/B.java | 23 + .../jarjar/test001/jack/complex/one/sep/two/B.java | 23 + .../android/jack/jarjar/test001/jack/dstar/B.java | 23 + .../android/jack/jarjar/test001/jack/dstar/C.java | 20 + .../jack/jarjar/test001/jack/dstar/sub/B.java | 23 + .../jack/jarjar/test001/jack/dstar/sub/C.java | 20 + .../android/jack/jarjar/test001/jack/star/B.java | 23 + .../android/jack/jarjar/test001/jack/star/C.java | 20 + .../jack/jarjar/test001/jack/star/untouched/B.java | 23 + .../jack/jarjar/test001/jack/star/untouched/C.java | 20 + .../android/jack/jarjar/test001/jarjar-rules.txt | 5 + .../tests/com/android/jack/jarjar/test001/test.mk | 25 + .../com/android/jack/jarjar/test003/dx/Tests.java | 33 + .../com/android/jack/jarjar/test003/jack/A.java | 24 + .../com/android/jack/jarjar/test003/jack/B.java | 29 + .../com/android/jack/jarjar/test003/jack/C.java | 25 + .../com/android/jack/jarjar/test003/jack/D.java | 21 + .../android/jack/jarjar/test003/jarjar-rules.txt | 2 + .../tests/com/android/jack/jarjar/test003/test.mk | 25 + .../jack/java7/exceptions/test001/dx/Tests.java | 36 + .../exceptions/test001/jack/ExceptionTest.java | 61 + .../jack/java7/exceptions/test002/dx/Tests.java | 37 + .../exceptions/test002/jack/ExceptionTest.java | 79 + .../jack/java7/exceptions/test003/dx/Tests.java | 37 + .../exceptions/test003/jack/ExceptionTest.java | 92 + .../jack/java7/exceptions/test004/dx/Tests.java | 37 + .../exceptions/test004/jack/ExceptionTest.java | 85 + .../jack/java7/exceptions/test005/dx/Tests.java | 35 + .../exceptions/test005/jack/ExceptionTest.java | 81 + .../java7/parser/literals/test001/dx/Tests.java | 35 + .../literals/test001/jack/BinaryNotationTest.java | 31 + .../java7/parser/literals/test002/dx/Tests.java | 36 + .../test002/jack/UnderscoreNotationTest.java | 35 + .../jack/java7/switches/test001/dx/Tests.java | 92 + .../java7/switches/test001/jack/SwitchTest.java | 111 + .../jack/java7/switches/test002/dx/Tests.java | 35 + .../java7/switches/test002/jack/SwitchTest.java | 41 + .../jack/java7/switches/test003/dx/Tests.java | 36 + .../java7/switches/test003/jack/SwitchTest.java | 41 + .../java7/trywithresources/test001/dx/Tests.java | 47 + .../trywithresources/test001/jack/Observer.java | 23 + .../test001/jack/TryWithResourcesTest001.java | 41 + .../jack/autocloseable/AutoCloseable001.java | 33 + .../jack/autocloseable/AutoCloseable002.java | 26 + .../java7/trywithresources/test002/dx/Tests.java | 94 + .../trywithresources/test002/jack/Observer.java | 23 + .../test002/jack/TryWithResourcesTest002.java | 273 ++ .../jack/autocloseable/AutoCloseable001.java | 33 + .../jack/autocloseable/AutoCloseable002.java | 33 + .../jack/autocloseable/AutoCloseable002b.java | 33 + .../jack/autocloseable/AutoCloseable003.java | 35 + .../test002/jack/exception/E1.java | 23 + .../test002/jack/exception/E2.java | 23 + .../test002/jack/exception/E3.java | 23 + .../com/android/jack/label/test001/jack/Label.java | 37 + .../com/android/jack/liboflib/lib/jack/Lib.java | 29 + .../android/jack/liboflib/lib2/jack/LibOfLib.java | 21 + .../com/android/jack/liboflib/main/jack/Main.java | 28 + .../jack/modifier/jack/FieldEnumModifier.java | 25 + .../jack/modifier/jack/FieldInnerModifier.java | 23 + .../android/jack/modifier/jack/FieldModifier.java | 39 + .../android/jack/modifier/jack/MethodModifier.java | 68 + .../android/jack/modifier/jack/TypeModifier.java | 128 + .../android/jack/newarray/test001/dx/Tests.java | 215 + .../android/jack/newarray/test001/jack/Data.java | 133 + .../android/jack/newarray/test002/dx/Tests.java | 32 + .../android/jack/newarray/test002/jack/Data.java | 257 ++ .../android/jack/newarray/test003/dx/Tests.java | 29 + .../jack/newarray/test003/jack/ArrayReuse.java | 25 + .../android/jack/newarray/test004/dx/Tests.java | 57 + .../android/jack/newarray/test004/jack/Data.java | 65 + .../android/jack/newarray/test005/dx/Tests.java | 61 + .../android/jack/newarray/test005/jack/Data.java | 54 + .../jack/nopackage/jack/ClassInDefaultPackage.java | 21 + .../jack/nopackage/jack/InnerInDefaultPackage.java | 35 + .../jack/opcodes/add_double/Test_add_double.java | 144 + .../jack/opcodes/add_double/jm/T_add_double_1.java | 24 + .../jack/opcodes/add_double/jm/T_add_double_3.java | 24 + .../jack/opcodes/add_double/jm/T_add_double_4.java | 24 + .../jack/opcodes/add_float/Test_add_float.java | 146 + .../jack/opcodes/add_float/jm/T_add_float_1.java | 24 + .../jack/opcodes/add_float/jm/T_add_float_3.java | 24 + .../jack/opcodes/add_float/jm/T_add_float_4.java | 24 + .../android/jack/opcodes/add_int/Test_add_int.java | 224 + .../jack/opcodes/add_int/jm/T_add_int_1.java | 24 + .../jack/opcodes/add_int/jm/T_add_int_10.java | 25 + .../jack/opcodes/add_int/jm/T_add_int_3.java | 24 + .../jack/opcodes/add_int/jm/T_add_int_4.java | 24 + .../jack/opcodes/add_int/jm/T_add_int_5.java | 24 + .../jack/opcodes/add_int/jm/T_add_int_6.java | 24 + .../jack/opcodes/add_int/jm/T_add_int_7.java | 25 + .../jack/opcodes/add_int/jm/T_add_int_8.java | 25 + .../jack/opcodes/add_int/jm/T_add_int_9.java | 25 + .../jack/opcodes/add_long/Test_add_long.java | 142 + .../jack/opcodes/add_long/jm/T_add_long_1.java | 24 + .../jack/opcodes/add_long/jm/T_add_long_3.java | 24 + .../jack/opcodes/add_long/jm/T_add_long_4.java | 24 + .../jack/opcodes/add_long/jm/T_add_long_5.java | 24 + .../com/android/jack/opcodes/aget/Test_aget.java | 191 + .../com/android/jack/opcodes/aget/jm/T_aget_1.java | 23 + .../com/android/jack/opcodes/aget/jm/T_aget_2.java | 25 + .../com/android/jack/opcodes/aget/jm/T_aget_3.java | 25 + .../com/android/jack/opcodes/aget/jm/T_aget_4.java | 23 + .../com/android/jack/opcodes/aget/jm/T_aget_5.java | 25 + .../com/android/jack/opcodes/aget/jm/T_aget_6.java | 25 + .../jack/opcodes/aget_byte/Test_aget_byte.java | 85 + .../jack/opcodes/aget_byte/jm/T_aget_byte_1.java | 23 + .../jack/opcodes/aget_char/Test_aget_char.java | 86 + .../jack/opcodes/aget_char/jm/T_aget_char_1.java | 23 + .../jack/opcodes/aget_object/Test_aget_object.java | 151 + .../opcodes/aget_object/jm/T_aget_object_1.java | 24 + .../opcodes/aget_object/jm/T_aget_object_4.java | 24 + .../opcodes/aget_object/jm/T_aget_object_5.java | 24 + .../opcodes/aget_object/jm/T_aget_object_6.java | 24 + .../opcodes/aget_object/jm/T_aget_object_7.java | 24 + .../opcodes/aget_object/jm/T_aget_object_8.java | 24 + .../opcodes/aget_object/jm/T_aget_object_9.java | 24 + .../jack/opcodes/aget_short/Test_aget_short.java | 107 + .../jack/opcodes/aget_short/jm/T_aget_short_1.java | 23 + .../jack/opcodes/aget_short/jm/T_aget_short_4.java | 25 + .../jack/opcodes/aget_short/jm/T_aget_short_5.java | 25 + .../jack/opcodes/aget_wide/Test_aget_wide.java | 180 + .../jack/opcodes/aget_wide/jm/T_aget_wide_1.java | 23 + .../jack/opcodes/aget_wide/jm/T_aget_wide_2.java | 24 + .../jack/opcodes/aget_wide/jm/T_aget_wide_3.java | 24 + .../jack/opcodes/aget_wide/jm/T_aget_wide_4.java | 24 + .../jack/opcodes/aget_wide/jm/T_aget_wide_5.java | 24 + .../android/jack/opcodes/and_int/Test_and_int.java | 83 + .../jack/opcodes/and_int/jm/T_and_int_1.java | 24 + .../jack/opcodes/and_int/jm/T_and_int_3.java | 24 + .../jack/opcodes/and_int/jm/T_and_int_4.java | 24 + .../jack/opcodes/and_long/Test_and_long.java | 83 + .../jack/opcodes/and_long/jm/T_and_long_1.java | 24 + .../jack/opcodes/and_long/jm/T_and_long_3.java | 24 + .../jack/opcodes/and_long/jm/T_and_long_4.java | 24 + .../com/android/jack/opcodes/aput/Test_aput.java | 191 + .../com/android/jack/opcodes/aput/jm/T_aput_1.java | 23 + .../com/android/jack/opcodes/aput/jm/T_aput_2.java | 24 + .../com/android/jack/opcodes/aput/jm/T_aput_3.java | 24 + .../com/android/jack/opcodes/aput/jm/T_aput_4.java | 23 + .../com/android/jack/opcodes/aput/jm/T_aput_5.java | 24 + .../com/android/jack/opcodes/aput/jm/T_aput_6.java | 24 + .../jack/opcodes/aput_byte/Test_aput_byte.java | 85 + .../jack/opcodes/aput_byte/jm/T_aput_byte_1.java | 23 + .../jack/opcodes/aput_char/Test_aput_char.java | 109 + .../jack/opcodes/aput_char/jm/T_aput_char_1.java | 23 + .../jack/opcodes/aput_char/jm/T_aput_char_4.java | 24 + .../jack/opcodes/aput_char/jm/T_aput_char_5.java | 24 + .../jack/opcodes/aput_object/Test_aput_object.java | 101 + .../opcodes/aput_object/jm/T_aput_object_1.java | 24 + .../opcodes/aput_object/jm/T_aput_object_10.java | 24 + .../jack/opcodes/aput_short/Test_aput_short.java | 106 + .../jack/opcodes/aput_short/jm/T_aput_short_1.java | 23 + .../jack/opcodes/aput_short/jm/T_aput_short_4.java | 24 + .../jack/opcodes/aput_short/jm/T_aput_short_5.java | 24 + .../jack/opcodes/aput_wide/Test_aput_wide.java | 168 + .../jack/opcodes/aput_wide/jm/T_aput_wide_1.java | 23 + .../jack/opcodes/aput_wide/jm/T_aput_wide_2.java | 24 + .../jack/opcodes/aput_wide/jm/T_aput_wide_3.java | 24 + .../jack/opcodes/aput_wide/jm/T_aput_wide_4.java | 24 + .../opcodes/array_length/Test_array_length.java | 60 + .../opcodes/array_length/jm/T_array_length_1.java | 24 + .../opcodes/array_length/jm/T_array_length_2.java | 25 + .../jack/opcodes/check_cast/Test_check_cast.java | 54 + .../jack/opcodes/check_cast/jm/T_check_cast_1.java | 24 + .../jack/opcodes/cmp_long/Test_cmp_long.java | 124 + .../jack/opcodes/cmp_long/jm/T_cmp_long_1.java | 26 + .../jack/opcodes/cmp_long/jm/T_cmp_long_3.java | 24 + .../jack/opcodes/cmp_long/jm/T_cmp_long_4.java | 24 + .../jack/opcodes/cmp_long/jm/T_cmp_long_5.java | 24 + .../jack/opcodes/cmpg_double/Test_cmpg_double.java | 99 + .../opcodes/cmpg_double/jm/T_cmpg_double_1.java | 28 + .../opcodes/cmpg_double/jm/T_cmpg_double_2.java | 24 + .../jack/opcodes/cmpg_float/Test_cmpg_float.java | 90 + .../jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java | 28 + .../jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java | 24 + .../jack/opcodes/cmpl_double/Test_cmpl_double.java | 32 + .../opcodes/cmpl_double/jm/T_cmpl_double_1.java | 28 + .../jack/opcodes/cmpl_float/Test_cmpl_float.java | 98 + .../jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java | 28 + .../jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java | 24 + .../jack/opcodes/const4_16/Test_const4_16.java | 206 + .../jack/opcodes/const4_16/jm/T_const4_16_1.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_10.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_11.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_12.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_13.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_14.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_15.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_16.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_17.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_2.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_3.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_4.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_5.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_6.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_7.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_8.java | 24 + .../jack/opcodes/const4_16/jm/T_const4_16_9.java | 24 + .../opcodes/const_string/Test_const_string.java | 36 + .../opcodes/const_string/jm/T_const_string_1.java | 24 + .../jack/opcodes/const_wide/Test_const_wide.java | 92 + .../jack/opcodes/const_wide/jm/T_const_wide_1.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_2.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_3.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_4.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_5.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_6.java | 24 + .../jack/opcodes/const_wide/jm/T_const_wide_7.java | 24 + .../jack/opcodes/div_double/Test_div_double.java | 146 + .../jack/opcodes/div_double/jm/T_div_double_1.java | 24 + .../jack/opcodes/div_double/jm/T_div_double_3.java | 24 + .../jack/opcodes/div_double/jm/T_div_double_4.java | 24 + .../jack/opcodes/div_float/Test_div_float.java | 141 + .../jack/opcodes/div_float/jm/T_div_float_1.java | 24 + .../jack/opcodes/div_float/jm/T_div_float_3.java | 24 + .../jack/opcodes/div_float/jm/T_div_float_4.java | 24 + .../android/jack/opcodes/div_int/Test_div_int.java | 153 + .../jack/opcodes/div_int/jm/T_div_int_1.java | 24 + .../jack/opcodes/div_int/jm/T_div_int_3.java | 24 + .../jack/opcodes/div_int/jm/T_div_int_4.java | 24 + .../jack/opcodes/div_long/Test_div_long.java | 156 + .../jack/opcodes/div_long/jm/T_div_long_1.java | 26 + .../jack/opcodes/div_long/jm/T_div_long_4.java | 24 + .../jack/opcodes/div_long/jm/T_div_long_5.java | 24 + .../jack/opcodes/div_long/jm/T_div_long_6.java | 24 + .../double_to_float/Test_double_to_float.java | 123 + .../double_to_float/jm/T_double_to_float_1.java | 24 + .../double_to_float/jm/T_double_to_float_3.java | 24 + .../double_to_float/jm/T_double_to_float_4.java | 24 + .../opcodes/double_to_int/Test_double_to_int.java | 114 + .../double_to_int/jm/T_double_to_int_1.java | 24 + .../double_to_int/jm/T_double_to_int_3.java | 24 + .../double_to_int/jm/T_double_to_int_4.java | 24 + .../double_to_long/Test_double_to_long.java | 115 + .../double_to_long/jm/T_double_to_long_1.java | 24 + .../double_to_long/jm/T_double_to_long_3.java | 24 + .../double_to_long/jm/T_double_to_long_4.java | 24 + .../float_to_double/Test_float_to_double.java | 116 + .../float_to_double/jm/T_float_to_double_1.java | 24 + .../float_to_double/jm/T_float_to_double_3.java | 24 + .../float_to_double/jm/T_float_to_double_4.java | 24 + .../opcodes/float_to_int/Test_float_to_int.java | 114 + .../opcodes/float_to_int/jm/T_float_to_int_1.java | 24 + .../opcodes/float_to_int/jm/T_float_to_int_3.java | 24 + .../opcodes/float_to_int/jm/T_float_to_int_4.java | 24 + .../opcodes/float_to_long/Test_float_to_long.java | 115 + .../float_to_long/jm/T_float_to_long_1.java | 24 + .../float_to_long/jm/T_float_to_long_3.java | 24 + .../float_to_long/jm/T_float_to_long_4.java | 24 + .../com/android/jack/opcodes/if_eq/Test_if_eq.java | 133 + .../android/jack/opcodes/if_eq/jm/T_if_eq_1.java | 24 + .../android/jack/opcodes/if_eq/jm/T_if_eq_2.java | 24 + .../android/jack/opcodes/if_eq/jm/T_if_eq_3.java | 24 + .../android/jack/opcodes/if_eqz/Test_if_eqz.java | 107 + .../android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java | 24 + .../android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java | 24 + .../android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java | 24 + .../android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java | 24 + .../com/android/jack/opcodes/if_ge/Test_if_ge.java | 126 + .../android/jack/opcodes/if_ge/jm/T_if_ge_1.java | 24 + .../android/jack/opcodes/if_ge/jm/T_if_ge_2.java | 24 + .../android/jack/opcodes/if_gez/Test_if_gez.java | 70 + .../android/jack/opcodes/if_gez/jm/T_if_gez_1.java | 24 + .../android/jack/opcodes/if_gez/jm/T_if_gez_2.java | 24 + .../com/android/jack/opcodes/if_gt/Test_if_gt.java | 127 + .../android/jack/opcodes/if_gt/jm/T_if_gt_1.java | 24 + .../android/jack/opcodes/if_gt/jm/T_if_gt_2.java | 24 + .../android/jack/opcodes/if_gtz/Test_if_gtz.java | 78 + .../android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java | 24 + .../android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java | 24 + .../com/android/jack/opcodes/if_le/Test_if_le.java | 127 + .../android/jack/opcodes/if_le/jm/T_if_le_1.java | 24 + .../android/jack/opcodes/if_le/jm/T_if_le_2.java | 24 + .../android/jack/opcodes/if_lez/Test_if_lez.java | 77 + .../android/jack/opcodes/if_lez/jm/T_if_lez_1.java | 24 + .../android/jack/opcodes/if_lez/jm/T_if_lez_2.java | 24 + .../com/android/jack/opcodes/if_lt/Test_if_lt.java | 126 + .../android/jack/opcodes/if_lt/jm/T_if_lt_1.java | 24 + .../android/jack/opcodes/if_lt/jm/T_if_lt_2.java | 24 + .../android/jack/opcodes/if_ltz/Test_if_ltz.java | 78 + .../android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java | 24 + .../android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java | 24 + .../com/android/jack/opcodes/if_ne/Test_if_ne.java | 93 + .../android/jack/opcodes/if_ne/jm/T_if_ne_1.java | 24 + .../android/jack/opcodes/if_ne/jm/T_if_ne_2.java | 24 + .../android/jack/opcodes/if_nez/Test_if_nez.java | 107 + .../android/jack/opcodes/if_nez/jm/T_if_nez_1.java | 24 + .../android/jack/opcodes/if_nez/jm/T_if_nez_2.java | 24 + .../android/jack/opcodes/if_nez/jm/T_if_nez_3.java | 24 + .../android/jack/opcodes/if_nez/jm/T_if_nez_4.java | 24 + .../com/android/jack/opcodes/iget/Test_iget.java | 87 + .../com/android/jack/opcodes/iget/jm/T_iget_1.java | 27 + .../android/jack/opcodes/iget/jm/T_iget_11.java | 24 + .../android/jack/opcodes/iget/jm/T_iget_15.java | 25 + .../com/android/jack/opcodes/iget/jm/T_iget_2.java | 26 + .../com/android/jack/opcodes/iget/jm/T_iget_4.java | 25 + .../com/android/jack/opcodes/iget/jm/T_iget_5.java | 26 + .../com/android/jack/opcodes/iget/jm/T_iget_6.java | 24 + .../android/jack/opcodes/iget/jm/TestStubs.java | 31 + .../jack/opcodes/int_to_byte/Test_int_to_byte.java | 147 + .../opcodes/int_to_byte/jm/T_int_to_byte_1.java | 24 + .../opcodes/int_to_byte/jm/T_int_to_byte_3.java | 24 + .../opcodes/int_to_byte/jm/T_int_to_byte_4.java | 24 + .../jack/opcodes/int_to_char/Test_int_to_char.java | 108 + .../opcodes/int_to_char/jm/T_int_to_char_1.java | 24 + .../opcodes/int_to_char/jm/T_int_to_char_3.java | 24 + .../opcodes/int_to_char/jm/T_int_to_char_4.java | 24 + .../opcodes/int_to_double/Test_int_to_double.java | 74 + .../int_to_double/jm/T_int_to_double_1.java | 24 + .../int_to_double/jm/T_int_to_double_3.java | 24 + .../int_to_double/jm/T_int_to_double_4.java | 24 + .../opcodes/int_to_float/Test_int_to_float.java | 99 + .../opcodes/int_to_float/jm/T_int_to_float_1.java | 24 + .../opcodes/int_to_float/jm/T_int_to_float_3.java | 24 + .../opcodes/int_to_float/jm/T_int_to_float_4.java | 24 + .../jack/opcodes/int_to_long/Test_int_to_long.java | 91 + .../opcodes/int_to_long/jm/T_int_to_long_1.java | 24 + .../opcodes/int_to_long/jm/T_int_to_long_3.java | 24 + .../opcodes/int_to_long/jm/T_int_to_long_4.java | 24 + .../opcodes/int_to_short/Test_int_to_short.java | 124 + .../opcodes/int_to_short/jm/T_int_to_short_1.java | 24 + .../opcodes/int_to_short/jm/T_int_to_short_3.java | 24 + .../opcodes/int_to_short/jm/T_int_to_short_4.java | 24 + .../opcodes/invoke_direct/Test_invoke_direct.java | 43 + .../jack/opcodes/invoke_direct/jm/TSuper.java | 64 + .../invoke_direct/jm/T_invoke_direct_2.java | 28 + .../invoke_direct/jm/T_invoke_direct_21.java | 35 + .../invoke_interface/Test_invoke_interface.java | 88 + .../jack/opcodes/invoke_interface/jm/ITest.java | 25 + .../opcodes/invoke_interface/jm/ITestImpl.java | 39 + .../invoke_interface/jm/ITestImplAbstract.java | 23 + .../invoke_interface/jm/T_invoke_interface_1.java | 24 + .../invoke_interface/jm/T_invoke_interface_12.java | 24 + .../invoke_interface/jm/T_invoke_interface_14.java | 32 + .../invoke_interface/jm/T_invoke_interface_17.java | 24 + .../invoke_interface/jm/T_invoke_interface_19.java | 69 + .../invoke_interface/jm/T_invoke_interface_2.java | 24 + .../invoke_interface/jm/T_invoke_interface_23.java | 24 + .../jack/opcodes/invoke_static/TestStubs.java | 24 + .../opcodes/invoke_static/Test_invoke_static.java | 138 + .../invoke_static/jm/T_invoke_static_1.java | 24 + .../invoke_static/jm/T_invoke_static_12.java | 58 + .../invoke_static/jm/T_invoke_static_13.java | 25 + .../invoke_static/jm/T_invoke_static_14.java | 24 + .../invoke_static/jm/T_invoke_static_15.java | 31 + .../invoke_static/jm/T_invoke_static_18.java | 26 + .../invoke_static/jm/T_invoke_static_2.java | 26 + .../invoke_static/jm/T_invoke_static_20.java | 24 + .../invoke_static/jm/T_invoke_static_4.java | 26 + .../invoke_static/jm/T_invoke_static_5.java | 28 + .../invoke_static/jm/T_invoke_static_6.java | 26 + .../invoke_static/jm/T_invoke_static_7.java | 28 + .../invoke_static/jm/T_invoke_static_8.java | 24 + .../jack/opcodes/invoke_static/jm/TestClass.java | 45 + .../invoke_static/jm/TestClassAbstract.java | 23 + .../invoke_static/jm/TestClassInitError.java | 24 + .../opcodes/invoke_super/Test_invoke_super.java | 70 + .../jack/opcodes/invoke_super/jm/TSuper.java | 64 + .../jack/opcodes/invoke_super/jm/TSuper2.java | 42 + .../opcodes/invoke_super/jm/T_invoke_super_1.java | 25 + .../opcodes/invoke_super/jm/T_invoke_super_14.java | 25 + .../opcodes/invoke_super/jm/T_invoke_super_15.java | 25 + .../opcodes/invoke_super/jm/T_invoke_super_18.java | 29 + .../opcodes/invoke_super/jm/T_invoke_super_19.java | 25 + .../opcodes/invoke_super/jm/T_invoke_super_26.java | 25 + .../jack/opcodes/invoke_virtual/TProtected.java | 30 + .../invoke_virtual/Test_invoke_virtual.java | 135 + .../jack/opcodes/invoke_virtual/jm/ATest.java | 23 + .../jack/opcodes/invoke_virtual/jm/TPlain.java | 41 + .../jack/opcodes/invoke_virtual/jm/TSuper.java | 66 + .../jack/opcodes/invoke_virtual/jm/TSuper2.java | 24 + .../invoke_virtual/jm/T_invoke_virtual_1.java | 24 + .../invoke_virtual/jm/T_invoke_virtual_13.java | 28 + .../invoke_virtual/jm/T_invoke_virtual_14.java | 33 + .../invoke_virtual/jm/T_invoke_virtual_17.java | 27 + .../invoke_virtual/jm/T_invoke_virtual_19.java | 27 + .../invoke_virtual/jm/T_invoke_virtual_2.java | 58 + .../invoke_virtual/jm/T_invoke_virtual_22.java | 27 + .../invoke_virtual/jm/T_invoke_virtual_23.java | 24 + .../invoke_virtual/jm/T_invoke_virtual_4.java | 26 + .../invoke_virtual/jm/T_invoke_virtual_7.java | 27 + .../tests/com/android/jack/opcodes/iput/TIput.java | 29 + .../com/android/jack/opcodes/iput/Test_iput.java | 90 + .../com/android/jack/opcodes/iput/jm/T_iput_1.java | 32 + .../android/jack/opcodes/iput/jm/T_iput_12.java | 25 + .../android/jack/opcodes/iput/jm/T_iput_14.java | 29 + .../android/jack/opcodes/iput/jm/T_iput_16.java | 27 + .../android/jack/opcodes/iput/jm/T_iput_18.java | 26 + .../com/android/jack/opcodes/iput/jm/T_iput_2.java | 26 + .../android/jack/opcodes/iput/jm/TestStubs.java | 27 + .../long_to_double/Test_long_to_double.java | 91 + .../long_to_double/jm/T_long_to_double_1.java | 24 + .../long_to_double/jm/T_long_to_double_3.java | 25 + .../long_to_double/jm/T_long_to_double_4.java | 24 + .../opcodes/long_to_float/Test_long_to_float.java | 91 + .../long_to_float/jm/T_long_to_float_1.java | 24 + .../long_to_float/jm/T_long_to_float_3.java | 24 + .../long_to_float/jm/T_long_to_float_4.java | 24 + .../jack/opcodes/long_to_int/Test_long_to_int.java | 99 + .../opcodes/long_to_int/jm/T_long_to_int_1.java | 24 + .../opcodes/long_to_int/jm/T_long_to_int_3.java | 24 + .../opcodes/long_to_int/jm/T_long_to_int_4.java | 24 + .../opcodes/monitor_enter/Test_monitor_enter.java | 113 + .../monitor_enter/jm/T_monitor_enter_1.java | 29 + .../monitor_enter/jm/T_monitor_enter_2.java | 35 + .../monitor_enter/jm/T_monitor_enter_4.java | 26 + .../jack/opcodes/mul_double/Test_mul_double.java | 135 + .../jack/opcodes/mul_double/jm/T_mul_double_1.java | 24 + .../jack/opcodes/mul_double/jm/T_mul_double_3.java | 24 + .../jack/opcodes/mul_double/jm/T_mul_double_4.java | 24 + .../jack/opcodes/mul_float/Test_mul_float.java | 135 + .../jack/opcodes/mul_float/jm/T_mul_float_1.java | 24 + .../jack/opcodes/mul_float/jm/T_mul_float_3.java | 24 + .../jack/opcodes/mul_float/jm/T_mul_float_4.java | 24 + .../android/jack/opcodes/mul_int/Test_mul_int.java | 116 + .../jack/opcodes/mul_int/jm/T_mul_int_1.java | 24 + .../jack/opcodes/mul_int/jm/T_mul_int_3.java | 24 + .../jack/opcodes/mul_int/jm/T_mul_int_4.java | 24 + .../jack/opcodes/mul_long/Test_mul_long.java | 126 + .../jack/opcodes/mul_long/jm/T_mul_long_1.java | 24 + .../jack/opcodes/mul_long/jm/T_mul_long_4.java | 24 + .../jack/opcodes/mul_long/jm/T_mul_long_5.java | 24 + .../jack/opcodes/mul_long/jm/T_mul_long_6.java | 24 + .../jack/opcodes/neg_double/Test_neg_double.java | 97 + .../jack/opcodes/neg_double/jm/T_neg_double_1.java | 24 + .../jack/opcodes/neg_float/Test_neg_float.java | 97 + .../jack/opcodes/neg_float/jm/T_neg_float_1.java | 24 + .../android/jack/opcodes/neg_int/Test_neg_int.java | 91 + .../jack/opcodes/neg_int/jm/T_neg_int_1.java | 24 + .../jack/opcodes/neg_int/jm/T_neg_int_2.java | 24 + .../jack/opcodes/neg_long/Test_neg_long.java | 109 + .../jack/opcodes/neg_long/jm/T_neg_long_1.java | 24 + .../jack/opcodes/neg_long/jm/T_neg_long_2.java | 24 + .../jack/opcodes/neg_long/jm/T_neg_long_4.java | 24 + .../jack/opcodes/neg_long/jm/T_neg_long_5.java | 24 + .../jack/opcodes/neg_long/jm/T_neg_long_6.java | 24 + .../jack/opcodes/new_array/Test_new_array.java | 217 + .../jack/opcodes/new_array/jm/T_new_array_1.java | 32 + .../jack/opcodes/new_array/jm/T_new_array_2.java | 24 + .../jack/opcodes/new_array/jm/T_new_array_3.java | 24 + .../jack/opcodes/new_array/jm/T_new_array_4.java | 24 + .../jack/opcodes/new_array/jm/T_new_array_5.java | 24 + .../jack/opcodes/new_array/jm/T_new_array_6.java | 24 + .../jack/opcodes/opc_const/Test_opc_const.java | 46 + .../jack/opcodes/opc_const/jm/T_opc_const_1.java | 24 + .../jack/opcodes/opc_const/jm/T_opc_const_2.java | 24 + .../jack/opcodes/opc_goto/Test_opc_goto.java | 50 + .../jack/opcodes/opc_goto/jm/T_opc_goto_1.java | 27 + .../jack/opcodes/opc_goto/jm/T_opc_goto_2.java | 24 + .../jack/opcodes/opc_goto/jm/T_opc_goto_5.java | 24 + .../opc_instanceof/Test_opc_instanceof.java | 49 + .../opc_instanceof/jm/T_opc_instanceof_1.java | 24 + .../jack/opcodes/opc_instanceof/jm/TestStubs.java | 40 + .../android/jack/opcodes/opc_new/Test_opc_new.java | 65 + .../jack/opcodes/opc_new/jm/T_opc_new_1.java | 24 + .../jack/opcodes/opc_new/jm/T_opc_new_3.java | 27 + .../jack/opcodes/opc_new/jm/T_opc_new_9.java | 24 + .../android/jack/opcodes/opc_new/jm/TestStubs.java | 35 + .../jack/opcodes/opc_return/Test_opc_return.java | 176 + .../jack/opcodes/opc_return/jm/T_opc_return_1.java | 31 + .../opcodes/opc_return/jm/T_opc_return_10.java | 25 + .../opcodes/opc_return/jm/T_opc_return_11.java | 24 + .../opcodes/opc_return/jm/T_opc_return_12.java | 31 + .../opcodes/opc_return/jm/T_opc_return_13.java | 60 + .../opcodes/opc_return/jm/T_opc_return_14.java | 30 + .../opcodes/opc_return/jm/T_opc_return_15.java | 25 + .../jack/opcodes/opc_return/jm/T_opc_return_2.java | 59 + .../jack/opcodes/opc_return/jm/T_opc_return_3.java | 30 + .../jack/opcodes/opc_return/jm/T_opc_return_4.java | 25 + .../jack/opcodes/opc_return/jm/T_opc_return_5.java | 24 + .../jack/opcodes/opc_return/jm/T_opc_return_6.java | 24 + .../jack/opcodes/opc_return/jm/T_opc_return_7.java | 31 + .../jack/opcodes/opc_return/jm/T_opc_return_8.java | 60 + .../jack/opcodes/opc_return/jm/T_opc_return_9.java | 30 + .../jack/opcodes/opc_throw/Test_opc_throw.java | 75 + .../jack/opcodes/opc_throw/jm/T_opc_throw_1.java | 24 + .../jack/opcodes/opc_throw/jm/T_opc_throw_12.java | 33 + .../jack/opcodes/opc_throw/jm/T_opc_throw_2.java | 24 + .../jack/opcodes/opc_throw/jm/T_opc_throw_8.java | 24 + .../android/jack/opcodes/or_int/Test_or_int.java | 83 + .../android/jack/opcodes/or_int/jm/T_or_int_1.java | 24 + .../android/jack/opcodes/or_int/jm/T_or_int_3.java | 24 + .../android/jack/opcodes/or_int/jm/T_or_int_4.java | 24 + .../android/jack/opcodes/or_long/Test_or_long.java | 95 + .../jack/opcodes/or_long/jm/T_or_long_1.java | 24 + .../jack/opcodes/or_long/jm/T_or_long_3.java | 24 + .../jack/opcodes/or_long/jm/T_or_long_4.java | 24 + .../jack/opcodes/or_long/jm/T_or_long_5.java | 24 + .../opcodes/packed_switch/Test_packed_switch.java | 57 + .../packed_switch/jm/T_packed_switch_1.java | 32 + .../jack/opcodes/rem_double/Test_rem_double.java | 141 + .../jack/opcodes/rem_double/jm/T_rem_double_1.java | 24 + .../jack/opcodes/rem_double/jm/T_rem_double_3.java | 24 + .../jack/opcodes/rem_double/jm/T_rem_double_4.java | 24 + .../jack/opcodes/rem_float/Test_rem_float.java | 141 + .../jack/opcodes/rem_float/jm/T_rem_float_1.java | 24 + .../jack/opcodes/rem_float/jm/T_rem_float_3.java | 24 + .../jack/opcodes/rem_float/jm/T_rem_float_4.java | 24 + .../android/jack/opcodes/rem_int/Test_rem_int.java | 153 + .../jack/opcodes/rem_int/jm/T_rem_int_1.java | 24 + .../jack/opcodes/rem_int/jm/T_rem_int_3.java | 24 + .../jack/opcodes/rem_int/jm/T_rem_int_4.java | 24 + .../jack/opcodes/rem_long/Test_rem_long.java | 155 + .../jack/opcodes/rem_long/jm/T_rem_long_1.java | 24 + .../jack/opcodes/rem_long/jm/T_rem_long_3.java | 24 + .../jack/opcodes/rem_long/jm/T_rem_long_4.java | 24 + .../jack/opcodes/rem_long/jm/T_rem_long_5.java | 24 + .../android/jack/opcodes/return_object/Runner.java | 21 + .../opcodes/return_object/RunnerGenerator.java | 21 + .../opcodes/return_object/Test_return_object.java | 139 + .../return_object/jm/T_return_object_1.java | 33 + .../return_object/jm/T_return_object_12.java | 29 + .../return_object/jm/T_return_object_13.java | 30 + .../return_object/jm/T_return_object_15.java | 31 + .../return_object/jm/T_return_object_2.java | 24 + .../return_object/jm/T_return_object_3.java | 24 + .../return_object/jm/T_return_object_6.java | 31 + .../return_object/jm/T_return_object_7.java | 62 + .../return_object/jm/T_return_object_9.java | 24 + .../jack/opcodes/return_object/jm/TetsStubs.java | 34 + .../jack/opcodes/return_wide/Test_return_wide.java | 132 + .../opcodes/return_wide/jm/T_return_wide_1.java | 24 + .../opcodes/return_wide/jm/T_return_wide_10.java | 29 + .../opcodes/return_wide/jm/T_return_wide_11.java | 24 + .../opcodes/return_wide/jm/T_return_wide_12.java | 31 + .../opcodes/return_wide/jm/T_return_wide_13.java | 60 + .../opcodes/return_wide/jm/T_return_wide_14.java | 30 + .../opcodes/return_wide/jm/T_return_wide_2.java | 24 + .../opcodes/return_wide/jm/T_return_wide_6.java | 31 + .../opcodes/return_wide/jm/T_return_wide_7.java | 60 + .../opcodes/return_wide/jm/T_return_wide_8.java | 30 + .../opcodes/return_wide/jm/T_return_wide_9.java | 25 + .../com/android/jack/opcodes/sget/TestStubs.java | 21 + .../com/android/jack/opcodes/sget/Test_sget.java | 75 + .../com/android/jack/opcodes/sget/jm/T_sget_1.java | 27 + .../android/jack/opcodes/sget/jm/T_sget_11.java | 24 + .../com/android/jack/opcodes/sget/jm/T_sget_2.java | 26 + .../com/android/jack/opcodes/sget/jm/T_sget_4.java | 25 + .../com/android/jack/opcodes/sget/jm/T_sget_5.java | 26 + .../com/android/jack/opcodes/sget/jm/T_sget_9.java | 25 + .../android/jack/opcodes/sget/jm/TestStubs.java | 22 + .../android/jack/opcodes/shl_int/Test_shl_int.java | 120 + .../jack/opcodes/shl_int/jm/T_shl_int_1.java | 24 + .../jack/opcodes/shl_int/jm/T_shl_int_3.java | 24 + .../jack/opcodes/shl_int/jm/T_shl_int_4.java | 24 + .../jack/opcodes/shl_long/Test_shl_long.java | 124 + .../jack/opcodes/shl_long/jm/T_shl_long_1.java | 24 + .../jack/opcodes/shl_long/jm/T_shl_long_3.java | 24 + .../jack/opcodes/shl_long/jm/T_shl_long_4.java | 24 + .../jack/opcodes/shl_long/jm/T_shl_long_5.java | 24 + .../android/jack/opcodes/shr_int/Test_shr_int.java | 115 + .../jack/opcodes/shr_int/jm/T_shr_int_1.java | 24 + .../jack/opcodes/shr_int/jm/T_shr_int_3.java | 24 + .../jack/opcodes/shr_int/jm/T_shr_int_4.java | 24 + .../jack/opcodes/shr_long/Test_shr_long.java | 125 + .../jack/opcodes/shr_long/jm/T_shr_long_1.java | 24 + .../jack/opcodes/shr_long/jm/T_shr_long_3.java | 24 + .../jack/opcodes/shr_long/jm/T_shr_long_4.java | 24 + .../jack/opcodes/shr_long/jm/T_shr_long_5.java | 24 + .../opcodes/sparse_switch/Test_sparse_switch.java | 57 + .../sparse_switch/jm/T_sparse_switch_1.java | 32 + .../com/android/jack/opcodes/sput/TestStubs.java | 25 + .../com/android/jack/opcodes/sput/Test_sput.java | 112 + .../com/android/jack/opcodes/sput/jm/T_sput_1.java | 32 + .../android/jack/opcodes/sput/jm/T_sput_13.java | 24 + .../android/jack/opcodes/sput/jm/T_sput_14.java | 29 + .../android/jack/opcodes/sput/jm/T_sput_16.java | 27 + .../android/jack/opcodes/sput/jm/T_sput_18.java | 26 + .../com/android/jack/opcodes/sput/jm/T_sput_2.java | 26 + .../com/android/jack/opcodes/sput/jm/T_sput_6.java | 27 + .../android/jack/opcodes/sput/jm/TestStubs.java | 22 + .../jack/opcodes/sub_double/Test_sub_double.java | 151 + .../jack/opcodes/sub_double/jm/T_sub_double_1.java | 24 + .../jack/opcodes/sub_double/jm/T_sub_double_3.java | 24 + .../jack/opcodes/sub_double/jm/T_sub_double_4.java | 24 + .../jack/opcodes/sub_float/Test_sub_float.java | 160 + .../jack/opcodes/sub_float/jm/T_sub_float_1.java | 24 + .../jack/opcodes/sub_float/jm/T_sub_float_3.java | 24 + .../jack/opcodes/sub_float/jm/T_sub_float_4.java | 24 + .../android/jack/opcodes/sub_int/Test_sub_int.java | 147 + .../jack/opcodes/sub_int/jm/T_sub_int_1.java | 24 + .../jack/opcodes/sub_int/jm/T_sub_int_3.java | 24 + .../jack/opcodes/sub_int/jm/T_sub_int_4.java | 24 + .../jack/opcodes/sub_long/Test_sub_long.java | 118 + .../jack/opcodes/sub_long/jm/T_sub_long_1.java | 25 + .../jack/opcodes/sub_long/jm/T_sub_long_3.java | 24 + .../jack/opcodes/sub_long/jm/T_sub_long_4.java | 24 + .../jack/opcodes/sub_long/jm/T_sub_long_5.java | 24 + .../tests/com/android/jack/opcodes/test-opcodes.mk | 1181 ++++++ .../jack/opcodes/ushr_int/Test_ushr_int.java | 115 + .../jack/opcodes/ushr_int/jm/T_ushr_int_1.java | 24 + .../jack/opcodes/ushr_int/jm/T_ushr_int_3.java | 24 + .../jack/opcodes/ushr_int/jm/T_ushr_int_4.java | 24 + .../jack/opcodes/ushr_long/Test_ushr_long.java | 132 + .../jack/opcodes/ushr_long/jm/T_ushr_long_1.java | 24 + .../jack/opcodes/ushr_long/jm/T_ushr_long_3.java | 24 + .../jack/opcodes/ushr_long/jm/T_ushr_long_4.java | 24 + .../jack/opcodes/ushr_long/jm/T_ushr_long_5.java | 24 + .../android/jack/opcodes/xor_int/Test_xor_int.java | 83 + .../jack/opcodes/xor_int/jm/T_xor_int_1.java | 24 + .../jack/opcodes/xor_int/jm/T_xor_int_3.java | 24 + .../jack/opcodes/xor_int/jm/T_xor_int_4.java | 24 + .../jack/opcodes/xor_long/Test_xor_long.java | 100 + .../jack/opcodes/xor_long/jm/T_xor_long_1.java | 24 + .../jack/opcodes/xor_long/jm/T_xor_long_3.java | 24 + .../jack/opcodes/xor_long/jm/T_xor_long_4.java | 24 + .../jack/opcodes/xor_long/jm/T_xor_long_5.java | 24 + .../exprsimplifier/test001/dx/Tests.java | 40 + .../test001/jack/ExprSimplifier.java | 38 + .../notsimplifier/test001/dx/Tests.java | 149 + .../notsimplifier/test001/jack/NotSimplifier.java | 136 + .../uselesscopy/test001/jack/Test001.java | 25 + .../tests/com/android/jack/order/dx/Tests.java | 58 + .../tests/com/android/jack/order/jack/Order.java | 72 + .../returnstatement/return001/jack/Return.java | 28 + .../jack/returnstatement/returns/dx/Tests.java | 39 + .../returns/jack/MultipleReturn.java | 30 + .../returnstatement/returns/jack/ReturnVoid.java | 27 + .../jack/returnstatement/returnvoid/dx/Tests.java | 30 + .../returnvoid/jack/ReturnVoid.java | 27 + .../com/android/jack/shrob/dontobfuscate.flags | 1 + .../com/android/jack/shrob/keepAllAttributes.flags | 1 + .../com/android/jack/shrob/keepDebugInfo.flags | 1 + .../com/android/jack/shrob/keepPackageName.flags | 1 + .../com/android/jack/shrob/printmapping.flags | 1 + .../com/android/jack/shrob/repackageClasses.flags | 1 + .../com/android/jack/shrob/test001/jack/A.java | 40 + .../com/android/jack/shrob/test001/jack/B.java | 20 + .../com/android/jack/shrob/test001/jack/C.java | 28 + .../com/android/jack/shrob/test001/jack/D.java | 33 + .../com/android/jack/shrob/test001/jack/E.java | 24 + .../com/android/jack/shrob/test001/jack/F.java | 24 + .../com/android/jack/shrob/test001/jack/G.java | 30 + .../com/android/jack/shrob/test001/jack/H.java | 21 + .../com/android/jack/shrob/test001/jack/I.java | 21 + .../com/android/jack/shrob/test001/jack/J.java | 44 + .../com/android/jack/shrob/test001/jack/K.java | 41 + .../com/android/jack/shrob/test001/jack/L.java | 25 + .../android/jack/shrob/test001/jack/Reflect.java | 74 + .../android/jack/shrob/test001/jack/Reflect2.java | 57 + .../android/jack/shrob/test001/proguard.flags001 | 1 + .../jack/shrob/test001/proguard.flags001.mapping | 3 + .../android/jack/shrob/test001/proguard.flags002 | 3 + .../jack/shrob/test001/proguard.flags002.mapping | 4 + .../android/jack/shrob/test001/proguard.flags003 | 3 + .../jack/shrob/test001/proguard.flags003.mapping | 4 + .../android/jack/shrob/test001/proguard.flags004 | 3 + .../jack/shrob/test001/proguard.flags004.mapping | 3 + .../android/jack/shrob/test001/proguard.flags005 | 3 + .../jack/shrob/test001/proguard.flags005.mapping | 5 + .../shrob/test001/proguard.flags005.mapping002 | 5 + .../shrob/test001/proguard.flags005.mapping003 | 5 + .../android/jack/shrob/test001/proguard.flags006 | 3 + .../jack/shrob/test001/proguard.flags006.mapping | 6 + .../android/jack/shrob/test001/proguard.flags007 | 3 + .../jack/shrob/test001/proguard.flags007.mapping | 2 + .../android/jack/shrob/test001/proguard.flags008 | 3 + .../jack/shrob/test001/proguard.flags008.mapping | 3 + .../android/jack/shrob/test001/proguard.flags009 | 3 + .../jack/shrob/test001/proguard.flags009.mapping | 5 + .../android/jack/shrob/test001/proguard.flags010 | 3 + .../jack/shrob/test001/proguard.flags010.mapping | 5 + .../android/jack/shrob/test001/proguard.flags011 | 3 + .../jack/shrob/test001/proguard.flags011.mapping | 6 + .../android/jack/shrob/test001/proguard.flags012 | 3 + .../jack/shrob/test001/proguard.flags012.mapping | 6 + .../android/jack/shrob/test001/proguard.flags013 | 2 + .../jack/shrob/test001/proguard.flags013.mapping | 2 + .../android/jack/shrob/test001/proguard.flags014 | 3 + .../jack/shrob/test001/proguard.flags014.mapping | 5 + .../android/jack/shrob/test001/proguard.flags015 | 3 + .../jack/shrob/test001/proguard.flags015.mapping | 7 + .../android/jack/shrob/test001/proguard.flags016 | 3 + .../jack/shrob/test001/proguard.flags016.mapping | 6 + .../android/jack/shrob/test001/proguard.flags017 | 3 + .../jack/shrob/test001/proguard.flags017.mapping | 8 + .../android/jack/shrob/test001/proguard.flags018 | 6 + .../jack/shrob/test001/proguard.flags018.mapping | 2 + .../android/jack/shrob/test001/proguard.flags019 | 5 + .../jack/shrob/test001/proguard.flags019.mapping | 30 + .../android/jack/shrob/test001/proguard.flags020 | 4 + .../jack/shrob/test001/proguard.flags020.mapping | 25 + .../android/jack/shrob/test001/proguard.flags021 | 6 + .../jack/shrob/test001/proguard.flags021.mapping | 67 + .../android/jack/shrob/test001/proguard.flags022 | 6 + .../jack/shrob/test001/proguard.flags022.mapping | 67 + .../test001/refsFlattenPackage/expected-001.txt | 6 + .../test001/refsFlattenPackage/expected-002.txt | 7 + .../test001/refsFlattenPackage/expected-003.txt | 8 + .../test001/refsFlattenPackage/expected-004.txt | 4 + .../test001/refsFlattenPackage/expected-005.txt | 7 + .../test001/refsFlattenPackage/expected-006.txt | 7 + .../test001/refsFlattenPackage/expected-007.txt | 3 + .../test001/refsFlattenPackage/expected-008.txt | 5 + .../test001/refsFlattenPackage/expected-009.txt | 6 + .../test001/refsFlattenPackage/expected-010.txt | 6 + .../test001/refsFlattenPackage/expected-011.txt | 8 + .../test001/refsFlattenPackage/expected-012.txt | 8 + .../test001/refsFlattenPackage/expected-013.txt | 1 + .../test001/refsFlattenPackage/expected-014.txt | 6 + .../test001/refsFlattenPackage/expected-015.txt | 6 + .../test001/refsFlattenPackage/expected-016.txt | 9 + .../test001/refsFlattenPackage/expected-017.txt | 10 + .../test001/refsFlattenPackage/expected-018.txt | 3 + .../test001/refsFlattenPackage/expected-019.txt | 36 + .../test001/refsFlattenPackage/expected-020.txt | 29 + .../test001/refsFlattenPackage/expected-021.txt | 84 + .../test001/refsFlattenPackage/expected-022.txt | 84 + .../refsObfuscationWithMapping/expected-001.txt | 6 + .../refsObfuscationWithMapping/expected-002.txt | 7 + .../refsObfuscationWithMapping/expected-003.txt | 8 + .../refsObfuscationWithMapping/expected-004.txt | 4 + .../refsObfuscationWithMapping/expected-005.txt | 7 + .../refsObfuscationWithMapping/expected-006.txt | 7 + .../refsObfuscationWithMapping/expected-007.txt | 3 + .../refsObfuscationWithMapping/expected-008.txt | 5 + .../refsObfuscationWithMapping/expected-009.txt | 6 + .../refsObfuscationWithMapping/expected-010.txt | 6 + .../refsObfuscationWithMapping/expected-011.txt | 8 + .../refsObfuscationWithMapping/expected-012.txt | 8 + .../refsObfuscationWithMapping/expected-013.txt | 1 + .../refsObfuscationWithMapping/expected-014.txt | 6 + .../refsObfuscationWithMapping/expected-015.txt | 6 + .../refsObfuscationWithMapping/expected-016.txt | 9 + .../refsObfuscationWithMapping/expected-017.txt | 10 + .../refsObfuscationWithMapping/expected-018.txt | 3 + .../refsObfuscationWithMapping/expected-019.txt | 36 + .../refsObfuscationWithMapping/expected-020.txt | 29 + .../refsObfuscationWithMapping/expected-021.txt | 84 + .../refsObfuscationWithMapping/expected-022.txt | 84 + .../refsObfuscationWithoutMapping/expected-001.txt | 6 + .../refsObfuscationWithoutMapping/expected-002.txt | 7 + .../refsObfuscationWithoutMapping/expected-003.txt | 8 + .../refsObfuscationWithoutMapping/expected-004.txt | 4 + .../refsObfuscationWithoutMapping/expected-005.txt | 7 + .../refsObfuscationWithoutMapping/expected-006.txt | 7 + .../refsObfuscationWithoutMapping/expected-007.txt | 3 + .../refsObfuscationWithoutMapping/expected-008.txt | 5 + .../refsObfuscationWithoutMapping/expected-009.txt | 6 + .../refsObfuscationWithoutMapping/expected-010.txt | 6 + .../refsObfuscationWithoutMapping/expected-011.txt | 8 + .../refsObfuscationWithoutMapping/expected-012.txt | 8 + .../refsObfuscationWithoutMapping/expected-013.txt | 1 + .../refsObfuscationWithoutMapping/expected-014.txt | 6 + .../refsObfuscationWithoutMapping/expected-015.txt | 6 + .../refsObfuscationWithoutMapping/expected-016.txt | 9 + .../refsObfuscationWithoutMapping/expected-017.txt | 10 + .../refsObfuscationWithoutMapping/expected-018.txt | 3 + .../refsObfuscationWithoutMapping/expected-019.txt | 36 + .../refsObfuscationWithoutMapping/expected-020.txt | 29 + .../refsObfuscationWithoutMapping/expected-021.txt | 84 + .../refsObfuscationWithoutMapping/expected-022.txt | 84 + .../test001/refsRepackageClasses/expected-001.txt | 6 + .../test001/refsRepackageClasses/expected-002.txt | 7 + .../test001/refsRepackageClasses/expected-003.txt | 8 + .../test001/refsRepackageClasses/expected-004.txt | 4 + .../test001/refsRepackageClasses/expected-005.txt | 7 + .../test001/refsRepackageClasses/expected-006.txt | 7 + .../test001/refsRepackageClasses/expected-007.txt | 3 + .../test001/refsRepackageClasses/expected-008.txt | 5 + .../test001/refsRepackageClasses/expected-009.txt | 6 + .../test001/refsRepackageClasses/expected-010.txt | 6 + .../test001/refsRepackageClasses/expected-011.txt | 8 + .../test001/refsRepackageClasses/expected-012.txt | 8 + .../test001/refsRepackageClasses/expected-013.txt | 1 + .../test001/refsRepackageClasses/expected-014.txt | 6 + .../test001/refsRepackageClasses/expected-015.txt | 6 + .../test001/refsRepackageClasses/expected-016.txt | 9 + .../test001/refsRepackageClasses/expected-017.txt | 10 + .../test001/refsRepackageClasses/expected-018.txt | 3 + .../test001/refsRepackageClasses/expected-019.txt | 36 + .../test001/refsRepackageClasses/expected-020.txt | 29 + .../test001/refsRepackageClasses/expected-021.txt | 84 + .../test001/refsRepackageClasses/expected-022.txt | 84 + .../jack/shrob/test001/refsSeed/expected-001.txt | 1 + .../jack/shrob/test001/refsSeed/expected-002.txt | 3 + .../jack/shrob/test001/refsSeed/expected-003.txt | 5 + .../jack/shrob/test001/refsSeed/expected-004.txt | 2 + .../jack/shrob/test001/refsSeed/expected-005.txt | 2 + .../jack/shrob/test001/refsSeed/expected-006.txt | 2 + .../jack/shrob/test001/refsSeed/expected-007.txt | 2 + .../jack/shrob/test001/refsSeed/expected-008.txt | 2 + .../jack/shrob/test001/refsSeed/expected-009.txt | 2 + .../jack/shrob/test001/refsSeed/expected-010.txt | 2 + .../jack/shrob/test001/refsSeed/expected-011.txt | 2 + .../jack/shrob/test001/refsSeed/expected-012.txt | 2 + .../jack/shrob/test001/refsSeed/expected-013.txt | 1 + .../jack/shrob/test001/refsSeed/expected-014.txt | 2 + .../jack/shrob/test001/refsSeed/expected-015.txt | 2 + .../jack/shrob/test001/refsSeed/expected-016.txt | 2 + .../jack/shrob/test001/refsSeed/expected-017.txt | 2 + .../jack/shrob/test001/refsSeed/expected-018.txt | 3 + .../jack/shrob/test001/refsSeed/expected-019.txt | 45 + .../jack/shrob/test001/refsSeed/expected-020.txt | 25 + .../jack/shrob/test001/refsSeed/expected-021.txt | 25 + .../jack/shrob/test001/refsSeed/expected-022.txt | 45 + .../shrob/test001/refsShrinking/expected-001.txt | 6 + .../shrob/test001/refsShrinking/expected-002.txt | 7 + .../shrob/test001/refsShrinking/expected-003.txt | 8 + .../shrob/test001/refsShrinking/expected-004.txt | 4 + .../shrob/test001/refsShrinking/expected-005.txt | 7 + .../shrob/test001/refsShrinking/expected-006.txt | 7 + .../shrob/test001/refsShrinking/expected-007.txt | 3 + .../shrob/test001/refsShrinking/expected-008.txt | 5 + .../shrob/test001/refsShrinking/expected-009.txt | 6 + .../shrob/test001/refsShrinking/expected-010.txt | 6 + .../shrob/test001/refsShrinking/expected-011.txt | 8 + .../shrob/test001/refsShrinking/expected-012.txt | 8 + .../shrob/test001/refsShrinking/expected-013.txt | 1 + .../shrob/test001/refsShrinking/expected-014.txt | 6 + .../shrob/test001/refsShrinking/expected-015.txt | 6 + .../shrob/test001/refsShrinking/expected-016.txt | 9 + .../shrob/test001/refsShrinking/expected-017.txt | 10 + .../shrob/test001/refsShrinking/expected-018.txt | 3 + .../shrob/test001/refsShrinking/expected-019.txt | 36 + .../shrob/test001/refsShrinking/expected-020.txt | 29 + .../shrob/test001/refsShrinking/expected-021.txt | 84 + .../shrob/test001/refsShrinking/expected-022.txt | 84 + .../com/android/jack/shrob/test002/jack/A.java | 24 + .../com/android/jack/shrob/test002/jack/B.java | 21 + .../android/jack/shrob/test002/proguard.flags001 | 1 + .../android/jack/shrob/test002/proguard.flags002 | 5 + .../jack/shrob/test002/proguard.flags002.mapping | 1 + .../android/jack/shrob/test002/proguard.flags003 | 1 + .../jack/shrob/test002/proguard.flags003.mapping | 1 + .../test002/refsFlattenPackage/expected-001.txt | 3 + .../test002/refsFlattenPackage/expected-002.txt | 2 + .../test002/refsFlattenPackage/expected-003.txt | 2 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-002.txt | 2 + .../refsObfuscationWithMapping/expected-003.txt | 2 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-002.txt | 2 + .../refsObfuscationWithoutMapping/expected-003.txt | 2 + .../test002/refsRepackageClasses/expected-001.txt | 3 + .../test002/refsRepackageClasses/expected-002.txt | 2 + .../test002/refsRepackageClasses/expected-003.txt | 2 + .../jack/shrob/test002/refsSeed/expected-001.txt | 1 + .../jack/shrob/test002/refsSeed/expected-002.txt | 1 + .../jack/shrob/test002/refsSeed/expected-003.txt | 1 + .../shrob/test002/refsShrinking/expected-001.txt | 3 + .../shrob/test002/refsShrinking/expected-002.txt | 2 + .../shrob/test002/refsShrinking/expected-003.txt | 2 + .../com/android/jack/shrob/test003/jack/A.java | 21 + .../com/android/jack/shrob/test003/jack/B.java | 21 + .../com/android/jack/shrob/test003/lib/Test.java | 23 + .../android/jack/shrob/test003/proguard.flags001 | 6 + .../jack/shrob/test003/proguard.flags001.mapping | 1 + .../test003/refsFlattenPackage/expected-001.txt | 2 + .../refsObfuscationWithMapping/expected-001.txt | 2 + .../refsObfuscationWithoutMapping/expected-001.txt | 2 + .../test003/refsRepackageClasses/expected-001.txt | 2 + .../jack/shrob/test003/refsSeed/expected-001.txt | 3 + .../shrob/test003/refsShrinking/expected-001.txt | 2 + .../tests/com/android/jack/shrob/test003/test.jar | Bin 0 -> 847 bytes .../com/android/jack/shrob/test004/jack/A.java | 35 + .../android/jack/shrob/test004/proguard.flags001 | 1 + .../jack/shrob/test004/proguard.flags001.mapping | 2 + .../android/jack/shrob/test004/proguard.flags002 | 3 + .../jack/shrob/test004/proguard.flags002.mapping | 3 + .../android/jack/shrob/test004/proguard.flags003 | 3 + .../jack/shrob/test004/proguard.flags003.mapping | 3 + .../test004/refsFlattenPackage/expected-001.txt | 3 + .../test004/refsFlattenPackage/expected-002.txt | 5 + .../test004/refsFlattenPackage/expected-003.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-002.txt | 5 + .../refsObfuscationWithMapping/expected-003.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-002.txt | 5 + .../refsObfuscationWithoutMapping/expected-003.txt | 5 + .../test004/refsRepackageClasses/expected-001.txt | 3 + .../test004/refsRepackageClasses/expected-002.txt | 5 + .../test004/refsRepackageClasses/expected-003.txt | 5 + .../jack/shrob/test004/refsSeed/expected-001.txt | 1 + .../jack/shrob/test004/refsSeed/expected-002.txt | 2 + .../jack/shrob/test004/refsSeed/expected-003.txt | 2 + .../shrob/test004/refsShrinking/expected-001.txt | 3 + .../shrob/test004/refsShrinking/expected-002.txt | 5 + .../shrob/test004/refsShrinking/expected-003.txt | 5 + .../com/android/jack/shrob/test005/jack/A.java | 33 + .../com/android/jack/shrob/test005/jack/Annot.java | 25 + .../android/jack/shrob/test005/jack/Annot2.java | 21 + .../com/android/jack/shrob/test005/jack/E.java | 21 + .../android/jack/shrob/test005/proguard.flags001 | 1 + .../jack/shrob/test005/proguard.flags001.mapping | 4 + .../android/jack/shrob/test005/proguard.flags002 | 1 + .../jack/shrob/test005/proguard.flags002.mapping | 4 + .../android/jack/shrob/test005/proguard.flags003 | 1 + .../jack/shrob/test005/proguard.flags003.mapping | 4 + .../android/jack/shrob/test005/proguard.flags004 | 1 + .../jack/shrob/test005/proguard.flags004.mapping | 1 + .../android/jack/shrob/test005/proguard.flags005 | 1 + .../jack/shrob/test005/proguard.flags005.mapping | 13 + .../android/jack/shrob/test005/proguard.flags006 | 1 + .../jack/shrob/test005/proguard.flags006.mapping | 10 + .../android/jack/shrob/test005/proguard.flags007 | 1 + .../jack/shrob/test005/proguard.flags007.mapping | 2 + .../android/jack/shrob/test005/proguard.flags008 | 1 + .../jack/shrob/test005/proguard.flags008.mapping | 5 + .../test005/refsFlattenPackage/expected-001.txt | 6 + .../test005/refsFlattenPackage/expected-002.txt | 6 + .../test005/refsFlattenPackage/expected-003.txt | 6 + .../test005/refsFlattenPackage/expected-004.txt | 1 + .../test005/refsFlattenPackage/expected-005.txt | 18 + .../test005/refsFlattenPackage/expected-006.txt | 16 + .../test005/refsFlattenPackage/expected-007.txt | 2 + .../test005/refsFlattenPackage/expected-008.txt | 8 + .../refsObfuscationWithMapping/expected-001.txt | 6 + .../refsObfuscationWithMapping/expected-002.txt | 6 + .../refsObfuscationWithMapping/expected-003.txt | 6 + .../refsObfuscationWithMapping/expected-004.txt | 1 + .../refsObfuscationWithMapping/expected-005.txt | 18 + .../refsObfuscationWithMapping/expected-006.txt | 16 + .../refsObfuscationWithMapping/expected-007.txt | 2 + .../refsObfuscationWithMapping/expected-008.txt | 8 + .../refsObfuscationWithoutMapping/expected-001.txt | 6 + .../refsObfuscationWithoutMapping/expected-002.txt | 6 + .../refsObfuscationWithoutMapping/expected-003.txt | 6 + .../refsObfuscationWithoutMapping/expected-004.txt | 1 + .../refsObfuscationWithoutMapping/expected-005.txt | 18 + .../refsObfuscationWithoutMapping/expected-006.txt | 16 + .../refsObfuscationWithoutMapping/expected-007.txt | 2 + .../refsObfuscationWithoutMapping/expected-008.txt | 8 + .../test005/refsRepackageClasses/expected-001.txt | 6 + .../test005/refsRepackageClasses/expected-002.txt | 6 + .../test005/refsRepackageClasses/expected-003.txt | 6 + .../test005/refsRepackageClasses/expected-004.txt | 1 + .../test005/refsRepackageClasses/expected-005.txt | 18 + .../test005/refsRepackageClasses/expected-006.txt | 16 + .../test005/refsRepackageClasses/expected-007.txt | 2 + .../test005/refsRepackageClasses/expected-008.txt | 8 + .../jack/shrob/test005/refsSeed/expected-001.txt | 2 + .../jack/shrob/test005/refsSeed/expected-002.txt | 2 + .../jack/shrob/test005/refsSeed/expected-003.txt | 2 + .../jack/shrob/test005/refsSeed/expected-004.txt | 1 + .../jack/shrob/test005/refsSeed/expected-006.txt | 6 + .../jack/shrob/test005/refsSeed/expected-007.txt | 2 + .../jack/shrob/test005/refsSeed/expected-008.txt | 1 + .../shrob/test005/refsShrinking/expected-001.txt | 6 + .../shrob/test005/refsShrinking/expected-002.txt | 6 + .../shrob/test005/refsShrinking/expected-003.txt | 6 + .../shrob/test005/refsShrinking/expected-004.txt | 1 + .../shrob/test005/refsShrinking/expected-005.txt | 18 + .../shrob/test005/refsShrinking/expected-006.txt | 16 + .../shrob/test005/refsShrinking/expected-007.txt | 2 + .../shrob/test005/refsShrinking/expected-008.txt | 8 + .../com/android/jack/shrob/test006/jack/A.java | 30 + .../android/jack/shrob/test006/proguard.flags001 | 3 + .../jack/shrob/test006/proguard.flags001.mapping | 4 + .../android/jack/shrob/test006/proguard.flags002 | 3 + .../jack/shrob/test006/proguard.flags002.mapping | 4 + .../android/jack/shrob/test006/proguard.flags003 | 3 + .../jack/shrob/test006/proguard.flags003.mapping | 2 + .../android/jack/shrob/test006/proguard.flags004 | 3 + .../jack/shrob/test006/proguard.flags004.mapping | 3 + .../android/jack/shrob/test006/proguard.flags005 | 3 + .../jack/shrob/test006/proguard.flags005.mapping | 5 + .../android/jack/shrob/test006/proguard.flags006 | 3 + .../jack/shrob/test006/proguard.flags006.mapping | 5 + .../test006/refsFlattenPackage/expected-001.txt | 5 + .../test006/refsFlattenPackage/expected-002.txt | 5 + .../test006/refsFlattenPackage/expected-003.txt | 3 + .../test006/refsFlattenPackage/expected-004.txt | 4 + .../test006/refsFlattenPackage/expected-005.txt | 6 + .../test006/refsFlattenPackage/expected-006.txt | 6 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-002.txt | 5 + .../refsObfuscationWithMapping/expected-003.txt | 3 + .../refsObfuscationWithMapping/expected-004.txt | 4 + .../refsObfuscationWithMapping/expected-005.txt | 6 + .../refsObfuscationWithMapping/expected-006.txt | 6 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-002.txt | 5 + .../refsObfuscationWithoutMapping/expected-003.txt | 3 + .../refsObfuscationWithoutMapping/expected-004.txt | 4 + .../refsObfuscationWithoutMapping/expected-005.txt | 6 + .../refsObfuscationWithoutMapping/expected-006.txt | 6 + .../test006/refsRepackageClasses/expected-001.txt | 5 + .../test006/refsRepackageClasses/expected-002.txt | 5 + .../test006/refsRepackageClasses/expected-003.txt | 3 + .../test006/refsRepackageClasses/expected-004.txt | 4 + .../test006/refsRepackageClasses/expected-005.txt | 6 + .../test006/refsRepackageClasses/expected-006.txt | 6 + .../jack/shrob/test006/refsSeed/expected-001.txt | 5 + .../jack/shrob/test006/refsSeed/expected-002.txt | 5 + .../jack/shrob/test006/refsSeed/expected-003.txt | 2 + .../jack/shrob/test006/refsSeed/expected-004.txt | 4 + .../jack/shrob/test006/refsSeed/expected-005.txt | 6 + .../jack/shrob/test006/refsSeed/expected-006.txt | 6 + .../shrob/test006/refsShrinking/expected-001.txt | 5 + .../shrob/test006/refsShrinking/expected-002.txt | 5 + .../shrob/test006/refsShrinking/expected-003.txt | 3 + .../shrob/test006/refsShrinking/expected-004.txt | 4 + .../shrob/test006/refsShrinking/expected-005.txt | 6 + .../shrob/test006/refsShrinking/expected-006.txt | 6 + .../com/android/jack/shrob/test007/jack/A.java | 31 + .../android/jack/shrob/test007/proguard.flags001 | 3 + .../jack/shrob/test007/proguard.flags001.mapping | 2 + .../android/jack/shrob/test007/proguard.flags002 | 3 + .../jack/shrob/test007/proguard.flags002.mapping | 4 + .../android/jack/shrob/test007/proguard.flags003 | 4 + .../jack/shrob/test007/proguard.flags003.mapping | 2 + .../test007/refsFlattenPackage/expected-001.txt | 3 + .../test007/refsFlattenPackage/expected-002.txt | 5 + .../test007/refsFlattenPackage/expected-003.txt | 3 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-002.txt | 5 + .../refsObfuscationWithMapping/expected-003.txt | 3 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-002.txt | 5 + .../refsObfuscationWithoutMapping/expected-003.txt | 3 + .../test007/refsRepackageClasses/expected-001.txt | 3 + .../test007/refsRepackageClasses/expected-002.txt | 5 + .../test007/refsRepackageClasses/expected-003.txt | 3 + .../jack/shrob/test007/refsSeed/expected-001.txt | 2 + .../jack/shrob/test007/refsSeed/expected-002.txt | 4 + .../jack/shrob/test007/refsSeed/expected-003.txt | 2 + .../shrob/test007/refsShrinking/expected-001.txt | 3 + .../shrob/test007/refsShrinking/expected-002.txt | 5 + .../shrob/test007/refsShrinking/expected-003.txt | 3 + .../com/android/jack/shrob/test008/jack/A.java | 51 + .../jack/shrob/test008/jack/MyException.java | 23 + .../jack/shrob/test008/jack/MyException2.java | 25 + .../android/jack/shrob/test008/proguard.flags001 | 3 + .../jack/shrob/test008/proguard.flags001.mapping | 4 + .../android/jack/shrob/test008/proguard.flags002 | 3 + .../jack/shrob/test008/proguard.flags002.mapping | 4 + .../android/jack/shrob/test008/proguard.flags003 | 3 + .../jack/shrob/test008/proguard.flags003.mapping | 4 + .../android/jack/shrob/test008/proguard.flags004 | 3 + .../jack/shrob/test008/proguard.flags004.mapping | 3 + .../test008/refsFlattenPackage/expected-001.txt | 6 + .../test008/refsFlattenPackage/expected-002.txt | 6 + .../test008/refsFlattenPackage/expected-003.txt | 6 + .../test008/refsFlattenPackage/expected-004.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 6 + .../refsObfuscationWithMapping/expected-002.txt | 6 + .../refsObfuscationWithMapping/expected-003.txt | 6 + .../refsObfuscationWithMapping/expected-004.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 6 + .../refsObfuscationWithoutMapping/expected-002.txt | 6 + .../refsObfuscationWithoutMapping/expected-003.txt | 6 + .../refsObfuscationWithoutMapping/expected-004.txt | 5 + .../test008/refsRepackageClasses/expected-001.txt | 6 + .../test008/refsRepackageClasses/expected-002.txt | 6 + .../test008/refsRepackageClasses/expected-003.txt | 6 + .../test008/refsRepackageClasses/expected-004.txt | 5 + .../jack/shrob/test008/refsSeed/expected-001.txt | 2 + .../jack/shrob/test008/refsSeed/expected-002.txt | 2 + .../jack/shrob/test008/refsSeed/expected-003.txt | 2 + .../jack/shrob/test008/refsSeed/expected-004.txt | 2 + .../shrob/test008/refsShrinking/expected-001.txt | 6 + .../shrob/test008/refsShrinking/expected-002.txt | 6 + .../shrob/test008/refsShrinking/expected-003.txt | 6 + .../shrob/test008/refsShrinking/expected-004.txt | 5 + .../com/android/jack/shrob/test009/jack/A.java | 21 + .../android/jack/shrob/test009/proguard.flags001 | 3 + .../jack/shrob/test009/proguard.flags001.mapping | 2 + .../android/jack/shrob/test009/proguard.flags002 | 3 + .../jack/shrob/test009/proguard.flags002.mapping | 2 + .../android/jack/shrob/test009/proguard.flags003 | 3 + .../jack/shrob/test009/proguard.flags003.mapping | 2 + .../test009/refsFlattenPackage/expected-001.txt | 3 + .../test009/refsFlattenPackage/expected-002.txt | 3 + .../test009/refsFlattenPackage/expected-003.txt | 3 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-002.txt | 3 + .../refsObfuscationWithMapping/expected-003.txt | 3 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-002.txt | 3 + .../refsObfuscationWithoutMapping/expected-003.txt | 3 + .../test009/refsRepackageClasses/expected-001.txt | 3 + .../test009/refsRepackageClasses/expected-002.txt | 3 + .../test009/refsRepackageClasses/expected-003.txt | 3 + .../jack/shrob/test009/refsSeed/expected-001.txt | 2 + .../jack/shrob/test009/refsSeed/expected-002.txt | 2 + .../jack/shrob/test009/refsSeed/expected-003.txt | 2 + .../shrob/test009/refsShrinking/expected-001.txt | 3 + .../shrob/test009/refsShrinking/expected-002.txt | 3 + .../shrob/test009/refsShrinking/expected-003.txt | 3 + .../com/android/jack/shrob/test010/jack/A.java | 35 + .../com/android/jack/shrob/test010/jack/B.java | 24 + .../com/android/jack/shrob/test010/jack/C.java | 21 + .../android/jack/shrob/test010/proguard.flags001 | 3 + .../jack/shrob/test010/proguard.flags001.mapping | 2 + .../android/jack/shrob/test010/proguard.flags002 | 4 + .../jack/shrob/test010/proguard.flags002.mapping | 3 + .../android/jack/shrob/test010/proguard.flags003 | 4 + .../jack/shrob/test010/proguard.flags003.mapping | 4 + .../test010/refsFlattenPackage/expected-001.txt | 5 + .../test010/refsFlattenPackage/expected-002.txt | 4 + .../test010/refsFlattenPackage/expected-003.txt | 6 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-002.txt | 4 + .../refsObfuscationWithMapping/expected-003.txt | 6 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-002.txt | 4 + .../refsObfuscationWithoutMapping/expected-003.txt | 6 + .../test010/refsRepackageClasses/expected-001.txt | 5 + .../test010/refsRepackageClasses/expected-002.txt | 4 + .../test010/refsRepackageClasses/expected-003.txt | 6 + .../jack/shrob/test010/refsSeed/expected-001.txt | 2 + .../jack/shrob/test010/refsSeed/expected-002.txt | 3 + .../jack/shrob/test010/refsSeed/expected-003.txt | 3 + .../shrob/test010/refsShrinking/expected-001.txt | 5 + .../shrob/test010/refsShrinking/expected-002.txt | 4 + .../shrob/test010/refsShrinking/expected-003.txt | 6 + .../com/android/jack/shrob/test011/dx/Tests.java | 34 + .../com/android/jack/shrob/test011/dx/Tests2.java | 34 + .../com/android/jack/shrob/test011/jack/A.java | 44 + .../com/android/jack/shrob/test011/jack/B.java | 23 + .../com/android/jack/shrob/test011/jack/C.java | 21 + .../android/jack/shrob/test011/proguard.flags001 | 3 + .../jack/shrob/test011/proguard.flags001.mapping | 3 + .../android/jack/shrob/test011/proguard.flags002 | 3 + .../jack/shrob/test011/proguard.flags002.mapping | 4 + .../test011/refsFlattenPackage/expected-001.txt | 7 + .../test011/refsFlattenPackage/expected-002.txt | 6 + .../refsObfuscationWithMapping/expected-001.txt | 7 + .../refsObfuscationWithMapping/expected-002.txt | 6 + .../refsObfuscationWithoutMapping/expected-001.txt | 7 + .../refsObfuscationWithoutMapping/expected-002.txt | 6 + .../test011/refsRepackageClasses/expected-001.txt | 7 + .../test011/refsRepackageClasses/expected-002.txt | 6 + .../jack/shrob/test011/refsSeed/expected-001.txt | 2 + .../jack/shrob/test011/refsSeed/expected-002.txt | 2 + .../shrob/test011/refsShrinking/expected-001.txt | 7 + .../shrob/test011/refsShrinking/expected-002.txt | 6 + .../tests/com/android/jack/shrob/test011/test.mk | 25 + .../tests/com/android/jack/shrob/test011/test2.mk | 25 + .../com/android/jack/shrob/test012/jack/A.java | 27 + .../com/android/jack/shrob/test012/jack/B.java | 21 + .../android/jack/shrob/test012/proguard.flags001 | 3 + .../jack/shrob/test012/proguard.flags001.mapping | 2 + .../test012/refsFlattenPackage/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../test012/refsRepackageClasses/expected-001.txt | 3 + .../jack/shrob/test012/refsSeed/expected-001.txt | 2 + .../shrob/test012/refsShrinking/expected-001.txt | 3 + .../com/android/jack/shrob/test013/jack/A.java | 27 + .../com/android/jack/shrob/test013/jack/B.java | 21 + .../android/jack/shrob/test013/proguard.flags001 | 3 + .../jack/shrob/test013/proguard.flags001.mapping | 2 + .../test013/refsFlattenPackage/expected-001.txt | 3 + .../refsObfuscationWithMapping/expected-001.txt | 3 + .../refsObfuscationWithoutMapping/expected-001.txt | 3 + .../test013/refsRepackageClasses/expected-001.txt | 3 + .../jack/shrob/test013/refsSeed/expected-001.txt | 2 + .../shrob/test013/refsShrinking/expected-001.txt | 3 + .../com/android/jack/shrob/test014/jack/A.java | 50 + .../com/android/jack/shrob/test014/jack/B.java | 53 + .../android/jack/shrob/test014/proguard.flags001 | 9 + .../jack/shrob/test014/proguard.flags001.mapping | 18 + .../test014/refsFlattenPackage/expected-001.txt | 20 + .../refsObfuscationWithMapping/expected-001.txt | 20 + .../refsObfuscationWithoutMapping/expected-001.txt | 20 + .../test014/refsRepackageClasses/expected-001.txt | 20 + .../jack/shrob/test014/refsSeed/expected-001.txt | 5 + .../shrob/test014/refsShrinking/expected-001.txt | 20 + .../com/android/jack/shrob/test015/jack/A.java | 37 + .../com/android/jack/shrob/test015/jack/B.java | 21 + .../android/jack/shrob/test015/proguard.flags001 | 4 + .../jack/shrob/test015/proguard.flags001.mapping | 6 + .../test015/refsFlattenPackage/expected-001.txt | 8 + .../refsObfuscationWithMapping/expected-001.txt | 8 + .../refsObfuscationWithoutMapping/expected-001.txt | 8 + .../test015/refsRepackageClasses/expected-001.txt | 8 + .../jack/shrob/test015/refsSeed/expected-001.txt | 14 + .../shrob/test015/refsShrinking/expected-001.txt | 8 + .../android/jack/shrob/test016/applyMapping.flags | 1 + .../com/android/jack/shrob/test016/dx/Tests.java | 39 + .../com/android/jack/shrob/test016/jack/A.java | 25 + .../com/android/jack/shrob/test016/jack/Annot.java | 25 + .../android/jack/shrob/test016/jack/Annot2.java | 25 + .../android/jack/shrob/test016/jack/Annot3.java | 25 + .../android/jack/shrob/test016/jack/Annot4.java | 25 + .../android/jack/shrob/test016/jack/Annot5.java | 25 + .../android/jack/shrob/test016/jack/KeepClass.java | 55 + .../android/jack/shrob/test016/proguard.flags001 | 8 + .../jack/shrob/test016/proguard.flags001.mapping | 17 + .../android/jack/shrob/test016/proguard.flags002 | 5 + .../jack/shrob/test016/proguard.flags002.mapping | 21 + .../test016/refsFlattenPackage/expected-001.txt | 23 + .../test016/refsFlattenPackage/expected-002.txt | 23 + .../refsObfuscationWithMapping/expected-001.txt | 23 + .../refsObfuscationWithMapping/expected-002.txt | 23 + .../refsObfuscationWithoutMapping/expected-001.txt | 23 + .../refsObfuscationWithoutMapping/expected-002.txt | 23 + .../test016/refsRepackageClasses/expected-001.txt | 23 + .../test016/refsRepackageClasses/expected-002.txt | 23 + .../jack/shrob/test016/refsSeed/expected-001.txt | 26 + .../jack/shrob/test016/refsSeed/expected-002.txt | 1 + .../shrob/test016/refsShrinking/expected-001.txt | 23 + .../shrob/test016/refsShrinking/expected-002.txt | 23 + .../tests/com/android/jack/shrob/test016/test.mk | 26 + .../android/jack/shrob/test017/jack/Reflect.java | 70 + .../android/jack/shrob/test017/jack/Reflect2.java | 28 + .../android/jack/shrob/test017/jack/Reflect3.java | 68 + .../android/jack/shrob/test017/proguard.flags001 | 3 + .../jack/shrob/test017/proguard.flags001.mapping | 10 + .../test017/refsFlattenPackage/expected-001.txt | 14 + .../refsObfuscationWithMapping/expected-001.txt | 14 + .../refsObfuscationWithoutMapping/expected-001.txt | 14 + .../test017/refsRepackageClasses/expected-001.txt | 14 + .../jack/shrob/test017/refsSeed/expected-001.txt | 5 + .../shrob/test017/refsShrinking/expected-001.txt | 14 + .../com/android/jack/shrob/test018/jack/A.java | 23 + .../com/android/jack/shrob/test018/jack/B.java | 23 + .../android/jack/shrob/test018/proguard.flags001 | 4 + .../test018/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test018/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test018/refsSeed/expected-001.txt | 3 + .../shrob/test018/refsShrinking/expected-001.txt | 5 + .../com/android/jack/shrob/test019/jack/A.java | 23 + .../com/android/jack/shrob/test019/jack/B.java | 42 + .../android/jack/shrob/test019/proguard.flags001 | 5 + .../test019/refsFlattenPackage/expected-001.txt | 11 + .../refsObfuscationWithMapping/expected-001.txt | 11 + .../refsObfuscationWithoutMapping/expected-001.txt | 11 + .../test019/refsRepackageClasses/expected-001.txt | 11 + .../jack/shrob/test019/refsSeed/expected-001.txt | 5 + .../shrob/test019/refsShrinking/expected-001.txt | 11 + .../com/android/jack/shrob/test020/dx/Tests.java | 31 + .../android/jack/shrob/test020/jack/Shrob020.java | 26 + .../android/jack/shrob/test020/lib/Shrob20Lib.java | 23 + .../com/android/jack/shrob/test020/proguard.flags | 3 + .../android/jack/shrob/test021/jack/Shrob021.java | 45 + .../android/jack/shrob/test021/proguard.flags001 | 3 + .../test021/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test021/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test021/refsSeed/expected-001.txt | 2 + .../shrob/test021/refsShrinking/expected-001.txt | 5 + .../android/jack/shrob/test022/jack/Shrob022.java | 30 + .../android/jack/shrob/test022/proguard.flags001 | 3 + .../test022/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test022/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test022/refsSeed/expected-001.txt | 3 + .../shrob/test022/refsShrinking/expected-001.txt | 5 + .../com/android/jack/shrob/test023/jack/Outer.java | 37 + .../android/jack/shrob/test023/proguard.flags001 | 3 + .../test023/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test023/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test023/refsSeed/expected-001.txt | 2 + .../shrob/test023/refsShrinking/expected-001.txt | 5 + .../com/android/jack/shrob/test024/jack/I.java | 21 + .../com/android/jack/shrob/test024/jack/Keep.java | 23 + .../android/jack/shrob/test024/proguard.flags001 | 3 + .../com/android/jack/shrob/test025/dx/Tests.java | 32 + .../com/android/jack/shrob/test025/jack/A.java | 26 + .../com/android/jack/shrob/test025/jack/Keep.java | 30 + .../android/jack/shrob/test025/proguard.flags001 | 4 + .../test025/refsFlattenPackage/expected-001.txt | 8 + .../refsObfuscationWithMapping/expected-001.txt | 8 + .../refsObfuscationWithoutMapping/expected-001.txt | 8 + .../test025/refsRepackageClasses/expected-001.txt | 8 + .../jack/shrob/test025/refsSeed/expected-001.txt | 2 + .../shrob/test025/refsShrinking/expected-001.txt | 8 + .../tests/com/android/jack/shrob/test025/test.mk | 25 + .../com/android/jack/shrob/test026/includedflags | 6 + .../com/android/jack/shrob/test026/jack/Enum.java | 20 + .../android/jack/shrob/test026/proguard.flags001 | 1 + .../test026/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test026/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test026/refsSeed/expected-001.txt | 3 + .../shrob/test026/refsShrinking/expected-001.txt | 5 + .../com/android/jack/shrob/test027/jack/A.java | 21 + .../android/jack/shrob/test027/lib/ForName.class | Bin 0 -> 532 bytes .../android/jack/shrob/test027/lib/ForName.java | 23 + .../android/jack/shrob/test027/proguard.flags001 | 3 + .../shrob/test027/refsShrinking/expected-001.txt | 5 + .../com/android/jack/shrob/test028/jack/Kept.java | 25 + .../android/jack/shrob/test028/proguard.flags001 | 2 + .../tests/com/android/jack/shrob/test029/info.txt | 3 + .../com/android/jack/shrob/test029/jack/A.java | 21 + .../com/android/jack/shrob/test029/jack/B.java | 26 + .../com/android/jack/shrob/test029/jack/C.java | 30 + .../com/android/jack/shrob/test029/jack/D.java | 22 + .../com/android/jack/shrob/test029/jack/E.java | 21 + .../com/android/jack/shrob/test029/jack/F.java | 21 + .../com/android/jack/shrob/test029/jack/G.java | 21 + .../com/android/jack/shrob/test029/jack/I.java | 21 + .../com/android/jack/shrob/test029/jack/Kept.java | 23 + .../android/jack/shrob/test029/proguard.flags001 | 3 + .../jack/shrob/test029/proguard.flags001.mapping | 5 + .../test029/refsFlattenPackage/expected-001.txt | 12 + .../refsObfuscationWithMapping/expected-001.txt | 12 + .../refsObfuscationWithoutMapping/expected-001.txt | 12 + .../test029/refsRepackageClasses/expected-001.txt | 12 + .../jack/shrob/test029/refsSeed/expected-001.txt | 5 + .../shrob/test029/refsShrinking/expected-001.txt | 12 + .../com/android/jack/shrob/test030/dx/Tests.java | 35 + .../tests/com/android/jack/shrob/test030/info.txt | 2 + .../com/android/jack/shrob/test030/jack/A.java | 23 + .../com/android/jack/shrob/test030/jack/B.java | 20 + .../com/android/jack/shrob/test030/jack/I.java | 21 + .../com/android/jack/shrob/test030/jack/Kept.java | 24 + .../android/jack/shrob/test030/proguard.flags001 | 7 + .../jack/shrob/test030/proguard.flags001.mapping | 4 + .../test030/refsFlattenPackage/expected-001.txt | 10 + .../refsObfuscationWithMapping/expected-001.txt | 10 + .../refsObfuscationWithoutMapping/expected-001.txt | 10 + .../test030/refsRepackageClasses/expected-001.txt | 10 + .../jack/shrob/test030/refsSeed/expected-001.txt | 7 + .../shrob/test030/refsShrinking/expected-001.txt | 10 + .../tests/com/android/jack/shrob/test030/test.mk | 25 + .../tests/com/android/jack/shrob/test031/info.txt | 3 + .../com/android/jack/shrob/test031/jack/A.java | 23 + .../com/android/jack/shrob/test031/jack/B.java | 20 + .../com/android/jack/shrob/test031/jack/D.java | 20 + .../com/android/jack/shrob/test031/jack/E.java | 23 + .../com/android/jack/shrob/test031/jack/F.java | 21 + .../com/android/jack/shrob/test031/jack/I.java | 21 + .../com/android/jack/shrob/test031/jack/I2.java | 21 + .../com/android/jack/shrob/test031/jack/Kept.java | 24 + .../android/jack/shrob/test031/proguard.flags001 | 11 + .../jack/shrob/test031/proguard.flags001.mapping | 16 + .../test031/refsFlattenPackage/expected-001.txt | 16 + .../refsObfuscationWithMapping/expected-001.txt | 16 + .../refsObfuscationWithoutMapping/expected-001.txt | 16 + .../test031/refsRepackageClasses/expected-001.txt | 16 + .../jack/shrob/test031/refsSeed/expected-001.txt | 11 + .../shrob/test031/refsShrinking/expected-001.txt | 16 + .../tests/com/android/jack/shrob/test032/info.txt | 5 + .../com/android/jack/shrob/test032/jack/A.java | 23 + .../com/android/jack/shrob/test032/jack/B.java | 20 + .../com/android/jack/shrob/test032/jack/C.java | 25 + .../com/android/jack/shrob/test032/jack/I.java | 21 + .../com/android/jack/shrob/test032/jack/Kept.java | 25 + .../android/jack/shrob/test032/proguard.flags001 | 5 + .../jack/shrob/test032/proguard.flags001.mapping | 4 + .../test032/refsFlattenPackage/expected-001.txt | 13 + .../refsObfuscationWithMapping/expected-001.txt | 13 + .../refsObfuscationWithoutMapping/expected-001.txt | 13 + .../test032/refsRepackageClasses/expected-001.txt | 13 + .../jack/shrob/test032/refsSeed/expected-001.txt | 6 + .../shrob/test032/refsShrinking/expected-001.txt | 13 + .../tests/com/android/jack/shrob/test033/info.txt | 4 + .../com/android/jack/shrob/test033/jack/A.java | 21 + .../com/android/jack/shrob/test033/jack/B.java | 23 + .../com/android/jack/shrob/test033/mapping.flags | 1 + .../com/android/jack/shrob/test033/mapping2.flags | 2 + .../android/jack/shrob/test033/proguard.flags001 | 5 + .../android/jack/shrob/test033/proguard.flags002 | 5 + .../test033/refsFlattenPackage/expected-001.txt | 7 + .../test033/refsFlattenPackage/expected-002.txt | 7 + .../refsObfuscationWithoutMapping/expected-001.txt | 4 + .../refsObfuscationWithoutMapping/expected-002.txt | 7 + .../test033/refsRepackageClasses/expected-001.txt | 7 + .../test033/refsRepackageClasses/expected-002.txt | 7 + .../jack/shrob/test033/refsSeed/expected-001.txt | 10 + .../jack/shrob/test033/refsSeed/expected-002.txt | 10 + .../shrob/test033/refsShrinking/expected-001.txt | 7 + .../shrob/test033/refsShrinking/expected-002.txt | 7 + .../tests/com/android/jack/shrob/test034/info.txt | 2 + .../com/android/jack/shrob/test034/jack/A.java | 21 + .../com/android/jack/shrob/test034/jack/B.java | 23 + .../com/android/jack/shrob/test034/mapping.flags | 1 + .../android/jack/shrob/test034/proguard.flags001 | 7 + .../test034/refsFlattenPackage/expected-001.txt | 7 + .../refsObfuscationWithoutMapping/expected-001.txt | 4 + .../test034/refsRepackageClasses/expected-001.txt | 7 + .../jack/shrob/test034/refsSeed/expected-001.txt | 10 + .../shrob/test034/refsShrinking/expected-001.txt | 7 + .../tests/com/android/jack/shrob/test035/info.txt | 2 + .../com/android/jack/shrob/test035/jack/A.java | 21 + .../com/android/jack/shrob/test035/jack/B.java | 23 + .../com/android/jack/shrob/test035/jack/Kept.java | 23 + .../com/android/jack/shrob/test035/mapping.flags | 1 + .../android/jack/shrob/test035/proguard.flags001 | 5 + .../test035/refsFlattenPackage/expected-001.txt | 10 + .../refsObfuscationWithoutMapping/expected-001.txt | 6 + .../test035/refsRepackageClasses/expected-001.txt | 10 + .../jack/shrob/test035/refsSeed/expected-001.txt | 5 + .../shrob/test035/refsShrinking/expected-001.txt | 10 + .../tests/com/android/jack/shrob/test036/info.txt | 1 + .../com/android/jack/shrob/test036/jack/E.java | 21 + .../com/android/jack/shrob/test036/jack/Kept.java | 32 + .../android/jack/shrob/test036/proguard.flags001 | 3 + .../test036/refsFlattenPackage/expected-001.txt | 13 + .../refsObfuscationWithMapping/expected-001.txt | 13 + .../refsObfuscationWithoutMapping/expected-001.txt | 13 + .../test036/refsRepackageClasses/expected-001.txt | 13 + .../jack/shrob/test036/refsSeed/expected-001.txt | 5 + .../shrob/test036/refsShrinking/expected-001.txt | 13 + .../tests/com/android/jack/shrob/test037/info.txt | 2 + .../com/android/jack/shrob/test037/jack/A.java | 20 + .../com/android/jack/shrob/test037/jack/B.java | 23 + .../com/android/jack/shrob/test037/jack/Kept.java | 24 + .../android/jack/shrob/test037/proguard.flags001 | 3 + .../jack/shrob/test037/proguard.flags001.mapping | 3 + .../test037/refsFlattenPackage/expected-001.txt | 8 + .../refsObfuscationWithMapping/expected-001.txt | 8 + .../refsObfuscationWithoutMapping/expected-001.txt | 8 + .../test037/refsRepackageClasses/expected-001.txt | 8 + .../jack/shrob/test037/refsSeed/expected-001.txt | 5 + .../shrob/test037/refsShrinking/expected-001.txt | 8 + .../tests/com/android/jack/shrob/test038/info.txt | 1 + .../android/jack/shrob/test038/jack/Element.java | 20 + .../com/android/jack/shrob/test038/jack/Kept.java | 23 + .../android/jack/shrob/test038/proguard.flags001 | 3 + .../test038/refsFlattenPackage/expected-001.txt | 5 + .../refsObfuscationWithMapping/expected-001.txt | 5 + .../refsObfuscationWithoutMapping/expected-001.txt | 5 + .../test038/refsRepackageClasses/expected-001.txt | 5 + .../jack/shrob/test038/refsSeed/expected-001.txt | 5 + .../shrob/test038/refsShrinking/expected-001.txt | 5 + .../android/jack/string/concat001/dx/Tests.java | 116 + .../android/jack/string/concat001/jack/Data.java | 68 + .../android/jack/string/concat002/dx/Tests.java | 137 + .../android/jack/string/concat002/jack/Data.java | 84 + .../com/android/jack/string001/jack/Strings.java | 24 + .../jack/switchstatement/test001/dx/Tests.java | 174 + .../switchstatement/test001/jack/Switches001.java | 275 ++ .../jack/switchstatement/test002/dx/Tests.java | 36 + .../switchstatement/test002/jack/Switches002.java | 45 + .../jack/switchstatement/test003/dx/Tests.java | 45 + .../switchstatement/test003/jack/Switches003.java | 39 + .../jack/switchstatement/test004/dx/Tests.java | 30 + .../jack/switchstatement/test004/jack/Data.java | 36 + .../jack/switchstatement/test005/dx/Tests.java | 56 + .../jack/switchstatement/test005/jack/Switch.java | 77 + .../jack/switchstatement/test006/dx/Tests.java | 64 + .../jack/switchstatement/test006/jack/Switch.java | 65 + .../jack/switchstatement/test007/dx/Tests.java | 33 + .../jack/switchstatement/test007/jack/Switch.java | 33 + .../jack/switchstatement/test008/dx/Tests.java | 35 + .../jack/switchstatement/test008/jack/Switch.java | 48 + .../jack/switchstatement/test009/jack/Switch.java | 50 + .../android/jack/synchronize/test001/dx/Tests.java | 62 + .../jack/synchronize/test001/jack/Synchronize.java | 80 + .../synchronize/test002/jack/Synchronized.java | 30 + .../synchronize/test002/jack/Synchronized2.java | 34 + .../com/android/jack/threeaddress/dx/Tests.java | 133 + .../threeaddress/jack/ThreeAddressCode001.java | 92 + .../threeaddress/jack/ThreeAddressCode002.java | 40 + .../threeaddress/jack/ThreeAddressCode003.java | 72 + .../threeaddress/jack/ThreeAddressCodeUtil001.java | 21 + .../jack/throwstatement/test001/dx/Tests.java | 68 + .../throwstatement/test001/jack/ThrowStmt.java | 46 + .../jack/transformations/cast/jack/Data.java | 70 + .../android/jack/trycatch/test001/dx/Tests.java | 65 + .../jack/trycatch/test001/jack/TryCatch.java | 111 + .../android/jack/trycatch/test002/dx/Tests.java | 46 + .../jack/trycatch/test002/jack/TryCatch.java | 93 + .../android/jack/trycatch/test003/dx/Tests.java | 34 + .../jack/trycatch/test003/jack/TryCatch.java | 27 + .../jack/trycatch/test004/jack/TryCatch.java | 57 + .../android/jack/trycatch/test005/dx/Tests.java | 35 + .../jack/trycatch/test005/jack/TryCatch.java | 33 + .../jack/tryfinally/finally002/dx/Tests.java | 96 + .../jack/tryfinally/finally002/jack/Data.java | 240 ++ .../tryfinally/finally002/jack/TestException.java | 38 + .../jack/tryfinally/finally003/dx/Tests.java | 32 + .../tryfinally/finally003/jack/Finally003.java | 41 + .../jack/tryfinally/finally004/dx/Tests.java | 32 + .../tryfinally/finally004/jack/Finally004.java | 36 + .../tryfinally/finally005/jack/Finally005.java | 49 + .../jack/tryfinally/finallyblock/dx/Tests.java | 120 + .../jack/tryfinally/finallyblock/jack/B.java | 21 + .../tryfinally/finallyblock/jack/Branching.java | 173 + .../jack/tryfinally/finallyblock/jack/Catch.java | 133 + .../tryfinally/finallyblock/jack/EmptyBlocks.java | 100 + .../jack/tryfinally/finallyblock/jack/Nested.java | 633 +++ .../com/android/jack/type/test001/dx/Tests.java | 28 + .../jack/type/test001/jack/DataInputStream.java | 31 + .../com/android/jack/type/test002/dx/Tests.java | 30 + .../com/android/jack/type/test002/jack/Data.java | 42 + .../com/android/jack/unary/test001/dx/Tests.java | 58 + .../com/android/jack/unary/test001/jack/Unary.java | 47 + .../com/android/jack/unary/test002/dx/Tests.java | 86 + .../com/android/jack/unary/test002/jack/Unary.java | 103 + .../com/android/jack/unary/test003/dx/Tests.java | 35 + .../com/android/jack/unary/test003/jack/Cast.java | 28 + .../com/android/jack/unary/test004/dx/Tests.java | 63 + .../com/android/jack/unary/test004/jack/Data.java | 46 + .../com/android/jack/unary/test005/dx/Tests.java | 46 + .../android/jack/unary/test005/jack/UnaryNot.java | 42 + .../com/android/jack/verify/test001/dx/Tests.java | 28 + .../jack/verify/test001/jack/Conversion.java | 136 + 1865 files changed, 62641 insertions(+) create mode 100644 jack-tests/tests/com/android/jack/analysis/dfa/reachingdefs/test001/jack/Dfa001.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated1.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated2.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated3.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated4.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated5.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation1.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation10.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation11.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation12.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation13.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation14.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation2.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation3.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation4.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation5.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation6.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation7.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation8.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation9.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/Constants.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test001/jack/OneEnum.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test002/jack/Annotated.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test003/jack/Target.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/dx/empty/package-info.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/dx/sub/Dummy.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/dx/sub/package-info.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/jack/PackageAnnotation.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/jack/empty/package-info.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/jack/sub/Dummy.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test005/jack/sub/package-info.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest2.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/jack/SuperClass.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface1.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface2.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test007/jack/Thrower.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test008/dx/Ref008.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test008/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test008/jack/Annotation008.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test009/dx/Annotation009Ref.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test009/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/annotation/test009/jack/Annotation009.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Add.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/And.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Div.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mod.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mul.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Or.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shl.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shr.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Sub.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Ushr.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test001/jack/Xor.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Add.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/And.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Div.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mod.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mul.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Or.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shl.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shr.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Sub.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Ushr.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test002/jack/Xor.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/arithmetic/test003/jack/ZeroUsage.java create mode 100644 jack-tests/tests/com/android/jack/array/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/array/test001/jack/ArrayTest.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/assertion/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/assign/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/assign/jack/Assignments.java create mode 100644 jack-tests/tests/com/android/jack/block/test001/jack/ImplicitBlockSample.java create mode 100644 jack-tests/tests/com/android/jack/box/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/box/test001/jack/Box001.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test001/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test001/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/dx/TestsWithDx.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/jack/Generic.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test002/jack/TestsWithJack.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test005/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test006/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test007/jack/Caller.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test007/jack/sub/GenericPackageProtected.java create mode 100644 jack-tests/tests/com/android/jack/bridge/test007/jack/sub/PublicExtendsGeneric.java create mode 100644 jack-tests/tests/com/android/jack/cast/explicit001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/explicit001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/implicit005/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/useless001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/useless001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/cast/useless002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/cast/useless002/jack/UselessCast.java create mode 100644 jack-tests/tests/com/android/jack/cast/useless003/jack/UselessCast.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test001/jack/Classpath001.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test001/lib/Classpath001Lib.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test002/jack/Classpath002.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test002/lib1/A.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test002/lib1override/A.java create mode 100644 jack-tests/tests/com/android/jack/classpath/test002/lib2/B.java create mode 100644 jack-tests/tests/com/android/jack/clinit/jack/ClInit.java create mode 100644 jack-tests/tests/com/android/jack/clinit/jack/ClInitWithVariableInit.java create mode 100644 jack-tests/tests/com/android/jack/comparison/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/comparison/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test001/jack/Conditional.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/C1.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/C2.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/Conditional2.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/I1.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test002/jack/I2.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test004/jack/Conditional004.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test005/jack/Conditional005.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test006/jack/ConditionalTest006.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/conditional/test007/jack/ConditionalTest007.java create mode 100644 jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/constant/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test001/jack/Constant.java create mode 100644 jack-tests/tests/com/android/jack/constant/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test002/jack/ConstantReuse.java create mode 100644 jack-tests/tests/com/android/jack/constant/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test003/jack/Constant003.java create mode 100644 jack-tests/tests/com/android/jack/constant/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test004/jack/Constant004.java create mode 100644 jack-tests/tests/com/android/jack/constant/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test005/jack/Constant005.java create mode 100644 jack-tests/tests/com/android/jack/constant/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test006/jack/Constant006.java create mode 100644 jack-tests/tests/com/android/jack/constant/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/constant/test007/jack/Constant007.java create mode 100644 jack-tests/tests/com/android/jack/constant/test008/jack/Constant008.java create mode 100644 jack-tests/tests/com/android/jack/debug/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/debug/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/debug/test001/test.mk create mode 100644 jack-tests/tests/com/android/jack/debug/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/debug/test002/jack/Debug002.java create mode 100644 jack-tests/tests/com/android/jack/debug/test003/jack/Debug003.java create mode 100644 jack-tests/tests/com/android/jack/debug/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/debug/test004/jack/Debug004.java create mode 100644 jack-tests/tests/com/android/jack/debug/test005/jack/ImplicitReturn.java create mode 100644 jack-tests/tests/com/android/jack/debug/test006/jack/MultipleLineStatement.java create mode 100644 jack-tests/tests/com/android/jack/debug/test007/jack/Test007.java create mode 100644 jack-tests/tests/com/android/jack/debug/test008/jack/Test008.java create mode 100644 jack-tests/tests/com/android/jack/debug/test009/jack/Test009.java create mode 100644 jack-tests/tests/com/android/jack/debug/test010/jack/Test010.java create mode 100644 jack-tests/tests/com/android/jack/debug/test011/jack/Test011.java create mode 100644 jack-tests/tests/com/android/jack/debug/test012/jack/Debug012.java create mode 100644 jack-tests/tests/com/android/jack/debug/test013/jack/Debug013.java create mode 100644 jack-tests/tests/com/android/jack/debug/test014/jack/Debug014.java create mode 100644 jack-tests/tests/com/android/jack/debug/test019/jack/Debug019.java create mode 100644 jack-tests/tests/com/android/jack/dx/compiler/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/dx/compiler/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/dx/optimizer/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/dx/optimizer/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/dx/overlapping/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/dx/overlapping/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/dx/regallocator/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/enums/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/enums/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/enums/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/enums/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/jack/Other.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/jack/Values.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/link/Other.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/link/Values.java create mode 100644 jack-tests/tests/com/android/jack/enums/test003/test.mk create mode 100644 jack-tests/tests/com/android/jack/error/test001/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/error/test002/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/external/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/external/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/external/test001/lib/Data2.java create mode 100644 jack-tests/tests/com/android/jack/fibonacci/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/fibonacci/jack/Fibo.java create mode 100644 jack-tests/tests/com/android/jack/fibonacci/jack/FibonacciThreeAddress.java create mode 100644 jack-tests/tests/com/android/jack/field/instance001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/instance001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/instance002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/instance002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/instance003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/instance003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/instance003/jack/other/ProtectedClass.java create mode 100644 jack-tests/tests/com/android/jack/field/instance003/jack/other/PublicClass.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data10.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data11.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data2.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data3.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data4.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data5.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data6.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data7.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data8.java create mode 100644 jack-tests/tests/com/android/jack/field/instance004/jack/Data9.java create mode 100644 jack-tests/tests/com/android/jack/field/instance005/jack/InstanceField.java create mode 100644 jack-tests/tests/com/android/jack/field/static001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/static001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/static002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/static002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/field/static003/jack/StaticField.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data1.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data2.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data3.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data4.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data5.java create mode 100644 jack-tests/tests/com/android/jack/field/static004/jack/Data6.java create mode 100644 jack-tests/tests/com/android/jack/field/static005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/field/static005/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/flow/cfg001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/flow/cfg001/jack/LinkIterator.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/InfiniteLoop.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileBreak.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileContinue.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileLiteral.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopForBreak.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopForContinue.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopInInit.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileBreak.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileContinue.java create mode 100644 jack-tests/tests/com/android/jack/flow/loop/jack/NoMoreStatementBug.java create mode 100644 jack-tests/tests/com/android/jack/generic/basic/jack/Generic.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/advancedTest/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/advancedTest/jack/IfAdvanced.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/cfgTest/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/cfgTest/jack/IfCfg.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/fastpath/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/fastpath/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/simpleTest/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/ifstatement/simpleTest/jack/If.java create mode 100644 jack-tests/tests/com/android/jack/init/test001/jack/EmptyConstructor.java create mode 100644 jack-tests/tests/com/android/jack/init/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/init/test002/jack/EmptyClass.java create mode 100644 jack-tests/tests/com/android/jack/inner/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test005/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test006/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test007/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test008/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test008/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test008/lib/Data2.java create mode 100644 jack-tests/tests/com/android/jack/inner/test009/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test009/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test010/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test010/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test011/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test011/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test011/jack/Data2.java create mode 100644 jack-tests/tests/com/android/jack/inner/test012/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test012/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test012/lib/Data2.java create mode 100644 jack-tests/tests/com/android/jack/inner/test013/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test013/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test014/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test014/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test015/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test015/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/inner/test015/lib/A.java create mode 100644 jack-tests/tests/com/android/jack/inner/test016/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test016/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/inner/test016/jack/bis/B.java create mode 100644 jack-tests/tests/com/android/jack/inner/test017/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test017/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test018/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test018/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/inner/test019/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test019/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test020/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test020/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test021/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test021/jack/Outer.java create mode 100644 jack-tests/tests/com/android/jack/inner/test022/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test022/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test022/jack/Sum.java create mode 100644 jack-tests/tests/com/android/jack/inner/test023/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test023/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test024/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test024/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test025/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/inner/test026/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/inner/test026/jack/D.java create mode 100644 jack-tests/tests/com/android/jack/inner/test026/jack/pkg/C.java create mode 100644 jack-tests/tests/com/android/jack/instance/test001/jack/Instance.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeClone.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeDirect.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterface.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputation.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputationImpl.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeStatic.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuper.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass1.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass2.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeVirtual.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test003/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test003/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test003/jack/sub/A.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test003/jack/sub/B.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test004/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test004/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test004/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test005/jack/Caller.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test005/lib/SubClass.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test005/lib/SuperClass.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test006/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test006/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test006/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/invoke/test006/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/DummyAnnot.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/sub/two/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/two/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/C.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/C.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/star/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/star/C.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/C.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/jarjar-rules.txt create mode 100644 jack-tests/tests/com/android/jack/jarjar/test001/test.mk create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/jack/D.java create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/jarjar-rules.txt create mode 100644 jack-tests/tests/com/android/jack/jarjar/test003/test.mk create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test001/jack/ExceptionTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test002/jack/ExceptionTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test003/jack/ExceptionTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test004/jack/ExceptionTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/exceptions/test005/jack/ExceptionTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/parser/literals/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/parser/literals/test001/jack/BinaryNotationTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/parser/literals/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/parser/literals/test002/jack/UnderscoreNotationTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test001/jack/SwitchTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test002/jack/SwitchTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/switches/test003/jack/SwitchTest.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/Observer.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/TryWithResourcesTest001.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable001.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable002.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/Observer.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/TryWithResourcesTest002.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable001.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002b.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable003.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E1.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E2.java create mode 100644 jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E3.java create mode 100644 jack-tests/tests/com/android/jack/label/test001/jack/Label.java create mode 100644 jack-tests/tests/com/android/jack/liboflib/lib/jack/Lib.java create mode 100644 jack-tests/tests/com/android/jack/liboflib/lib2/jack/LibOfLib.java create mode 100644 jack-tests/tests/com/android/jack/liboflib/main/jack/Main.java create mode 100644 jack-tests/tests/com/android/jack/modifier/jack/FieldEnumModifier.java create mode 100644 jack-tests/tests/com/android/jack/modifier/jack/FieldInnerModifier.java create mode 100644 jack-tests/tests/com/android/jack/modifier/jack/FieldModifier.java create mode 100644 jack-tests/tests/com/android/jack/modifier/jack/MethodModifier.java create mode 100644 jack-tests/tests/com/android/jack/modifier/jack/TypeModifier.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test003/jack/ArrayReuse.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/newarray/test005/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/nopackage/jack/ClassInDefaultPackage.java create mode 100644 jack-tests/tests/com/android/jack/nopackage/jack/InnerInDefaultPackage.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_double/Test_add_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_float/Test_add_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/Test_add_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_10.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_long/Test_add_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/Test_aget.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_byte/Test_aget_byte.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_byte/jm/T_aget_byte_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_char/Test_aget_char.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_char/jm/T_aget_char_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/Test_aget_object.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_short/Test_aget_short.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/Test_aget_wide.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_int/Test_and_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_long/Test_and_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/Test_aput.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_byte/Test_aput_byte.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_byte/jm/T_aput_byte_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_char/Test_aput_char.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_object/Test_aput_object.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_10.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_short/Test_aput_short.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_wide/Test_aput_wide.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/array_length/Test_array_length.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/check_cast/Test_check_cast.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/check_cast/jm/T_check_cast_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmp_long/Test_cmp_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_double/Test_cmpg_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_float/Test_cmpg_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpl_double/Test_cmpl_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpl_double/jm/T_cmpl_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpl_float/Test_cmpl_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/Test_const4_16.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_10.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_11.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_16.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_17.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_string/Test_const_string.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_string/jm/T_const_string_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/Test_const_wide.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_double/Test_div_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_float/Test_div_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_int/Test_div_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_long/Test_div_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_float/Test_double_to_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_int/Test_double_to_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_long/Test_double_to_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_double/Test_float_to_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_int/Test_float_to_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_long/Test_float_to_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eq/Test_if_eq.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eqz/Test_if_eqz.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ge/Test_if_ge.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gez/Test_if_gez.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gt/Test_if_gt.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gtz/Test_if_gtz.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_le/Test_if_le.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lez/Test_if_lez.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lt/Test_if_lt.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ltz/Test_if_ltz.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ne/Test_if_ne.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_nez/Test_if_nez.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/Test_iget.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_11.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iget/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_byte/Test_int_to_byte.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_char/Test_int_to_char.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_double/Test_int_to_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_float/Test_int_to_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_long/Test_int_to_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_short/Test_int_to_short.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_direct/Test_invoke_direct.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/TSuper.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_21.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/Test_invoke_interface.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITest.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImpl.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImplAbstract.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_17.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_19.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_23.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/Test_invoke_static.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_18.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_20.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClass.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassAbstract.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassInitError.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/Test_invoke_super.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_18.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_19.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_26.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/TProtected.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/Test_invoke_virtual.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/ATest.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TPlain.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_17.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_19.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_22.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_23.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/TIput.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/Test_iput.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_16.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_18.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/iput/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_double/Test_long_to_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_float/Test_long_to_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_int/Test_long_to_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/monitor_enter/Test_monitor_enter.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_double/Test_mul_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_float/Test_mul_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_int/Test_mul_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_long/Test_mul_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_double/Test_neg_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_double/jm/T_neg_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_float/Test_neg_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_float/jm/T_neg_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_int/Test_neg_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/Test_neg_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/Test_new_array.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_const/Test_opc_const.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_goto/Test_opc_goto.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_instanceof/Test_opc_instanceof.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/T_opc_instanceof_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_new/Test_opc_new.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_new/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/Test_opc_return.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_10.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_11.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_throw/Test_opc_throw.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_int/Test_or_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_long/Test_or_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/packed_switch/Test_packed_switch.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/packed_switch/jm/T_packed_switch_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_double/Test_rem_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_float/Test_rem_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_int/Test_rem_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_long/Test_rem_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/Runner.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/RunnerGenerator.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/Test_return_object.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_15.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_object/jm/TetsStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/Test_return_wide.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_10.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_11.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_12.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_7.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_8.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/Test_sget.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_11.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_9.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sget/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_int/Test_shl_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_long/Test_shl_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_int/Test_shr_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_long/Test_shr_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sparse_switch/Test_sparse_switch.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sparse_switch/jm/T_sparse_switch_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/Test_sput.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_13.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_14.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_16.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_18.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_2.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_6.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sput/jm/TestStubs.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_double/Test_sub_double.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_float/Test_sub_float.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_int/Test_sub_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_long/Test_sub_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/test-opcodes.mk create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_int/Test_ushr_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_long/Test_ushr_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_5.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_int/Test_xor_int.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_long/Test_xor_long.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_1.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_3.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_4.java create mode 100644 jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_5.java create mode 100644 jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/jack/ExprSimplifier.java create mode 100644 jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/jack/NotSimplifier.java create mode 100644 jack-tests/tests/com/android/jack/optimizations/uselesscopy/test001/jack/Test001.java create mode 100644 jack-tests/tests/com/android/jack/order/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/order/jack/Order.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/return001/jack/Return.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/returns/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/returns/jack/MultipleReturn.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/returns/jack/ReturnVoid.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/returnvoid/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/returnstatement/returnvoid/jack/ReturnVoid.java create mode 100644 jack-tests/tests/com/android/jack/shrob/dontobfuscate.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/keepAllAttributes.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/keepDebugInfo.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/keepPackageName.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/printmapping.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/repackageClasses.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/D.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/E.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/F.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/G.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/H.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/J.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/K.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/L.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022 create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-009.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-010.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-011.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-012.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-013.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-014.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-015.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-016.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-017.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-018.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-019.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-020.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-021.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-022.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/lib/Test.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test003/test.jar create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/jack/Annot.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/jack/Annot2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/jack/E.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008 create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-007.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-008.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006 create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-005.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-006.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/jack/MyException.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/jack/MyException2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004 create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-004.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003 create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-003.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/dx/Tests2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/test.mk create mode 100644 jack-tests/tests/com/android/jack/shrob/test011/test2.mk create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test012/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test013/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test014/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test015/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/applyMapping.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/Annot.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/Annot2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/Annot3.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/Annot4.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/Annot5.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/jack/KeepClass.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test016/test.mk create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect3.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test017/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test018/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test019/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test020/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test020/jack/Shrob020.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test020/lib/Shrob20Lib.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test020/proguard.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/jack/Shrob021.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test021/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/jack/Shrob022.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test022/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/jack/Outer.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test023/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test024/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test024/jack/Keep.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test024/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/jack/Keep.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test025/test.mk create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/includedflags create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/jack/Enum.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test026/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test027/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.class create mode 100644 jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test027/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test027/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test028/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test028/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/D.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/E.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/F.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/G.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test029/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test030/test.mk create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/D.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/E.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/F.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/I2.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test031/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/jack/C.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/jack/I.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test032/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/mapping.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/mapping2.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/proguard.flags002 create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-002.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/mapping.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test034/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/mapping.flags create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test035/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/jack/E.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test036/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/jack/A.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001.mapping create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test037/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/info.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/jack/Element.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/jack/Kept.java create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/proguard.flags001 create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsFlattenPackage/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithoutMapping/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsRepackageClasses/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsSeed/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/shrob/test038/refsShrinking/expected-001.txt create mode 100644 jack-tests/tests/com/android/jack/string/concat001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/string/concat001/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/string/concat002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/string/concat002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/string001/jack/Strings.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test001/jack/Switches001.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test002/jack/Switches002.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test003/jack/Switches003.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test005/jack/Switch.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test006/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test006/jack/Switch.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test007/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test007/jack/Switch.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test008/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test008/jack/Switch.java create mode 100644 jack-tests/tests/com/android/jack/switchstatement/test009/jack/Switch.java create mode 100644 jack-tests/tests/com/android/jack/synchronize/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/synchronize/test001/jack/Synchronize.java create mode 100644 jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized.java create mode 100644 jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized2.java create mode 100644 jack-tests/tests/com/android/jack/threeaddress/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode001.java create mode 100644 jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode002.java create mode 100644 jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode003.java create mode 100644 jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCodeUtil001.java create mode 100644 jack-tests/tests/com/android/jack/throwstatement/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/throwstatement/test001/jack/ThrowStmt.java create mode 100644 jack-tests/tests/com/android/jack/transformations/cast/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test001/jack/TryCatch.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test002/jack/TryCatch.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test003/jack/TryCatch.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test004/jack/TryCatch.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/trycatch/test005/jack/TryCatch.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally002/jack/TestException.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally003/jack/Finally003.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally004/jack/Finally004.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finally005/jack/Finally005.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/B.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Branching.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Catch.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/EmptyBlocks.java create mode 100644 jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Nested.java create mode 100644 jack-tests/tests/com/android/jack/type/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/type/test001/jack/DataInputStream.java create mode 100644 jack-tests/tests/com/android/jack/type/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/type/test002/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/unary/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/unary/test001/jack/Unary.java create mode 100644 jack-tests/tests/com/android/jack/unary/test002/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/unary/test002/jack/Unary.java create mode 100644 jack-tests/tests/com/android/jack/unary/test003/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/unary/test003/jack/Cast.java create mode 100644 jack-tests/tests/com/android/jack/unary/test004/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/unary/test004/jack/Data.java create mode 100644 jack-tests/tests/com/android/jack/unary/test005/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/unary/test005/jack/UnaryNot.java create mode 100644 jack-tests/tests/com/android/jack/verify/test001/dx/Tests.java create mode 100644 jack-tests/tests/com/android/jack/verify/test001/jack/Conversion.java (limited to 'jack-tests/tests/com') diff --git a/jack-tests/tests/com/android/jack/analysis/dfa/reachingdefs/test001/jack/Dfa001.java b/jack-tests/tests/com/android/jack/analysis/dfa/reachingdefs/test001/jack/Dfa001.java new file mode 100644 index 00000000..279d6d70 --- /dev/null +++ b/jack-tests/tests/com/android/jack/analysis/dfa/reachingdefs/test001/jack/Dfa001.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.analysis.dfa.reachingdefs.test001.jack; + +public class Dfa001 { + + public int dfaWithSwitch(int i) { + int result = 0; + switch (i) { + case 3: + case 1: { + result = result + 2; + break; + } + case 2: { + return 2; + } + default: { + break; + } + } + result = result + 2; + return result; + } + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test001/dx/Tests.java new file mode 100644 index 00000000..f5fe544f --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/dx/Tests.java @@ -0,0 +1,238 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.dx; + +import com.android.jack.annotation.test001.jack.Annotated1; +import com.android.jack.annotation.test001.jack.Annotated2; +import com.android.jack.annotation.test001.jack.Annotated3; +import com.android.jack.annotation.test001.jack.Annotated4; +import com.android.jack.annotation.test001.jack.Annotated5; +import com.android.jack.annotation.test001.jack.Annotation1; +import com.android.jack.annotation.test001.jack.Annotation10; +import com.android.jack.annotation.test001.jack.Annotation11; +import com.android.jack.annotation.test001.jack.Annotation12; +import com.android.jack.annotation.test001.jack.Annotation13; +import com.android.jack.annotation.test001.jack.Annotation14; +import com.android.jack.annotation.test001.jack.Annotation2; +import com.android.jack.annotation.test001.jack.Annotation3; +import com.android.jack.annotation.test001.jack.Annotation4; +import com.android.jack.annotation.test001.jack.Annotation5; +import com.android.jack.annotation.test001.jack.Annotation6; +import com.android.jack.annotation.test001.jack.Annotation7; +import com.android.jack.annotation.test001.jack.Annotation8; +import com.android.jack.annotation.test001.jack.Annotation9; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +public class Tests { + + @Test + public void test1() { + Class annotation1 = Annotation1.class; + Assert.assertTrue(annotation1.isAnnotation()); + Field[] declaredFields = annotation1.getDeclaredFields(); + Assert.assertEquals(0, declaredFields.length); + Method[] declaredMethods = annotation1.getDeclaredMethods(); + Assert.assertEquals(0, declaredMethods.length); + Assert.assertNull(annotation1.getSuperclass()); + Assert.assertEquals(1, annotation1.getInterfaces().length); + Assert.assertEquals(Annotation.class, annotation1.getInterfaces()[0]); + } + @Test + public void test2() { + Class annotation2 = Annotation2.class; + Assert.assertTrue(annotation2.isAnnotation()); + Field[] declaredFields = annotation2.getDeclaredFields(); + Assert.assertEquals(0, declaredFields.length); + Method[] declaredMethods = annotation2.getDeclaredMethods(); + Assert.assertEquals(1, declaredMethods.length); + Method value = declaredMethods[0]; + Assert.assertEquals("value", value.getName()); + Assert.assertEquals(0, value.getParameterTypes().length); + Assert.assertEquals(Integer.TYPE, value.getReturnType()); + + + Assert.assertNull(annotation2.getSuperclass()); + Assert.assertEquals(1, annotation2.getInterfaces().length); + Assert.assertEquals(Annotation.class, annotation2.getInterfaces()[0]); + } + + @Test + public void test3() { + Class annotation1 = Annotation2.class; + + Method[] declaredMethods = annotation1.getDeclaredMethods(); + Method value = declaredMethods[0]; + Assert.assertEquals(Integer.valueOf(6), value.getDefaultValue()); + } + @Test + public void test4() { + Class annotation3 = Annotation3.class; + Assert.assertTrue(annotation3.isAnnotation()); + Field[] declaredFields = annotation3.getDeclaredFields(); + Assert.assertEquals(0, declaredFields.length); + Method[] declaredMethods = annotation3.getDeclaredMethods(); + Assert.assertEquals(2, declaredMethods.length); + for (Method method : declaredMethods) { + if ("annotationValue1".equals(method.getName())) { + Assert.assertEquals(Annotation1.class, method.getReturnType()); + Assert.assertNull(method.getDefaultValue()); + } else { + Assert.assertEquals(Annotation2.class, method.getReturnType()); + Assert.assertEquals("annotationValue2", method.getName()); + } + } + + Assert.assertNull(annotation3.getSuperclass()); + Assert.assertEquals(1, annotation3.getInterfaces().length); + Assert.assertEquals(Annotation.class, annotation3.getInterfaces()[0]); + } + + @Test + public void test5() { + Class annotation3 = Annotation3.class; + Method[] declaredMethods = annotation3.getDeclaredMethods(); + for (Method method : declaredMethods) { + if ("annotationValue1".equals(method.getName())) { + // checked in test4 + } else { + Assert.assertTrue(method.getDefaultValue() instanceof Annotation2); + } + } + } + + @Test + public void test6() { + printAllAnnotations(Annotation1.class); + printAllAnnotations(Annotation2.class); + printAllAnnotations(Annotation3.class); + printAllAnnotations(Annotation4.class); + printAllAnnotations(Annotation5.class); + printAllAnnotations(Annotation6.class); + printAllAnnotations(Annotation7.class); + printAllAnnotations(Annotation8.class); + printAllAnnotations(Annotation9.class); + printAllAnnotations(Annotation10.class); + printAllAnnotations(Annotation11.class); + printAllAnnotations(Annotation12.class); + printAllAnnotations(Annotation13.class); + printAllAnnotations(Annotation14.class); + printAllAnnotations(Annotated2.class); + printAllAnnotations(Annotated3.class); + printAllAnnotations(Annotated1.class); + printAllAnnotations(Annotated4.class); + + } + + @Test + public void test7() { + Class annotated = Annotated4.class; + Annotation11 annotation = annotated.getAnnotation(Annotation11.class); + Assert.assertEquals(void.class, annotation.value()); + } + + @Test + public void test8() { + Class annotated = Annotated5.class; + Annotation12 annotation = annotated.getAnnotation(Annotation12.class); + Assert.assertTrue(annotation.value()); + } + + @Test + public void test9() { + printAnnotation(Annotation1.class); + printAnnotation(Annotation2.class); + printAnnotation(Annotation3.class); + printAnnotation(Annotation4.class); + printAnnotation(Annotation5.class); + printAnnotation(Annotation6.class); + printAnnotation(Annotation7.class); + printAnnotation(Annotation8.class); + printAnnotation(Annotation9.class); + printAnnotation(Annotation10.class); + printAnnotation(Annotation11.class); + printAnnotation(Annotation12.class); + printAnnotation(Annotation13.class); + printAnnotation(Annotation14.class); + } + + private static void printAllAnnotations(Class clazz) { + printAnnotations(clazz.getAnnotations()); + System.out.println("class " + clazz.getName() + " {"); + System.out.println(); + + for (Field field : clazz.getDeclaredFields()) { + printAnnotations(field.getAnnotations()); + System.out.println(" " + field.getType() + " " + field.getName() + ";"); + System.out.println(); + } + + for (Method method : clazz.getDeclaredMethods()) { + printAnnotations(method.getAnnotations()); + System.out.print(" " + method.getReturnType() + " " + method.getName() + "("); + Annotation[][] parameterAnnotations = method.getParameterAnnotations(); + Class[] parameterTypes = method.getParameterTypes(); + for (int i = 0; i < parameterTypes.length; i++) { + printAnnotations(parameterAnnotations[i]); + System.out.print(parameterTypes[i] + " arg" + i); + if (i < parameterTypes.length - 1) { + System.out.print(", "); + } + } + System.out.print(")"); + if (method.getDefaultValue() != null) { + System.out.print(" = " + method.getDefaultValue()); + } + System.out.println(); + System.out.println(); + } + System.out.println("}"); + } + + private static void printAnnotation(Class annotationClass) { + System.out.println("@interface " + annotationClass.getName() + " {"); + + for (Method method : annotationClass.getDeclaredMethods()) { + System.out.print(" " + method.getReturnType() + " " + method.getName()); + Object defaultValue = method.getDefaultValue(); + if (defaultValue != null) { + System.out.print(" default " + defaultValue); + } + System.out.println(";"); + } + System.out.println("}"); + + } + + private static void printAnnotations(Annotation[] annotations) { + for (Annotation annotation : annotations) { + printAnnotation(annotation); + } + } + /** + * @param annotation + */ + private static void printAnnotation(Annotation annotation) { + System.out.println(annotation); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated1.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated1.java new file mode 100644 index 00000000..1fc4fc22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated1.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +@Annotation9(OneEnum.C) +@Annotation7(Annotation1.class) +@Annotation1 +@Annotation2 +@Annotation3(annotationValue1 = @Annotation1) +@Annotation4 +@Annotation5 +@Annotation6(annotationValue1 = {@Annotation1, @Annotation1, @Annotation1()}, +annotationValue2 = {@Annotation2(1), @Annotation2(5), @Annotation2(Constants.C3), @Annotation2}) +@Annotation8({1, 2 ,4 , (byte) 255}) +public class Annotated1 { + + @Annotation1 + private int field; + + @Deprecated + public void method() { + + } + + public int method2(int a, @Annotation1 int b) { + @Annotation5 + int result = 0; + for (@Annotation4 int i = 0; i < 3; i++) { + result ++; + } + + new Runnable() { + + @Override + public void run() { + } + }; + return result; + } + + @Annotation1 + private static class Annotated2 { + + @Annotation1 + private int field; + + @Deprecated + public void method() { + + } + + public int method2(int a, @Annotation1 int b) { + @Annotation5 + int result = 0; + for (@Annotation4 int i = 0; i < 3; i++) { + result ++; + } + return result; + } + } + + @Annotation11(int.class) + public void method3() { + + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated2.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated2.java new file mode 100644 index 00000000..f6e2d55b --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +@Annotation8({1, 2 ,4 , (byte) 255}) +public class Annotated2 { +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated3.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated3.java new file mode 100644 index 00000000..c485d0ae --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated3.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +@Annotation7(String.class) +public class Annotated3 { +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated4.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated4.java new file mode 100644 index 00000000..aff7236d --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated4.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +@Annotation11(void.class) +public class Annotated4 { +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated5.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated5.java new file mode 100644 index 00000000..d28f71ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotated5.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +@Annotation12(true) +public class Annotated5 { +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation1.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation1.java new file mode 100644 index 00000000..8bb6f5e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation1.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation1 { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation10.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation10.java new file mode 100644 index 00000000..ea8556e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation10.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation10 { + long[] value() default {1, 2, ' ', (byte) 4}; + float[] v2() default {1, 2, 3.0f, (byte)4, 'e'}; + double[] v3() default {1, 2.4, 3.0f, (byte)4, 'e'}; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation11.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation11.java new file mode 100644 index 00000000..e4a9a137 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation11.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation11 { + Class value() default int.class; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation12.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation12.java new file mode 100644 index 00000000..781e9abb --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation12.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation12 { + boolean value() default false; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation13.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation13.java new file mode 100644 index 00000000..db8b9c1b --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation13.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation13 { + byte value1() default 1; + char value2() default 0x32; + char value3() default '3'; + short value4() default 4; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation14.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation14.java new file mode 100644 index 00000000..5f593662 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation14.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation14 { + byte[] value1() default 1; + char[] value2() default 0x32; + char[] value3() default '3'; + short[] value4() default 4; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation2.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation2.java new file mode 100644 index 00000000..f6c3d4ac --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation2 { + int value() default 1 + 5; + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation3.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation3.java new file mode 100644 index 00000000..b8b33b4c --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation3.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation3 { + + Annotation1 annotationValue1(); + Annotation2 annotationValue2() default @Annotation2; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation4.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation4.java new file mode 100644 index 00000000..c4afbddd --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.CLASS) +public @interface Annotation4 { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation5.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation5.java new file mode 100644 index 00000000..22fdf9ff --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation5.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.SOURCE) +public @interface Annotation5 { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation6.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation6.java new file mode 100644 index 00000000..edf3e3cb --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation6.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation6 { + + Annotation1[] annotationValue1() default {}; + Annotation2[] annotationValue2() default {@Annotation2, @Annotation2(1)}; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation7.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation7.java new file mode 100644 index 00000000..ce255d37 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation7.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation7 { + Class[] value() default Object.class; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation8.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation8.java new file mode 100644 index 00000000..aff4cbb1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation8.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation8 { + byte[] value() default {1, 2, 3, 4}; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation9.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation9.java new file mode 100644 index 00000000..f6f1235d --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Annotation9.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annotation9 { + OneEnum value() default OneEnum.B; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/Constants.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/Constants.java new file mode 100644 index 00000000..053dd18b --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/Constants.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +public class Constants { + + public static final int C1 = 0; + public static final int C2 = C1 + 2; + public static final int C3 = C1 + C2; + public static final int C4 = 14; + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test001/jack/OneEnum.java b/jack-tests/tests/com/android/jack/annotation/test001/jack/OneEnum.java new file mode 100644 index 00000000..20458278 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test001/jack/OneEnum.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test001.jack; + +public enum OneEnum { + A, B, C, D; + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test002/dx/Tests.java new file mode 100644 index 00000000..f70c4e92 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test002/dx/Tests.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test002.dx; + +import com.android.jack.annotation.test002.jack.Annotated; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + + +public class Tests { + + @Test + public void test1() { + Class annotated = Annotated.class; + Retention retention = annotated.getAnnotation(Retention.class); + Assert.assertNotNull(retention); + Assert.assertEquals(RetentionPolicy.CLASS, retention.value()); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test002/jack/Annotated.java b/jack-tests/tests/com/android/jack/annotation/test002/jack/Annotated.java new file mode 100644 index 00000000..1d2f5e3f --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test002/jack/Annotated.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test002.jack; + +import static java.lang.annotation.RetentionPolicy.CLASS; + +import java.lang.annotation.Retention; + +@Retention(CLASS) +public @interface Annotated { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test003/dx/Tests.java new file mode 100644 index 00000000..1aaf63c5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test003/dx/Tests.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test003.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.annotation.test003.jack.Target; + + +public class Tests { + + @Test + public void test1() { + Class annotated = Target.class; + Assert.assertTrue(annotated.isInterface()); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test003/jack/Target.java b/jack-tests/tests/com/android/jack/annotation/test003/jack/Target.java new file mode 100644 index 00000000..e6af2edb --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test003/jack/Target.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test003.jack; + +import java.lang.annotation.ElementType; + +@Target(ElementType.ANNOTATION_TYPE) +public @interface Target { + ElementType[] value(); +} diff --git a/jack-tests/tests/com/android/jack/annotation/test004/jack/Data.java b/jack-tests/tests/com/android/jack/annotation/test004/jack/Data.java new file mode 100644 index 00000000..72d176cb --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test004/jack/Data.java @@ -0,0 +1,31 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test004.jack; + + + +@SuppressWarnings("") +final class Data> { + + @SuppressWarnings("") + public E f; + + @SuppressWarnings("") + public static > E get() { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test005/dx/Tests.java new file mode 100644 index 00000000..50ee60bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/dx/Tests.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test005.dx; + +import com.android.jack.annotation.test005.jack.PackageAnnotation; + +import junit.framework.Assert; + +import org.junit.Ignore; +import org.junit.Test; + + +public class Tests { + + @Test + public void refTest001() { + checkPackage(com.android.jack.annotation.test005.dx.sub.Dummy.class.getPackage()); + checkPackage("com.android.jack.annotation005.dx.sub"); + } + + @Test + @Ignore("An empty package is not \"observable\"") + public void refTest002() { + checkPackage("com.android.jack.annotation005.dx.empty"); + } + + @Test + public void test001() { + checkPackage(com.android.jack.annotation.test005.jack.sub.Dummy.class.getPackage()); + checkPackage("com.android.jack.annotation005.jack.sub"); + } + + @Test + @Ignore("An empty package is not \"observable\"") + public void test002() { + checkPackage("com.android.jack.annotation005.jack.empty"); + } + + void checkPackage(String packageName) { + Package empty = Package.getPackage(packageName); + checkPackage(empty); + } + + void checkPackage(Package empty) { + PackageAnnotation annotation = empty.getAnnotation(PackageAnnotation.class); + Assert.assertNotNull(annotation); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test005/dx/empty/package-info.java b/jack-tests/tests/com/android/jack/annotation/test005/dx/empty/package-info.java new file mode 100644 index 00000000..21ee4b78 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/dx/empty/package-info.java @@ -0,0 +1,3 @@ +@com.android.jack.annotation.test005.jack.PackageAnnotation +package com.android.jack.annotation.test005.dx.empty; + diff --git a/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/Dummy.java b/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/Dummy.java new file mode 100644 index 00000000..c6e5fa41 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/Dummy.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test005.dx.sub; + +public class Dummy { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/package-info.java b/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/package-info.java new file mode 100644 index 00000000..c771ba8f --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/dx/sub/package-info.java @@ -0,0 +1,3 @@ +@com.android.jack.annotation.test005.jack.PackageAnnotation +package com.android.jack.annotation.test005.dx.sub; + diff --git a/jack-tests/tests/com/android/jack/annotation/test005/jack/PackageAnnotation.java b/jack-tests/tests/com/android/jack/annotation/test005/jack/PackageAnnotation.java new file mode 100644 index 00000000..2c452e1a --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/jack/PackageAnnotation.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test005.jack; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.PACKAGE) +@Retention(RetentionPolicy.RUNTIME) +public @interface PackageAnnotation { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test005/jack/empty/package-info.java b/jack-tests/tests/com/android/jack/annotation/test005/jack/empty/package-info.java new file mode 100644 index 00000000..be994546 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/jack/empty/package-info.java @@ -0,0 +1,3 @@ +@com.android.jack.annotation.test005.jack.PackageAnnotation +package com.android.jack.annotation.test005.jack.empty; + diff --git a/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/Dummy.java b/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/Dummy.java new file mode 100644 index 00000000..39d40834 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/Dummy.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test005.jack.sub; + +public class Dummy { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/package-info.java b/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/package-info.java new file mode 100644 index 00000000..45ca2c8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test005/jack/sub/package-info.java @@ -0,0 +1,3 @@ +@com.android.jack.annotation.test005.jack.PackageAnnotation +package com.android.jack.annotation.test005.jack.sub; + diff --git a/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java new file mode 100644 index 00000000..60309bbd --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/dx/Tests.java @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.dx; + + + +import com.android.jack.annotation.test006.jack.ReflectAnnotationsTest; +import com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + + +public class Tests { + + @Test + public void test001() { + ReflectAnnotationsTest test = new ReflectAnnotationsTest(); + Class testClass = test.getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getName()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getCanonicalName()); + Assert.assertEquals("ReflectAnnotationsTest", testClass.getSimpleName()); + Assert.assertEquals("class java.lang.Object", testClass.getSuperclass().toString()); + Assert.assertEquals("class java.lang.Object", testClass.getGenericSuperclass().toString()); + Assert.assertNull(testClass.getDeclaringClass()); + Assert.assertNull(testClass.getEnclosingClass()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 1); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + String declaredClasses = stringifyTypeArray(testClass.getDeclaredClasses()); + boolean testDeclaredClasses = declaredClasses.contains("[2]"); + testDeclaredClasses = testDeclaredClasses && declaredClasses.contains("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClass"); + testDeclaredClasses = testDeclaredClasses && declaredClasses.contains("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClassStatic"); + Assert.assertTrue(testDeclaredClasses); + String memberClasses = stringifyTypeArray(testClass.getClasses()); + boolean memberClassesTest = memberClasses.contains("[2]"); + memberClassesTest = memberClassesTest && memberClasses.contains("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClass"); + memberClassesTest = memberClassesTest && memberClasses.contains("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClassStatic"); + Assert.assertTrue(memberClassesTest); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertFalse(testClass.isLocalClass()); + Assert.assertFalse(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + + + testClass = test.getLocal(3).getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$1C", testClass.getName()); + Assert.assertNull(testClass.getCanonicalName()); + Assert.assertEquals("C", testClass.getSimpleName()); + Assert.assertEquals("class java.lang.Object", testClass.getSuperclass().toString()); + Assert.assertEquals("class java.lang.Object", testClass.getGenericSuperclass().toString()); + Assert.assertNull(testClass.getDeclaringClass()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getEnclosingClass().toString()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertEquals("public java.lang.Object com.android.jack.annotation.test006.jack.ReflectAnnotationsTest.getLocal(int)", testClass.getEnclosingMethod().toString()); + Assert.assertEquals(testClass.getModifiers(), 0); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getDeclaredClasses())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getClasses())); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertTrue(testClass.isLocalClass()); + Assert.assertFalse(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + + + testClass = test.new InnerClass().getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClass", testClass.getName()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest.InnerClass", testClass.getCanonicalName()); + Assert.assertEquals("InnerClass", testClass.getSimpleName()); + Assert.assertEquals("class java.lang.Object", testClass.getSuperclass().toString()); + Assert.assertEquals("class java.lang.Object", testClass.getGenericSuperclass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getDeclaringClass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getEnclosingClass().toString()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 1); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getDeclaredClasses())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getClasses())); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertFalse(testClass.isLocalClass()); + Assert.assertTrue(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + + // --- static inner with inheritance --- + testClass = new ReflectAnnotationsTest.InnerClassStatic().getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest$InnerClassStatic", testClass.getName()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest.InnerClassStatic", testClass.getCanonicalName()); + Assert.assertEquals("InnerClassStatic", testClass.getSimpleName()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.SuperClass", testClass.getSuperclass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.SuperClass", testClass.getGenericSuperclass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getDeclaringClass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest", testClass.getEnclosingClass().toString()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 9); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getDeclaredClasses())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getClasses())); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertFalse(testClass.isLocalClass()); + Assert.assertTrue(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + String genInterfaces = stringifyTypeArray(testClass.getGenericInterfaces()); + boolean testGenInterfaces = genInterfaces.contains("[2]"); + testGenInterfaces = testGenInterfaces && genInterfaces.contains("com.android.jack.annotation.test006.jack.SuperInterface1"); + testGenInterfaces = testGenInterfaces && genInterfaces.contains("com.android.jack.annotation.test006.jack.SuperInterface2"); + Assert.assertTrue(testGenInterfaces); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + } + + @Test + public void test002() { + Class testClass = ReflectAnnotationsTest2.class; + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2", testClass.getName()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2", testClass.getCanonicalName()); + Assert.assertEquals("ReflectAnnotationsTest2", testClass.getSimpleName()); + Assert.assertEquals("class java.lang.Object", testClass.getSuperclass().toString()); + Assert.assertEquals("class java.lang.Object", testClass.getGenericSuperclass().toString()); + Assert.assertNull(testClass.getDeclaringClass()); + Assert.assertNull(testClass.getEnclosingClass()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 1); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + String declaredClasses = stringifyTypeArray(testClass.getDeclaredClasses()); + boolean testDeclared = declaredClasses.contains("[2]"); + testDeclared = testDeclared && declaredClasses.contains("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$Generic2"); + testDeclared = testDeclared && declaredClasses.contains("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$Generic1"); + Assert.assertTrue(testDeclared); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getClasses())); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertFalse(testClass.isLocalClass()); + Assert.assertFalse(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + + + ReflectAnnotationsTest2 test = new ReflectAnnotationsTest2(); + testClass = test.consInnerNamed.getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$1ConsInnerNamed", testClass.getName()); + Assert.assertNull(testClass.getCanonicalName()); + Assert.assertEquals("ConsInnerNamed", testClass.getSimpleName()); + Assert.assertEquals("class java.lang.Object", testClass.getSuperclass().toString()); + Assert.assertEquals("class java.lang.Object", testClass.getGenericSuperclass().toString()); + Assert.assertNull(testClass.getDeclaringClass()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2", testClass.getEnclosingClass().toString()); + Assert.assertEquals("public com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2()", testClass.getEnclosingConstructor().toString()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 0); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getDeclaredClasses())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getClasses())); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertTrue(testClass.isLocalClass()); + Assert.assertFalse(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getTypeParameters())); + + Object gen = test.getGeneric(); + testClass = gen.getClass(); + + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$Generic2", testClass.getName()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2.Generic2", testClass.getCanonicalName()); + Assert.assertEquals("Generic2", testClass.getSimpleName()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$Generic1", testClass.getSuperclass().toString()); + Assert.assertEquals("com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2$Generic1", testClass.getGenericSuperclass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2", testClass.getDeclaringClass().toString()); + Assert.assertEquals("class com.android.jack.annotation.test006.jack.ReflectAnnotationsTest2", testClass.getEnclosingClass().toString()); + Assert.assertNull(testClass.getEnclosingConstructor()); + Assert.assertNull(testClass.getEnclosingMethod()); + Assert.assertEquals(testClass.getModifiers(), 2); + Assert.assertEquals("package com.android.jack.annotation.test006.jack", testClass.getPackage().toString()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getDeclaredClasses())); + String memberClasses = stringifyTypeArray(testClass.getClasses()); + boolean testMemberClasses = memberClasses.contains("java.util.AbstractMap$SimpleEntry"); + testMemberClasses = testMemberClasses && memberClasses.contains("java.util.AbstractMap$SimpleImmutableEntry"); + Assert.assertTrue(testMemberClasses); + Assert.assertFalse(testClass.isAnnotation()); + Assert.assertFalse(testClass.isAnonymousClass()); + Assert.assertFalse(testClass.isArray()); + Assert.assertFalse(testClass.isEnum()); + Assert.assertFalse(testClass.isInterface()); + Assert.assertFalse(testClass.isLocalClass()); + Assert.assertTrue(testClass.isMemberClass()); + Assert.assertFalse(testClass.isPrimitive()); + Assert.assertFalse(testClass.isSynthetic()); + Assert.assertEquals("[0]", stringifyTypeArray(testClass.getGenericInterfaces())); + String typeParameters = stringifyTypeArray(testClass.getTypeParameters()); + boolean testTypeParameters = typeParameters.contains("[1]"); + testTypeParameters = testTypeParameters && typeParameters.contains("K"); + Assert.assertTrue(testTypeParameters); + + + Method meth; + try { + meth = ReflectAnnotationsTest2.class.getMethod("foo", (Class[]) null); + Assert.assertNull(getSignature(meth)); + + Field field; + field = ReflectAnnotationsTest2.class.getField("consInnerNamed"); + Assert.assertNull(getSignature(field)); + + meth = ReflectAnnotationsTest2.class.getMethod("getGeneric", (Class[]) null); + Assert.assertEquals("()Lcom/android/jack/annotation/test006/jack/ReflectAnnotationsTest2$Generic2;", getSignature(meth)); + Class[] exceptions = meth.getExceptionTypes(); + Assert.assertTrue(exceptions.length == 2); + List> exceptionsList = Arrays.asList(exceptions); + Assert.assertTrue(exceptionsList.contains(OutOfMemoryError.class)); + Assert.assertTrue(exceptionsList.contains(AssertionError.class)); + + field = ReflectAnnotationsTest2.class.getField("genField"); + Assert.assertEquals("Ljava/util/List;", getSignature(field)); + + } catch (SecurityException e) { + System.out.println(e.getMessage()); + } catch (NoSuchMethodException e) { + System.out.println(e.getMessage()); + } catch (NoSuchFieldException e) { + System.out.println(e.getMessage()); + } + } + + private static String getSignature(Object obj) { + Method method; + try { + Class c = obj.getClass(); + method = c.getDeclaredMethod("getSignatureAttribute"); + method.setAccessible(true); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + try { + return (String) method.invoke(obj); + } catch (IllegalAccessException ex) { + throw new RuntimeException(ex); + } catch (InvocationTargetException ex) { + throw new RuntimeException(ex); + } + } + + private static String stringifyTypeArray(Type[] types) { + StringBuilder stb = new StringBuilder(); + boolean first = true; + + stb.append("[" + types.length + "]"); + + for (Type t: types) { + if (first) { + stb.append(" "); + first = false; + } else { + stb.append(", "); + } + stb.append(t.toString()); + } + + return stb.toString(); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest.java b/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest.java new file mode 100644 index 00000000..2ea4c256 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.jack; + + + +import java.io.Serializable; +import java.util.List; + +public class ReflectAnnotationsTest { + + public Object getLocal(int i) { + class C {} + C c = new C(); + return c; + } + + public class InnerClass { + void f(List l) throws OutOfMemoryError, AssertionError{ + + } + } + + public static class InnerClassStatic extends SuperClass + implements SuperInterface1, SuperInterface2 { + } + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest2.java b/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest2.java new file mode 100644 index 00000000..9b65f2f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/jack/ReflectAnnotationsTest2.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.jack; + + + + + + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ReflectAnnotationsTest2 { + + public Object consInnerNamed; + public List genField; + + public ReflectAnnotationsTest2() { + /* local, not anonymous, not member */ + class ConsInnerNamed { + public void m() { + } + } + consInnerNamed = new ConsInnerNamed(); + } + + public void foo() { + /* anonymous, not local, not member */ + SuperInterface1 c = new SuperInterface1() { + SuperClass f = new SuperClass(); + }; + } + + public Generic2 getGeneric() throws OutOfMemoryError, AssertionError{ + return new Generic2(); + } + + public void genMeht(List l){} + + abstract class Generic1 extends HashMap implements Map {} + private class Generic2 extends Generic1 {} + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperClass.java b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperClass.java new file mode 100644 index 00000000..8eee54d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperClass.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.jack; + +public class SuperClass { +} diff --git a/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface1.java b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface1.java new file mode 100644 index 00000000..50a87832 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface1.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.jack; + +public interface SuperInterface1 { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface2.java b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface2.java new file mode 100644 index 00000000..eb96c17a --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test006/jack/SuperInterface2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test006.jack; + +public interface SuperInterface2 { + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test007/dx/Tests.java new file mode 100644 index 00000000..a5af72e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test007/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test007.dx; + +import com.android.jack.annotation.test007.jack.Thrower; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Type; +import java.util.Arrays; + +public class Tests { + + @Test + public void testGenericExceptionsOfConstructorsWithTypeParameters() throws Exception { + Constructor constructor = Thrower.class.getConstructor(); + Assert.assertEquals(Arrays.asList(IOException.class), + Arrays.asList(constructor.getGenericExceptionTypes())); + } + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test007/jack/Thrower.java b/jack-tests/tests/com/android/jack/annotation/test007/jack/Thrower.java new file mode 100644 index 00000000..af755f50 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test007/jack/Thrower.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test007.jack; + +import java.io.IOException; + +public class Thrower { + public Thrower() throws IOException {} +} diff --git a/jack-tests/tests/com/android/jack/annotation/test008/dx/Ref008.java b/jack-tests/tests/com/android/jack/annotation/test008/dx/Ref008.java new file mode 100644 index 00000000..187161df --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test008/dx/Ref008.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test008.dx; + +public class Ref008 { + + public static Class getAnonymousClass() { + return new Object() { + }.getClass(); + } + + public static Object anonymousClass2 = new Object() {}; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test008/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test008/dx/Tests.java new file mode 100644 index 00000000..62bc6db3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test008/dx/Tests.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test008.dx; + +import com.android.jack.annotation.test008.jack.Annotation008; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.reflect.Modifier; + +public class Tests { + @Test + public void testref001() throws Exception { + Class anonymousClass = Ref008.getAnonymousClass(); + Assert.assertTrue(anonymousClass.isAnonymousClass()); + Assert.assertFalse(Modifier.isFinal(anonymousClass.getModifiers())); + } + @Test + public void test001() throws Exception { + Class anonymousClass = Annotation008.getAnonymousClass1(); + Assert.assertTrue(anonymousClass.isAnonymousClass()); + Assert.assertFalse(Modifier.isFinal(anonymousClass.getModifiers())); + } + @Test + public void testref002() throws Exception { + Class anonymousClass = Ref008.anonymousClass2.getClass(); + Assert.assertTrue(anonymousClass.isAnonymousClass()); + Assert.assertFalse(Modifier.isFinal(anonymousClass.getModifiers())); + } + @Test + public void test002() throws Exception { + Class anonymousClass = Annotation008.anonymousClass2.getClass(); + Assert.assertTrue(anonymousClass.isAnonymousClass()); + Assert.assertFalse(Modifier.isFinal(anonymousClass.getModifiers())); + } + +} diff --git a/jack-tests/tests/com/android/jack/annotation/test008/jack/Annotation008.java b/jack-tests/tests/com/android/jack/annotation/test008/jack/Annotation008.java new file mode 100644 index 00000000..0176f751 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test008/jack/Annotation008.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test008.jack; + +public class Annotation008 { + + public static Class getAnonymousClass1() { + return new Object() { + }.getClass(); + } + + public static Object anonymousClass2 = new Object() {}; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test009/dx/Annotation009Ref.java b/jack-tests/tests/com/android/jack/annotation/test009/dx/Annotation009Ref.java new file mode 100644 index 00000000..d5306b18 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test009/dx/Annotation009Ref.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test009.dx; + +interface I { + Class get(); +} + +public class Annotation009Ref { + + public Annotation009Ref() { + } + + public Annotation009Ref(Object o) { + } + + public static Class getLocalClass1() { + class C { + class D {} + } + return C.D.class; + } + + public static Class getLocalClass2() { + return localClass2.get(); + } + + public static Class getLocalClass3() { + return new Annotation009Ref().localClass3.get(); + } + + public static Class getLocalClass4() { + return localClass2.getClass(); + } + + public static Class getLocalClass5() { + return new Annotation009Ref().localClass3.getClass(); + } + + private static I localClass2 = new I() { + class D {} + @Override + public java.lang.Class get() { + return D.class; + } + }; + + private I localClass3 = new I() { + class D {} + @Override + public java.lang.Class get() { + return D.class; + } + }; +} diff --git a/jack-tests/tests/com/android/jack/annotation/test009/dx/Tests.java b/jack-tests/tests/com/android/jack/annotation/test009/dx/Tests.java new file mode 100644 index 00000000..d2c23451 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test009/dx/Tests.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test009.dx; + +import com.android.jack.annotation.test009.jack.Annotation009; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test001() throws Exception { + Class clazz = Annotation009.getLocalClass1(); + Class ref = Annotation009Ref.getLocalClass1(); + Assert.assertNull(clazz.getEnclosingMethod()); + Assert.assertEquals(clazz.getEnclosingMethod() == null, ref.getEnclosingMethod() == null); + } + + @Test + public void test002() throws Exception { + Class clazz = Annotation009.getLocalClass2(); + Class ref = Annotation009Ref.getLocalClass2(); + Assert.assertEquals(clazz.getEnclosingMethod() == null, ref.getEnclosingMethod() == null); + } + + @Test + public void test003() throws Exception { + Class clazz = Annotation009.getLocalClass3(); + Class ref = Annotation009Ref.getLocalClass3(); + Assert.assertEquals(clazz.getEnclosingMethod() == null, ref.getEnclosingMethod() == null); + } + + @Test + public void test004() throws Exception { + Class clazz = Annotation009.getLocalClass4(); + Class ref = Annotation009Ref.getLocalClass4(); + Assert.assertEquals(clazz.getEnclosingMethod() == null, ref.getEnclosingMethod() == null); + } + + @Test + public void test005() throws Exception { + Class clazz = Annotation009.getLocalClass5(); + Class ref = Annotation009Ref.getLocalClass5(); + Assert.assertEquals(clazz.getEnclosingMethod() == null, ref.getEnclosingMethod() == null); + } +} diff --git a/jack-tests/tests/com/android/jack/annotation/test009/jack/Annotation009.java b/jack-tests/tests/com/android/jack/annotation/test009/jack/Annotation009.java new file mode 100644 index 00000000..5dba0b10 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotation/test009/jack/Annotation009.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotation.test009.jack; + +interface I { + Class get(); +} + +public class Annotation009 { + + public Annotation009() { + } + + public Annotation009(Object o) { + } + + public static Class getLocalClass1() { + class C { + class D {} + } + return C.D.class; + } + + public static Class getLocalClass2() { + return localClass2.get(); + } + + public static Class getLocalClass3() { + return new Annotation009().localClass3.get(); + } + + public static Class getLocalClass4() { + return localClass2.getClass(); + } + + public static Class getLocalClass5() { + return new Annotation009().localClass3.getClass(); + } + + private static I localClass2 = new I() { + class D {} + @Override + public java.lang.Class get() { + return D.class; + } + }; + + private I localClass3 = new I() { + class D {} + @Override + public java.lang.Class get() { + return D.class; + } + }; +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/arithmetic/test001/dx/Tests.java new file mode 100644 index 00000000..68f00d24 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/dx/Tests.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.dx; + +import com.android.jack.arithmetic.test001.jack.Add; +import com.android.jack.arithmetic.test001.jack.And; +import com.android.jack.arithmetic.test001.jack.Div; +import com.android.jack.arithmetic.test001.jack.Mod; +import com.android.jack.arithmetic.test001.jack.Mul; +import com.android.jack.arithmetic.test001.jack.Or; +import com.android.jack.arithmetic.test001.jack.Shl; +import com.android.jack.arithmetic.test001.jack.Shr; +import com.android.jack.arithmetic.test001.jack.Sub; +import com.android.jack.arithmetic.test001.jack.Ushr; +import com.android.jack.arithmetic.test001.jack.Xor; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(0, Add.apply(0, 0)); + Assert.assertEquals(10 + 7, Add.apply(10, 7)); + Assert.assertEquals(21 - 3, Sub.apply(21, 3)); + Assert.assertEquals(-1 & 19, And.apply(-1, 19)); + Assert.assertEquals(21 & 54, And.apply(21, 54)); + Assert.assertEquals(210 / 10, Div.apply(210, 10)); + Assert.assertEquals(119 / 5, Div.apply(119, 5)); + Assert.assertEquals(119 % 5, Mod.apply(119, 5)); + Assert.assertEquals(6 * 5, Mul.apply(6, 5)); + Assert.assertEquals(30 | 1, Or.apply(30, 1)); + Assert.assertEquals(-1 | 27, Or.apply(-1, 27)); + Assert.assertEquals(-1 >> 10, Shr.apply(-1, 10)); + Assert.assertEquals(472758 >> 3, Shr.apply(472758, 3)); + Assert.assertEquals(-1 >>> 10, Ushr.apply(-1, 10)); + Assert.assertEquals(472758 >>> 3, Ushr.apply(472758, 3)); + Assert.assertEquals(-1 << 10, Shl.apply(-1, 10)); + Assert.assertEquals(472758 << 3, Shl.apply(472758, 3)); + Assert.assertEquals(472758 ^ 758996, Xor.apply(472758, 758996)); +} + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Add.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Add.java new file mode 100644 index 00000000..05c31caf --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Add.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Add test. + */ +public class Add { + + public static int apply(byte a, byte b) { + return a + b; + } + + public static int apply(byte a, char b) { + return a + b; + } + + public static int apply(byte a, short b) { + return a + b; + } + + public static int apply(byte a, int b) { + return a + b; + } + + public static int apply(char a, byte b) { + return a + b; + } + + public static int apply(char a, char b) { + return a + b; + } + + public static int apply(short a, byte b) { + return a + b; + } + + public static int apply(short a, short b) { + return a + b; + } + + public static int apply(int a, byte b) { + return a + b; + } + + public static int apply(int a, int b) { + return a + b; + } + + public static long apply(long a, long b) { + return a + b; + } + + public static float apply(float a, float b) { + return a + b; + } + + public static double apply(double a, double b) { + return a + b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/And.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/And.java new file mode 100644 index 00000000..e7726534 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/And.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise and test + */ +public class And { + + public static int apply(int a, int b) { + return a & b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Div.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Div.java new file mode 100644 index 00000000..04f85f7e --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Div.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Division test. + */ +public class Div { + + public static int apply(int a, int b) { + return a / b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mod.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mod.java new file mode 100644 index 00000000..cd0300c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mod.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Modulo test. + */ +public class Mod { + + public static int apply(int a, int b) { + return a % b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mul.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mul.java new file mode 100644 index 00000000..8a10d0c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Mul.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Multiply test. + */ +public class Mul { + + public static int apply(int a, int b) { + return a * b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Or.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Or.java new file mode 100644 index 00000000..388cd07d --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Or.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise or test. + */ +public class Or { + + public static int apply(int a, int b) { + return a | b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shl.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shl.java new file mode 100644 index 00000000..9a9b977a --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shl.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise left shift test. + */ +public class Shl { + + public static int apply(int a, int b) { + return a << b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shr.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shr.java new file mode 100644 index 00000000..df3526c7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Shr.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise signed right shift test. + */ +public class Shr { + + public static int apply(int a, int b) { + return a >> b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Sub.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Sub.java new file mode 100644 index 00000000..a0a5d66b --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Sub.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Subtract test. + */ +public class Sub { + + public static int apply(int a, int b) { + return a - b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Ushr.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Ushr.java new file mode 100644 index 00000000..b8f61d3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Ushr.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise unsigned right shift test. + */ +public class Ushr { + + public static int apply(int a, int b) { + return a >>> b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Xor.java b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Xor.java new file mode 100644 index 00000000..49e48e60 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test001/jack/Xor.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test001.jack; + +/** + * Bitwise xor test. + */ +public class Xor { + + public static int apply(int a, int b) { + return a ^ b; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/arithmetic/test002/dx/Tests.java new file mode 100644 index 00000000..7a06578e --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/dx/Tests.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.arithmetic.test002.jack.Add; +import com.android.jack.arithmetic.test002.jack.And; +import com.android.jack.arithmetic.test002.jack.Div; +import com.android.jack.arithmetic.test002.jack.Mod; +import com.android.jack.arithmetic.test002.jack.Mul; +import com.android.jack.arithmetic.test002.jack.Or; +import com.android.jack.arithmetic.test002.jack.Shl; +import com.android.jack.arithmetic.test002.jack.Shr; +import com.android.jack.arithmetic.test002.jack.Sub; +import com.android.jack.arithmetic.test002.jack.Ushr; +import com.android.jack.arithmetic.test002.jack.Xor; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1 + 2, Add.apply(1, 2)); + Assert.assertEquals(21 - 3, Sub.apply(21, 3)); + Assert.assertEquals(3 & 2, And.apply(3, 2)); + Assert.assertEquals(4 | 8, Or.apply(4, 8)); + Assert.assertEquals(4 ^ 8, Xor.apply(4, 8)); + Assert.assertEquals(8 ^ 8, Xor.apply(8, 8)); + Assert.assertEquals(8 / 4, Div.apply(8, 4)); + Assert.assertEquals(8 % 4, Mod.apply(8, 4)); + Assert.assertEquals(8 % 5, Mod.apply(8, 5)); + Assert.assertEquals(8 * 5, Mul.apply(8, 5)); + Assert.assertEquals(-1 >> 10, Shr.apply(-1, 10)); + Assert.assertEquals(472758 >> 3, Shr.apply(472758, 3)); + Assert.assertEquals(-1 >>> 10, Ushr.apply(-1, 10)); + Assert.assertEquals(472758 >>> 3, Ushr.apply(472758, 3)); + Assert.assertEquals(-1 << 10, Shl.apply(-1, 10)); + Assert.assertEquals(472758 << 3, Shl.apply(472758, 3)); + Assert.assertTrue(Or.applyBool(true, false)); + Assert.assertTrue(Xor.applyBool(true, false)); + Assert.assertFalse(And.applyBool(true, false)); + +} + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Add.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Add.java new file mode 100644 index 00000000..2c744df8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Add.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Add test. + */ +public class Add { + + public static int apply(int a, int b) { + a += b; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/And.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/And.java new file mode 100644 index 00000000..8ed8da3e --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/And.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise and test + */ +public class And { + + public static int apply(int a, int b) { + a &= b; + return a; + } + + public static boolean applyBool(boolean a, boolean b) { + if ( a && (a & b)) { + return true; + } + return false; + } +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Div.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Div.java new file mode 100644 index 00000000..e9b7a281 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Div.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Division test. + */ +public class Div { + + public static int apply(int a, int b) { + a /= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mod.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mod.java new file mode 100644 index 00000000..9610cafa --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mod.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Modulo test. + */ +public class Mod { + + public static int apply(int a, int b) { + a %= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mul.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mul.java new file mode 100644 index 00000000..9eea2299 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Mul.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Multiply test. + */ +public class Mul { + + public static int apply(int a, int b) { + a *= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Or.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Or.java new file mode 100644 index 00000000..a574a83e --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Or.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise or test. + */ +public class Or { + + public static int apply(int a, int b) { + a |= b; + return a; + } + + public static boolean applyBool(boolean a, boolean b) { + if ( a && (a | b)) { + return true; + } + return false; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shl.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shl.java new file mode 100644 index 00000000..8f0cf3b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shl.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise left shift test. + */ +public class Shl { + + public static int apply(int a, int b) { + a <<= b; + return a ; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shr.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shr.java new file mode 100644 index 00000000..754a691c --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Shr.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise signed right shift test. + */ +public class Shr { + + public static int apply(int a, int b) { + a >>= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Sub.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Sub.java new file mode 100644 index 00000000..dc3bb04b --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Sub.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Subtract test. + */ +public class Sub { + + public static int apply(int a, int b) { + a -= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Ushr.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Ushr.java new file mode 100644 index 00000000..8bd67a6f --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Ushr.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise unsigned right shift test. + */ +public class Ushr { + + public static int apply(int a, int b) { + a >>>= b; + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Xor.java b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Xor.java new file mode 100644 index 00000000..5757f1fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test002/jack/Xor.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test002.jack; + +/** + * Bitwise xor test. + */ +public class Xor { + + public static int apply(int a, int b) { + a ^= b; + return a; + } + + public static boolean applyBool(boolean a, boolean b) { + if ( a && (a ^ b)) { + return true; + } + return false; + } +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/arithmetic/test003/dx/Tests.java new file mode 100644 index 00000000..87eff98f --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test003/dx/Tests.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test003.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.arithmetic.test003.jack.ZeroUsage; + +/** + * Tests about arithmetic with zero. + */ +public class Tests { + + @Test + public void test1() { + try { + ZeroUsage.divByZeroInt(); + Assert.fail(); + } catch (ArithmeticException e) { + // Test is ok + } + + try { + ZeroUsage.modByZeroInt(); + Assert.fail(); + } catch (ArithmeticException e) { + // Test is ok + } + + try { + ZeroUsage.divByZeroLong(); + Assert.fail(); + } catch (ArithmeticException e) { + // Test is ok + } + + try { + ZeroUsage.modByZeroLong(); + Assert.fail(); + } catch (ArithmeticException e) { + // Test is ok + } + + try { + ZeroUsage.divByZeroDouble(); + } catch (ArithmeticException e) { + Assert.fail(); + } + + try { + ZeroUsage.modByZeroDouble(); + } catch (ArithmeticException e) { + Assert.fail(); + } + + try { + ZeroUsage.divByZeroFloat(); + } catch (ArithmeticException e) { + Assert.fail(); + } + + try { + ZeroUsage.modByZeroFloat(); + } catch (ArithmeticException e) { + Assert.fail(); + } + } + +} diff --git a/jack-tests/tests/com/android/jack/arithmetic/test003/jack/ZeroUsage.java b/jack-tests/tests/com/android/jack/arithmetic/test003/jack/ZeroUsage.java new file mode 100644 index 00000000..ca65d310 --- /dev/null +++ b/jack-tests/tests/com/android/jack/arithmetic/test003/jack/ZeroUsage.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.arithmetic.test003.jack; + +/** + * Division by zero test. + */ +public class ZeroUsage { + + public static int divByZeroInt() { + return 1 / 0; + } + + public static int modByZeroInt() { + return 1 % 0; + } + + public static long divByZeroLong() { + return 1L / 0L; + } + + public static long modByZeroLong() { + return 1L % 0L; + } + + public static float divByZeroFloat() { + return 1f / 0f; + } + + public static float modByZeroFloat() { + return 1f % 0f; + } + + public static double divByZeroDouble() { + return 1d / 0d; + } + + public static double modByZeroDouble() { + return 1d % 0d; + } +} diff --git a/jack-tests/tests/com/android/jack/array/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/array/test001/dx/Tests.java new file mode 100644 index 00000000..4cf128fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/array/test001/dx/Tests.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.array.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.array.test001.jack.ArrayTest; + + +public class Tests { + + @Test + public void arrayReadAccessWithNull() { + try { + ArrayTest.arrayReadAccessWithNull(); + Assert.fail(); + } catch (NullPointerException e){ + // Test is ok + } + } + + @Test + public void arrayWriteAccessWithNull() { + try { + ArrayTest.arrayWriteAccessWithNull(); + Assert.fail(); + } catch (NullPointerException e){ + // Test is ok + } + } +} diff --git a/jack-tests/tests/com/android/jack/array/test001/jack/ArrayTest.java b/jack-tests/tests/com/android/jack/array/test001/jack/ArrayTest.java new file mode 100644 index 00000000..39cca070 --- /dev/null +++ b/jack-tests/tests/com/android/jack/array/test001/jack/ArrayTest.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.array.test001.jack; + +/** + * Tests array access with nullable value. + */ +public class ArrayTest { + + @SuppressWarnings("null") + public static int arrayReadAccessWithNull() { + int a[] = null; + return a[0]; + } + + @SuppressWarnings("null") + public static void arrayWriteAccessWithNull() { + int a[] = null; + a[0] = 0; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/assertion/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/assertion/test001/dx/Tests.java new file mode 100644 index 00000000..fe5f6951 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test001/dx/Tests.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test001.dx; + +import com.android.jack.assertion.test001.jack.Data; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class Tests { + + @BeforeClass + public static void setUpClass() { + Data.class.getClassLoader().setDefaultAssertionStatus(true); + } + + @Test + public void test1() { + try { + Data.throwAssert(); + } catch (AssertionError e){ + // expected + Assert.assertNull(e.getMessage()); + return; + } + Assert.fail(); + } + + @Test + public void test2() { + try { + Data.throwAssert("assertion", 0); + } catch (AssertionError e){ + Assert.fail(); + } + } + + @Test + public void test3() { + try { + Data.throwAssert("assertion", 1); + } catch (AssertionError e){ + // expected + Assert.assertEquals("assertion", e.getMessage()); + return; + } + Assert.fail(); + } + + @Test + public void test4() { + Data.throwAssert(true); + try { + Data.throwAssert(false); + } catch (AssertionError e){ + // expected + Assert.assertEquals("boolean is false", e.getMessage()); + return; + } + Assert.fail(); + } + + @Test + public void test5() { + try { + Data.throwAssertObject(new Object()); + } catch (AssertionError e){ + // expected + Assert.assertNotNull(e.getMessage()); + return; + } + Assert.fail(); + } +} diff --git a/jack-tests/tests/com/android/jack/assertion/test001/jack/Data.java b/jack-tests/tests/com/android/jack/assertion/test001/jack/Data.java new file mode 100644 index 00000000..e680d606 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test001/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test001.jack; + +public class Data { + + public static void throwAssert() { + assert false; + } + + public static void throwAssert(boolean b) { + assert b : "boolean is false"; + } + + public static void throwAssertObject(Object o) { + assert false : o; + } + + public static void throwAssert(String message, int a) { + assert a == 0 : message; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/assertion/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/assertion/test002/dx/Tests.java new file mode 100644 index 00000000..66e3bd34 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test002/dx/Tests.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test002.dx; + +import com.android.jack.assertion.test002.jack.Data; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class Tests { + + @BeforeClass + public static void setUpClass() { + Data.class.getClassLoader().setDefaultAssertionStatus(false); + } + + @Test + public void test() { + try { + Data.throwAssert(); + } catch (AssertionError e){ + Assert.fail(); + } + } +} diff --git a/jack-tests/tests/com/android/jack/assertion/test002/jack/Data.java b/jack-tests/tests/com/android/jack/assertion/test002/jack/Data.java new file mode 100644 index 00000000..d88f975e --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test002/jack/Data.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test002.jack; + +public class Data { + + int $assertionsDisabled = 1; + + public static void throwAssert() { + assert false; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/assertion/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/assertion/test003/dx/Tests.java new file mode 100644 index 00000000..44a6a734 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test003/dx/Tests.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test003.dx; + +import com.android.jack.assertion.test003.jack.Data; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Tests what happens when there are 2 assertion statements in the same method. + * In the current implementation of Jack, an "assertionsEnabled" field is created in the enclosing + * type when an assertion statement is encountered, but it should be reused for the following one. + */ +public class Tests { + + @BeforeClass + public static void setUpClass() { + Data.class.getClassLoader().setDefaultAssertionStatus(false); + } + + @Test + public void test1() { + try { + Data.m(true, true); + } catch (AssertionError e){ + Assert.fail(); + } + } + + @Test + public void test2() { + try { + Data.m(true, false); + Assert.fail(); + } catch (AssertionError e){ + } + } + + @Test + public void test3() { + try { + Data.m(false, true); + Assert.fail(); + } catch (AssertionError e){ + } + } + + @Test + public void test4() { + try { + Data.m(false, false); + Assert.fail(); + } catch (AssertionError e){ + } + } +} diff --git a/jack-tests/tests/com/android/jack/assertion/test003/jack/Data.java b/jack-tests/tests/com/android/jack/assertion/test003/jack/Data.java new file mode 100644 index 00000000..a32db264 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assertion/test003/jack/Data.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assertion.test003.jack; + +public class Data { + + public static void m(boolean a, boolean b) { + assert a; + assert b; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/assign/dx/Tests.java b/jack-tests/tests/com/android/jack/assign/dx/Tests.java new file mode 100644 index 00000000..24e1d415 --- /dev/null +++ b/jack-tests/tests/com/android/jack/assign/dx/Tests.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assign.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.assign.jack.Assignments; + +/** + * Tests Assignments. + */ +public class Tests { + @Test + public void getLvValue() { + Assert.assertEquals(5, Assignments.getLvValue()); + } + + @Test + public void getFieldValue() { + Assert.assertEquals(5, Assignments.getFieldValue()); + } + + @Test + public void getParameterValue() { + Assert.assertEquals(5, Assignments.getParameterValue(5)); + } +} diff --git a/jack-tests/tests/com/android/jack/assign/jack/Assignments.java b/jack-tests/tests/com/android/jack/assign/jack/Assignments.java new file mode 100644 index 00000000..d2a03d2a --- /dev/null +++ b/jack-tests/tests/com/android/jack/assign/jack/Assignments.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.assign.jack; + +public class Assignments { + public static int field = 5; + + public static int getLvValue() { + int lv = lv = 5; + return lv; + } + + public static int getFieldValue() { + field = field = 5; + return field; + } + + public static int getParameterValue(int value) { + value = value = 5; + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/block/test001/jack/ImplicitBlockSample.java b/jack-tests/tests/com/android/jack/block/test001/jack/ImplicitBlockSample.java new file mode 100644 index 00000000..943edf47 --- /dev/null +++ b/jack-tests/tests/com/android/jack/block/test001/jack/ImplicitBlockSample.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.block.test001.jack; + +public class ImplicitBlockSample { + + public int ifThen(int val) { + if (val == 5) + return 1; + return 2; + } + + public int ifElse(int val) { + if (val == 5) { + return 1; + } + else return 2; + } + + @SuppressWarnings("unused") + public int labelStmt001(int val) { + label: + return val; + } + + @SuppressWarnings("unused") + public int labelStmt002(int val) { + int a = 0; + label: + a = 5; + return a; + } + + @SuppressWarnings("unused") + public int labelStmt003(int val) { + int a = 0; + label: + a = 5; + label: + a = 10; + return a; + } + + public int forBody001(int val) { + int sum = 0; + for (int i = 0; i < val; i++) + sum = sum + 1; + return val; + } + + public int forBody002(int val) { + int sum = 0; + for (int i = 0; i < val; i++) + for (int j = 0; j < val; j++) + sum = sum + 1; + return val; + } + + public int whileBody(int val) { + int sum = 0; + while(sum < val) + sum = sum + 1; + return val; + } + + public int caseStmt001(int val) { + switch(val) { + case 1: + return 1; + case 2: + int ret = 1; + case 3: + ret = 0; + return ret; + } + return val; + } + + public int caseStmt002(int val) { + switch(val) { + case 1: { + return 1; + } + case 2: + int ret = 1; + case 3: + ret = 0; + return ret; + } + return val; + } +} diff --git a/jack-tests/tests/com/android/jack/box/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/box/test001/dx/Tests.java new file mode 100644 index 00000000..73edcd2d --- /dev/null +++ b/jack-tests/tests/com/android/jack/box/test001/dx/Tests.java @@ -0,0 +1,286 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.box.test001.dx; + +import com.android.jack.box.test001.jack.Box001; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(Long.valueOf(15), Box001.get1(Long.valueOf(11), 4)); + } + + @Test + public void test2() { + Assert.assertEquals(Long.valueOf(15), Box001.get2(Long.valueOf(11), 4)); + } + + @Test + public void test3() { + Assert.assertTrue(Box001.get3(new Boolean(true), new Boolean(true)).booleanValue()); + Assert.assertFalse(Box001.get3(new Boolean(true), new Boolean(false)).booleanValue()); + } + + @Test + public void test4() { + Assert.assertTrue(Box001.get4(new Boolean(true), new Boolean(true)).booleanValue()); + Assert.assertFalse(Box001.get4(new Boolean(true), new Boolean(false)).booleanValue()); + } + + @Test + public void test5() { + Assert.assertTrue(Box001.get5(new Boolean(true))); + Assert.assertFalse(Box001.get5(new Boolean(false))); + } + + @Test + public void test6() { + Assert.assertEquals(2L << 2, Box001.get6(new Long(2), 2).longValue()); + } + + @Test + public void test7() { + Assert.assertTrue(Box001.get7(new Boolean(true), new Boolean(true)).booleanValue()); + Assert.assertFalse(Box001.get7(new Boolean(true), new Boolean(false)).booleanValue()); + } + + @Test + public void test8() { + Assert.assertTrue(Box001.get8()); + } + + @Test + public void test9() { + Assert.assertTrue(Box001.get9().booleanValue()); + } + + @Test + public void test10() { + Assert.assertTrue(Box001.get10()); + } + + @Test + public void test11() { + int[] a = new int[]{1,2,3}; + Assert.assertEquals(1, Box001.get11(a).intValue()); + } + + @Test + public void test12() { + Integer[] a = new Integer[] {new Integer(1), new Integer(2), new Integer(3)}; + Assert.assertEquals(1, Box001.get12(a)); + } + + @Test + public void test13() { + int[] a = new int[]{1,2,3}; + Assert.assertEquals(3, Box001.get13(a, new Integer(2))); + } + + @Test + public void test14() { + Assert.assertEquals(1, Box001.get14(new Integer(1), new Integer(2)).length); + Assert.assertEquals(2, Box001.get14(new Integer(1), new Integer(2))[0].length); + } + + @Test + public void test15() { + Assert.assertEquals(3, Box001.get15(1,2.0f)); + } + + @Test + public void test16() { + Assert.assertEquals(3, Box001.get16(new Integer(1), new Float(2.0f))); + } + + @Test + public void test17() { + Assert.assertEquals(-1, Box001.get17(new Integer(1))); + } + + @Test + public void test18() { + Assert.assertEquals(1, Box001.get18(new Integer(2))); + } + + @Test + public void test19() { + Assert.assertFalse(Box001.get19(new Boolean(true))); + } + + @Test + public void test20() { + Assert.assertEquals(2, Box001.get20(new Integer(2))); + } + + @Test + public void test21() { + short val = 2; + Assert.assertEquals(2, Box001.get21(new Short(val))); + } + + @Test + public void test22() { + Assert.assertEquals(~16, Box001.get22(new Integer(16))); + } + + @Test + public void test23() { + Assert.assertTrue(Box001.get23(new Integer(16))); + } + + @Test + public void test24() { + Assert.assertTrue(Box001.get24(new Boolean(true))); + Assert.assertFalse(Box001.get24(new Boolean(false))); + } + + @Test + public void test25() { + Assert.assertTrue(Box001.get25(new Boolean(true))); + Assert.assertFalse(Box001.get25(new Boolean(false))); + } + + @Test + public void test26() { + Assert.assertEquals(16, ((Integer)Box001.get26(16l)).intValue()); + } + + @Test + public void test27() { + Assert.assertEquals(16, Box001.get27(new Integer(16))); + } + + @Test + public void test28() { + Assert.assertEquals("2", Box001.get28(new short[]{1,2,3}, true)); + } + + @Test + public void test29() { + Assert.assertEquals("1,true", Box001.get29(1,true)); + } + + @Test + public void test30() { + Assert.assertEquals(1, Box001.get30()[0].intValue()); + Assert.assertEquals(2, Box001.get30()[1].intValue()); + } + + @Test + public void test31() { + Assert.assertEquals(1, Box001.get31()[0]); + Assert.assertEquals(2, Box001.get31()[1]); + } + + @Test + public void test32() { + Assert.assertEquals(1, Box001.get32(new Integer(1))); + Assert.assertEquals(2, Box001.get32(new Integer(2))); + } + + @Test + public void test33() { + Assert.assertEquals(1, Box001.get33(new Integer(1))); + Assert.assertEquals(0, Box001.get33(new Integer(2))); + } + + @Test + public void test34() { + Assert.assertEquals(1, Box001.get34(new Boolean(true))); + Assert.assertEquals(0, Box001.get34(new Boolean(false))); + } + + @Test + public void test35() { + Assert.assertEquals(1, Box001.get35(new Boolean(true))); + Assert.assertEquals(0, Box001.get35(new Boolean(false))); + } + + @Test + public void test36() { + Assert.assertEquals(1, Box001.get36(new Boolean(true))); + Assert.assertEquals(0, Box001.get36(new Boolean(false))); + } + + @Test + public void test37() { + Assert.assertEquals(2, Box001.get37(new Boolean(true))); + Assert.assertEquals(1, Box001.get37(new Boolean(false))); + } + + @Test + public void test38() { + Assert.assertEquals(2, Box001.get38(new Boolean(true))); + Assert.assertEquals(0, Box001.get38(new Boolean(false))); + } + + @Test + public void test39() { + Assert.assertFalse(Box001.get39("ab")); + } + + @Test + public void test41() { + Assert.assertEquals(16 + 16, Box001.get41(new Integer(16), new Integer(16))); + } + + @Test + public void test42() { + Assert.assertTrue(Box001.get42(new Double(0.5), new Double(0.5)) == (0.5 + 0.5)); + } + + @Test + public void test43() { + Assert.assertEquals(1, Box001.get43()); + } + + @Test + public void test44() { + Assert.assertEquals(10, Box001.get44()); + } + + @Test + public void test45() { + Assert.assertEquals(2 & 4, Box001.get45(new Integer(2), new Integer(4)).intValue()); + } + + @Test + public void test46() { + Assert.assertEquals(1, Box001.get46(true, new Boolean(true))); + Assert.assertEquals(0, Box001.get46(false, new Boolean(true))); + } + + @Test + public void test47() { + Assert.assertEquals(2, Box001.get47(1)); + } + + @Test + public void test48() { + try { + Box001.get48(); + Assert.fail(); + } catch (NullPointerException e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/box/test001/jack/Box001.java b/jack-tests/tests/com/android/jack/box/test001/jack/Box001.java new file mode 100644 index 00000000..4693ce3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/box/test001/jack/Box001.java @@ -0,0 +1,338 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.box.test001.jack; + +public class Box001 { + + @SuppressWarnings("boxing") + public static Long get1(Long initial, int inc) { + initial += inc; + return initial; + } + + @SuppressWarnings("boxing") + public static Long get2(Long initial, int inc) { + initial = inc + initial; + return initial; + } + + @SuppressWarnings("boxing") + public static Boolean get3(Boolean b1, Boolean b2) { + Boolean b = null; + b = b1 & b2; + return b; + } + + @SuppressWarnings("boxing") + public static Boolean get4(Boolean b1, Boolean b2) { + Boolean b = null; + b = b1 && b2; + return b; + } + + @SuppressWarnings("boxing") + public static boolean get5(Boolean b1) { + boolean b; + b = b1; + return b; + } + + @SuppressWarnings("boxing") + public static Long get6(Long initial, int inc) { + initial = initial << inc; + return initial; + } + + @SuppressWarnings("boxing") + public static Boolean get7(Boolean b1, Boolean b2) { + Boolean b = b1 && b2; + return b; + } + + @SuppressWarnings("boxing") + public static boolean get8() { + boolean b = new Boolean(true); + return b; + } + + @SuppressWarnings("boxing") + public static Boolean get9() { + return true; + } + + @SuppressWarnings("boxing") + public static boolean get10() { + return new Boolean(true); + } + + @SuppressWarnings("boxing") + public static Integer get11(int[] a) { + return a[0]; + } + + @SuppressWarnings("boxing") + public static int get12(Integer[] a) { + return a[0]; + } + + @SuppressWarnings("boxing") + public static int get13(int[] a, Integer index) { + return a[index]; + } + + @SuppressWarnings("boxing") + public static int[][] get14(Integer size1, Integer size2) { + return new int[size1][size2]; + } + + @SuppressWarnings("boxing") + private static int getP0(Integer a, Float b, Boolean c) { + if (c) { + return a + b.intValue(); + } + return 0; + } + + @SuppressWarnings("boxing") + public static int get15(int a, float b) { + return Box001.getP0(a, b, true); + } + + private static int getP1(int a, float b, boolean c) { + if (c) { + return a + (int) b; + } + return 0; + } + + @SuppressWarnings("boxing") + public static int get16(Integer a, Float b) { + return Box001.getP1(a, b, new Boolean(true)); + } + + @SuppressWarnings("boxing") + public static int get17(Integer a) { + return -a; + } + + @SuppressWarnings("boxing") + public static int get18(Integer a) { + return --a; + } + + @SuppressWarnings("boxing") + public static boolean get19(Boolean a) { + return !a; + } + + @SuppressWarnings("boxing") + public static int get20(Integer a) { + int b = 0; + return b += a ; + } + + @SuppressWarnings("boxing") + public static int get21(Short a) { + int b = 0; + return b += a ; + } + + @SuppressWarnings("boxing") + public static int get22(Integer a) { + return ~a; + } + + public static boolean get23(Integer a) { + return a != null; + } + + @SuppressWarnings("boxing") + public static boolean get24(Boolean result) { + return result != null ? result : false; + } + + @SuppressWarnings("boxing") + public static boolean get25(Boolean result) { + return result == null ? false : result; + } + + @SuppressWarnings("boxing") + public static Object get26(long longValue) { + return (int) longValue; + } + + @SuppressWarnings({"boxing", "cast"}) + public static int get27(Integer longValue) { + return (int) longValue; + } + + @SuppressWarnings("boxing") + public static String get28(short[] types, boolean value) { + StringBuilder result = new StringBuilder(); + result.append(value ? "" : types[0]); + result.append(!value ? "" : types[1]); + return result.toString(); + } + + @SuppressWarnings("boxing") + public static String get29(int a, boolean b) { + return String.format("%d,%b", a, b); + } + + @SuppressWarnings("boxing") + public static Integer[] get30() { + return new Integer[]{1, 2, 3}; + } + + @SuppressWarnings("boxing") + public static int[] get31() { + return new int[]{new Integer(1), new Integer(2), new Integer(3)}; + } + + @SuppressWarnings("boxing") + public static int get32(Integer i) { + switch (i) { + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } + } + + @SuppressWarnings("boxing") + public static int get33(Integer i) { + if (i == 1) { + return 1; + } + return 0; + } + + @SuppressWarnings("boxing") + public static int get34(Boolean b) { + if (b) { + return 1; + } + return 0; + } + + @SuppressWarnings("boxing") + public static int get35(Boolean b) { + return (b ? 1 : 0); + } + + @SuppressWarnings("boxing") + public static int get36(Boolean b) { + int result = 0; + while (b) { + result++; + break; + } + return result; + } + + @SuppressWarnings("boxing") + public static int get37(Boolean b) { + int result = 0; + do { + if (result == 1) { + return 2; + } + result++; + } while (b); + return result; + } + + @SuppressWarnings("boxing") + public static int get38(Boolean b) { + int result = 0; + for (int i =0; b; i++) { + if (result == 1) { + return 2; + } + result++; + } + return result; + } + + public static boolean get39(String a) { + return "aa" == a; + } + + @SuppressWarnings("boxing") + public static int get41(Integer a, Integer b) { + return a + b ; + } + + @SuppressWarnings("boxing") + public static double get42(Double a, Double b) { + return a + b ; + } + + public static final int NONE = 4; + @SuppressWarnings({"boxing", "unused"}) + public static byte get43() { + byte val = 1; + Byte b = new Byte(val); + if (b == null) { + b = NONE; + } + return b; + } + + @SuppressWarnings("boxing") + public static int getValueFromObject(Object values) { + return (Integer)values; + } + + @SuppressWarnings("boxing") + public static int get44() { + int i = 10; + return getValueFromObject(i == 10 ? i : "N/A"); + } + + @SuppressWarnings("boxing") + public static Integer get45(Integer i1, Integer i2) { + Integer i = null; + i = i1 & i2; + return i; + } + + @SuppressWarnings("boxing") + public static int get46(boolean b1, Boolean b2) { + if (b1 == b2) { + return 1; + } + return 0; + } + + public static int get47(int val) { + Integer val1 = new Integer(val); + Integer val2 = new Integer(val); + if (val1 == val2) { + return 1; + } + return 2; + } + + @SuppressWarnings({"boxing", "null"}) + public static int get48() { + Integer integer = null; + return integer; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test001/dx/Tests.java new file mode 100644 index 00000000..1bdd8056 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test001/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test001.dx; + +import com.android.jack.bridge.test001.jack.A; +import com.android.jack.bridge.test001.jack.B; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + A a = new A(); + B b = new B(); + A b2 = new B(); + Assert.assertEquals(a, a.get()); + Assert.assertEquals(b, b.get()); + Assert.assertEquals(b2, b2.get()); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test001/jack/A.java b/jack-tests/tests/com/android/jack/bridge/test001/jack/A.java new file mode 100644 index 00000000..74e2ab4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test001/jack/A.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test001.jack; + +public class A { + + public A() { + } + + public A get() { + return this; + } + +} diff --git a/jack-tests/tests/com/android/jack/bridge/test001/jack/B.java b/jack-tests/tests/com/android/jack/bridge/test001/jack/B.java new file mode 100644 index 00000000..51028d7a --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test001/jack/B.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test001.jack; + +public class B extends A { + + public B() { + } + + @Override + public B get() { + return this; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test002/dx/Tests.java new file mode 100644 index 00000000..1a018ff8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/dx/Tests.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.dx; + +import com.android.jack.bridge.test002.jack.TestsWithJack; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +@SuiteClasses(value = {TestsWithDx.class, TestsWithJack.class}) +public class Tests { +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/bridge/test002/dx/TestsWithDx.java b/jack-tests/tests/com/android/jack/bridge/test002/dx/TestsWithDx.java new file mode 100644 index 00000000..9fc0e680 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/dx/TestsWithDx.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.dx; + +import com.android.jack.bridge.test002.jack.A; +import com.android.jack.bridge.test002.jack.B; +import com.android.jack.bridge.test002.jack.C; +import com.android.jack.bridge.test002.jack.Generic; + +import org.junit.Assert; +import org.junit.Test; + +public class TestsWithDx { + private A a = new A(); + private Object a2 = new A(); + private Object o = new Object(); + private B b = new B(); + private Generic b2 = new B(); + private C c = new C(); + private Generic c2 = new C(); + private Generic go = new Generic(); + private Generic gb = new Generic(); + + @Test + public void test1() { + b.setT(a); + Assert.assertEquals(a, b.getT()); + b2.setT(a2); + Assert.assertEquals(a2, b2.getT()); + c.setT(a); + Assert.assertEquals(a, c.getT()); + c2.setT(a2); + Assert.assertEquals(a2, c2.getT()); + go.setT(a); + Assert.assertEquals(a, go.getT()); + go.setT(o); + Assert.assertEquals(o, go.getT()); + gb.setT(b); + Assert.assertEquals(b, gb.getT()); + gb.setT(o); + Assert.assertEquals(o, gb.getT()); + } + + @Test + public void test2() { + b2.setT(o); + Assert.assertEquals(o, b2.getT()); + } + + @Test + public void test3() { + try { + c2.setT(o); + Assert.fail(); + } catch (ClassCastException e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/jack/A.java b/jack-tests/tests/com/android/jack/bridge/test002/jack/A.java new file mode 100644 index 00000000..f60dac87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.jack; + +public class A { + + public A() { + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/jack/B.java b/jack-tests/tests/com/android/jack/bridge/test002/jack/B.java new file mode 100644 index 00000000..f1c539ed --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.jack; + +public class B extends Generic { + + public B() { + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/jack/C.java b/jack-tests/tests/com/android/jack/bridge/test002/jack/C.java new file mode 100644 index 00000000..6bd16074 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/jack/C.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.jack; + +public class C extends Generic { + + public C() { + } + + @Override + public A getT() { + return super.getT(); + } + + @Override + public void setT(A t) { + super.setT(t); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/jack/Generic.java b/jack-tests/tests/com/android/jack/bridge/test002/jack/Generic.java new file mode 100644 index 00000000..d6848242 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/jack/Generic.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.jack; + +public class Generic { + + private T t; + + public Generic() { + } + + public void setT(T t) { + this.t = t; + } + + public T getT() { + return t; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test002/jack/TestsWithJack.java b/jack-tests/tests/com/android/jack/bridge/test002/jack/TestsWithJack.java new file mode 100644 index 00000000..98434795 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test002/jack/TestsWithJack.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test002.jack; + +import junit.framework.TestCase; + +import org.junit.Assert; + +public class TestsWithJack extends TestCase { + private A a = new A(); + private Object a2 = new A(); + private Object o = new Object(); + private B b = new B(); + private Generic b2 = new B(); + private C c = new C(); + private Generic c2 = new C(); + private Generic go = new Generic(); + private Generic gb = new Generic(); + + public void test1() { + b.setT(a); + Assert.assertEquals(a, b.getT()); + b2.setT(a2); + Assert.assertEquals(a2, b2.getT()); + c.setT(a); + Assert.assertEquals(a, c.getT()); + c2.setT(a2); + Assert.assertEquals(a2, c2.getT()); + go.setT(a); + Assert.assertEquals(a, go.getT()); + go.setT(o); + Assert.assertEquals(o, go.getT()); + gb.setT(b); + Assert.assertEquals(b, gb.getT()); + gb.setT(o); + Assert.assertEquals(o, gb.getT()); + } + + public void test2() { + b2.setT(o); + Assert.assertEquals(o, b2.getT()); + } + + public void test3() { + try { + c2.setT(o); + Assert.fail(); + } catch (ClassCastException e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test003/dx/Tests.java new file mode 100644 index 00000000..f6b7c613 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test003/dx/Tests.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test003.dx; + +import com.android.jack.bridge.test003.jack.Data; +import com.android.jack.bridge.test003.jack.Data.B; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +public class Tests { + @Test + public void test001() throws Exception { + Data data = new Data(); + Method method = data.getMethod1(); + Assert.assertEquals(B.class, method.getDeclaringClass()); + Assert.assertTrue(method.isSynthetic()); + Assert.assertTrue(method.isBridge()); + data.getMethod2(); + + Data.B b = new B(); + b.unchanged(); + b.unchangedFinal(); + } + + @Test + public void test003() throws Exception { + Data data = new Data(); + Method method = data.getMethod3(); + Assert.assertEquals(B.class, method.getDeclaringClass()); + Assert.assertTrue(method.isSynthetic()); + Assert.assertTrue(method.isBridge()); + Assert.assertFalse(Modifier.isSynchronized(method.getModifiers())); + Data.B b = new B(); + b.unchangedSynchronized(); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test003/jack/Data.java b/jack-tests/tests/com/android/jack/bridge/test003/jack/Data.java new file mode 100644 index 00000000..3363a020 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test003/jack/Data.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test003.jack; + +import java.lang.reflect.Method; + +public class Data { + + static class A { + public void unchanged() {} + public final void unchangedFinal() {} + public synchronized void unchangedSynchronized() {} + } + + public static class B extends A {} + + public Method getMethod1() { + Method[] methods = B.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchanged")) { + return method; + } + } + return null; + } + + public Method getMethod2() { + Method[] methods = B.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchangedFinal")) { + return method; + } + } + return null; + } + + public Method getMethod3() { + Method[] methods = B.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchangedSynchronized")) { + return method; + } + } + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test004/dx/Tests.java new file mode 100644 index 00000000..93ba72c5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test004/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test004.dx; + +import com.android.jack.bridge.test004.jack.Data; +import com.android.jack.bridge.test004.jack.Data.B; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.reflect.Method; + +public class Tests { + @Test + public void test001() throws Exception { + Method method = new Data().getMethod(); + Assert.assertNotSame(B.class, new Data().getMethod().getDeclaringClass()); + Assert.assertFalse(method.isSynthetic()); + Assert.assertFalse(method.isBridge()); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test004/jack/Data.java b/jack-tests/tests/com/android/jack/bridge/test004/jack/Data.java new file mode 100644 index 00000000..521876d4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test004/jack/Data.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test004.jack; + +import java.lang.reflect.Method; + +public class Data { + + static class A { + public static void unchanged() {} + } + + public static class B extends A {} + + public static Method getMethod() { + Method[] methods = B.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchanged")) { + return method; + } + } + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test005/dx/Tests.java new file mode 100644 index 00000000..e6df0688 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test005/dx/Tests.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test005.dx; + +import com.android.jack.bridge.test005.jack.Data; +import com.android.jack.bridge.test005.jack.Data.B; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.reflect.Method; + +public class Tests { + + /** + * Test that a visibility bridge is created in B, but not in C. It would not be incorrect, but + * unnecessary. + */ + @Test + public void test001() throws Exception { + Data data = new Data(); + Method method = data.getMethod1(); + Assert.assertEquals(B.class, method.getDeclaringClass()); + Assert.assertTrue(method.isSynthetic()); + Assert.assertTrue(method.isBridge()); + + Data.B b = new B(); + b.unchanged(); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test005/jack/Data.java b/jack-tests/tests/com/android/jack/bridge/test005/jack/Data.java new file mode 100644 index 00000000..2998ef31 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test005/jack/Data.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test005.jack; + +import java.lang.reflect.Method; + +public class Data { + + static class A { + public void unchanged() {} + } + + public static class C extends B {} + + public static class B extends A {} + + + public Method getMethod1() { + Method[] methods = C.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchanged")) { + return method; + } + } + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test006/dx/Tests.java new file mode 100644 index 00000000..5ba3fa99 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test006/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test006.dx; + +import com.android.jack.bridge.test006.jack.Data; +import com.android.jack.bridge.test006.jack.Data.C; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.lang.reflect.Method; + +public class Tests { + @Test + public void test001() throws Exception { + Data data = new Data(); + Method method = data.getMethod1(); + Assert.assertEquals(C.class, method.getDeclaringClass()); + Assert.assertTrue(method.isSynthetic()); + Assert.assertTrue(method.isBridge()); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test006/jack/Data.java b/jack-tests/tests/com/android/jack/bridge/test006/jack/Data.java new file mode 100644 index 00000000..4c5839f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test006/jack/Data.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test006.jack; + +import java.lang.reflect.Method; + +public class Data { + + static class A { + public Object unchanged() { + return this; + } + } + + static class B extends A { + @Override + public B unchanged() { + return this; + } + } + + public static class C extends B { + @Override + public C unchanged() { + return this; + } + } + + public Method getMethod1() { + Method[] methods = C.class.getMethods(); + for (Method method : methods) { + if (method.getName().equals("unchanged") && method.getReturnType().equals(Object.class)) { + return method; + } + } + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/bridge/test007/dx/Tests.java new file mode 100644 index 00000000..693ede0c --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test007/dx/Tests.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test007.dx; + +import com.android.jack.bridge.test007.jack.Caller; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + new Caller().add(Integer.valueOf(0)); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test007/jack/Caller.java b/jack-tests/tests/com/android/jack/bridge/test007/jack/Caller.java new file mode 100644 index 00000000..987ab557 --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test007/jack/Caller.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test007.jack; + +import com.android.jack.bridge.test007.jack.sub.PublicExtendsGeneric; + +public class Caller { + + public void add(Integer start) { + new PublicExtendsGeneric().put(start); + } +} diff --git a/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/GenericPackageProtected.java b/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/GenericPackageProtected.java new file mode 100644 index 00000000..8844d52d --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/GenericPackageProtected.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test007.jack.sub; + + +class GenericPackageProtected { + + public void put(T key) { + } +} + diff --git a/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/PublicExtendsGeneric.java b/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/PublicExtendsGeneric.java new file mode 100644 index 00000000..bd520a9d --- /dev/null +++ b/jack-tests/tests/com/android/jack/bridge/test007/jack/sub/PublicExtendsGeneric.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.bridge.test007.jack.sub; + + +public class PublicExtendsGeneric extends GenericPackageProtected { +} diff --git a/jack-tests/tests/com/android/jack/cast/explicit001/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/explicit001/dx/Tests.java new file mode 100644 index 00000000..a6b04ce5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/explicit001/dx/Tests.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.explicit001.dx; + +import com.android.jack.cast.explicit001.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +/** + * Tests about casts. + */ +public class Tests { + + @Test + public void test1() { + Object stringValue = "stringValue"; + String string = "string"; + Object object = new Object(); + testByteValue((byte)159); + testByteValue((byte)0); + testByteValue((byte)-1); + testByteValue(Byte.MAX_VALUE); + testByteValue(Byte.MIN_VALUE); + + testLongValue(214356475546l); + testLongValue(-1l); + testLongValue(0l); + testLongValue(Long.MAX_VALUE); + testLongValue(Long.MIN_VALUE); + + testFloatValue((float) 0.0); + testFloatValue(-1); + testFloatValue((float) 158753.1574); + testFloatValue(Float.MAX_VALUE); + testFloatValue(Float.MIN_VALUE); + + Assert.assertEquals((String) stringValue, Data.objectToString(stringValue)); + Assert.assertEquals((String) string, Data.stringToString(string)); + Assert.assertEquals((Object) object, Data.objectToObject(object)); + } + + private void testLongValue(long longValue) { + Assert.assertEquals((byte) longValue, Data.longToByte(longValue)); + Assert.assertEquals((char) longValue, Data.longToChar(longValue)); + Assert.assertEquals((short) longValue, Data.longToShort(longValue)); + Assert.assertEquals((int) longValue, Data.longToInt(longValue)); + Assert.assertEquals((long) longValue, Data.longToLong(longValue)); + Assert.assertEquals((float) longValue, Data.longToFloat(longValue), 0.0); + Assert.assertEquals((double) longValue, Data.longToDouble(longValue), 0.0); + } + + private void testFloatValue(float value) { + Assert.assertEquals((byte) value, Data.floatToByte(value)); + Assert.assertEquals((char) value, Data.floatToChar(value)); + Assert.assertEquals((short) value, Data.floatToShort(value)); + Assert.assertEquals((int) value, Data.floatToInt(value)); + Assert.assertEquals((long) value, Data.floatToLong(value)); + Assert.assertEquals((float) value, Data.floatToFloat(value), 0.0); + Assert.assertEquals((double) value, Data.floatToDouble(value), 0.0); + } + + private void testByteValue(byte byteValue) { + Assert.assertEquals((byte) byteValue, Data.byteToByte(byteValue)); + Assert.assertEquals((short) byteValue, Data.byteToShort(byteValue)); + Assert.assertEquals((char) byteValue, Data.byteToChar(byteValue)); + Assert.assertEquals((int) byteValue, Data.byteToInt(byteValue)); + Assert.assertEquals((long) byteValue, Data.byteToLong(byteValue)); + } + +} diff --git a/jack-tests/tests/com/android/jack/cast/explicit001/jack/Data.java b/jack-tests/tests/com/android/jack/cast/explicit001/jack/Data.java new file mode 100644 index 00000000..2d189d93 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/explicit001/jack/Data.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.explicit001.jack; + +public class Data { + + public static char byteToChar(byte value) { + return (char) value; + } + + public static byte byteToByte(byte value) { + return (byte) value; + } + + public static short byteToShort(byte value) { + return (short) value; + } + + public static int byteToInt(byte value) { + return (int) value; + } + + public static long byteToLong(byte value) { + return (long) value; + } + + public static int charToInt(char value) { + return (int) value; + } + + public static int shortToInt(short value) { + return (int) value; + } + + public static byte longToByte(long value) { + return (byte) value; + } + + public static char longToChar(long value) { + return (char) value; + } + + public static short longToShort(long value) { + return (short) value; + } + + public static int longToInt(long value) { + return (int) value; + } + + public static long longToLong(long value) { + return (long) value; + } + + public static float longToFloat(long value) { + return (float) value; + } + + public static double longToDouble(long value) { + return (double) value; + } + + public static byte floatToByte(float value) { + return (byte) value; + } + + public static short floatToShort(float value) { + return (short) value; + } + + public static char floatToChar(float value) { + return (char) value; + } + + public static int floatToInt(float value) { + return (int) value; + } + + public static long floatToLong(float value) { + return (long) value; + } + + public static float floatToFloat(float value) { + return (float) value; + } + + public static double floatToDouble(float value) { + return (double) value; + } + + public static int doubleToInt(double value) { + return (int) value; + } + + public static String objectToString(Object value) { + return (String) value; + } + + public static String stringToString(String value) { + return (String) value; + } + + public static Object objectToObject(Object value) { + return (Object) value; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit001/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/implicit001/dx/Tests.java new file mode 100644 index 00000000..9202eb5c --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit001/dx/Tests.java @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit001.dx; + + +import com.android.jack.cast.implicit001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @SuppressWarnings("cast") + @Test + public void test1() { + Assert.assertEquals((float) 27, Data.returnFloat(27), 0.0); + } + + @SuppressWarnings("cast") + @Test + public void test2() { + Assert.assertEquals((double) (27 + 54), Data.addDouble(27, 54), 0.0); + } + + @SuppressWarnings("cast") + @Test + public void test3() { + Assert.assertEquals((double) (27 + 58.1), Data.addDouble(27, 58.1), 0.0); + } + + @Test + public void test4() { + Assert.assertEquals( 59 + ((double) 59), Data.assignDouble(59), 0.0); + } + + @SuppressWarnings("cast") + @Test + public void test5() { + Assert.assertEquals( (float)(31 + 65), Data.addFloat(31, 65), 0.0); + } + + @Test + public void test6() { + Assert.assertEquals( 31 + 67L, Data.addLong(31, 67L)); + } + + @Test + public void test7() { + Assert.assertEquals( 31 + (long) 67, Data.addIntWithCall(31, 67)); + } + + @Test + public void test8() { + Assert.assertEquals( (byte)(((byte) 31) + ((byte) -1)), Data.addByte((byte) 31, (byte) -1)); + } + + @Test + public void test9() { + Assert.assertEquals(3, Data.addByte()); + } + + @Test + public void test10() { + Assert.assertEquals(~(167L), Data.not(167L)); + } + + @Test + public void test11() { + Assert.assertEquals(~((byte) -1), Data.not((byte) -1)); + } + + @Test + public void test12() { + Assert.assertEquals(-((byte) -1), Data.minus((byte) -1)); + } + + @Test + public void test13() { + Assert.assertEquals(-(-3L), Data.minus(-3L)); + } + + @Test + public void test14() { + Assert.assertEquals(-(-30.5), Data.minus(-30.5), 0.0); + } + + @Test + public void test15() { + Assert.assertEquals(-((char)1587469), Data.minus((char) 1587469)); + } + + @SuppressWarnings("cast") + @Test + public void test16() { + Assert.assertEquals((double)(-((char) 1587467)), Data.minusDouble((char) 1587467), 0.0); + } + + @Test + public void test17() { + Assert.assertEquals(75896L >> 1258632157456L, Data.shr(75896L, 1258632157456L)); + } + + @Test + public void test18() { + Assert.assertEquals(75896L >> (byte) 1258632157, Data.shr(75896L, (byte) 1258632157)); + } + + @Test + public void test19() { + int[] array = {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + Assert.assertEquals(array[(byte) 7], Data.arrayAccess(array, (byte) 7)); + } + + @Test + public void test20() { + Assert.assertEquals(31 + (long) 67, Data.addByteWithCall((byte) 31, (byte) 67)); + } + + @Test + public void test21() { + String s = "2 1"; + Assert.assertEquals(s, Data.getObjectFromString(s)); + } + + @Test + public void test22() { + double value = 57859423453465456.0; + Assert.assertEquals(value, Data.inc(value), 0.0); + } + + @Test + public void test23() { + byte value = 127; + Assert.assertEquals(value, Data.incPost(value)); + } + + @Test + public void test24() { + byte value = 127; + byte valueRef = value; + Assert.assertEquals(++ valueRef, Data.incPre(value)); + } + + @Test + public void test25() { + Assert.assertEquals(-1, Data.setByteArray()); + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit001/jack/Data.java b/jack-tests/tests/com/android/jack/cast/implicit001/jack/Data.java new file mode 100644 index 00000000..206af285 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit001/jack/Data.java @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit001.jack; + +public class Data { + + public static float returnFloat(int a) { + return a; + } + + public static double assignDouble(int a) { + double d = a; + return addDouble(a, d); + } + + public static double addDouble(int a, int b) { + return a + b; + } + + public static double addDouble(int a, double b) { + return a + b; + } + + public static float addFloat(int a, long b) { + return a + b; + } + + public static long addIntWithCall(int a, int b) { + return addLong(a, b); + } + + public static long addByteWithCall(byte a, byte b) { + return addLong(a, b); + } + + public static long addLong(int a, long b) { + return a + b; + } + + public static byte addByte(byte a, byte b) { + byte c = (byte) (a + b); + return c; + } + + + public static byte addByte() { + byte a = 1; + byte b = 2; + a += b; + return a; + } + + public static int not(byte value) { + return ~value; + } + + public static long not(long value) { + return ~value; + } + + public static int minus(byte value) { + return -value; + } + + public static long minus(long value) { + return -value; + } + + public static double minus(double value) { + return -value; + } + + public static int minus(char value) { + return -value; + } + + public static double minusDouble(char value) { + return -value; + } + + public static double inc(double value) { + return value++; + } + + public static byte incPost(byte value) { + return value++; + } + + public static byte incPre(byte value) { + return ++value; + } + + public static long shr(long a, long b) { + return a >> b; + } + public static long shr(long a, byte b) { + return a >> b; + } + + public static int arrayAccess(int[] a, byte b) { + return a[b]; + } + + public static Object getObjectFromString(String s) { + return getObject(s); + } + + public static Object getObject(Object o) { + return o; + } + + private static byte[] arrayByte = new byte[10]; + + public static byte setByteArray() { + arrayByte[1] = (byte) -1; + return arrayByte[1]; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit002/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/implicit002/dx/Tests.java new file mode 100644 index 00000000..1d118785 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit002/dx/Tests.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit002.dx; + + +import com.android.jack.cast.implicit002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void test1() { + boolean cond = true; + boolean cond2 = false; + byte b = 13; + short s = 14; + char c = 15; + int i = 16; + long l = 17; + float f = 0.18f; + double d = 0.19; + Assert.assertEquals(cond ? b : s, Data.conditonalBS(cond, b, s)); + Assert.assertEquals(cond ? l : b, Data.conditonalLB(cond, l, b)); + Assert.assertEquals(cond ? b : b, Data.conditonalBB(cond, b, b)); + Assert.assertEquals(cond ? i : b, Data.conditonalIB(cond, i, b)); + Assert.assertEquals(cond ? b : d, Data.conditonalBD(cond, b, d), 0.0); + Assert.assertEquals(cond ? i : d, Data.conditonalID(cond, i, d), 0.0); + Assert.assertEquals(cond ? l : d, Data.conditonalLD(cond, l, d), 0.0); + Assert.assertEquals(cond ? i : f, Data.conditonalIF(cond, i, f), 0.0); + + Assert.assertEquals(cond2 ? b : s, Data.conditonalBS(cond2, b, s)); + Assert.assertEquals(cond2 ? l : b, Data.conditonalLB(cond2, l, b)); + Assert.assertEquals(cond2 ? b : b, Data.conditonalBB(cond2, b, b)); + Assert.assertEquals(cond2 ? i : b, Data.conditonalIB(cond2, i, b)); + Assert.assertEquals(cond2 ? b : d, Data.conditonalBD(cond2, b, d), 0.0); + Assert.assertEquals(cond2 ? i : d, Data.conditonalID(cond2, i, d), 0.0); + Assert.assertEquals(cond2 ? l : d, Data.conditonalLD(cond2, l, d), 0.0); + Assert.assertEquals(cond2 ? i : f, Data.conditonalIF(cond2, i, f), 0.0); + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit002/jack/Data.java b/jack-tests/tests/com/android/jack/cast/implicit002/jack/Data.java new file mode 100644 index 00000000..36dde8d0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit002/jack/Data.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit002.jack; + +public class Data { + + public static int conditonalIB(boolean cond, int a, byte b) { + return cond ? a : b; + } + + public static byte conditonalBB(boolean cond, byte a, byte b) { + return cond ? a : b; + } + + public static short conditonalBS(boolean cond, byte a, short b) { + return cond ? a : b; + } + + public static long conditonalLB(boolean cond, long a, byte b) { + return cond ? a : b; + } + + public static float conditonalIF(boolean cond, int a, float b) { + return cond ? a : b; + } + + public static double conditonalID(boolean cond, int a, double b) { + return cond ? a : b; + } + + public static double conditonalBD(boolean cond, byte a, double b) { + return cond ? a : b; + } + + public static double conditonalLD(boolean cond, long a, double b) { + return cond ? a : b; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit003/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/implicit003/dx/Tests.java new file mode 100644 index 00000000..3ea62205 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit003/dx/Tests.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit003.dx; + + +import com.android.jack.cast.implicit003.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @SuppressWarnings("boxing") + @Test + public void test1() { + boolean cond = true; + boolean cond2 = false; + byte b = 13; + Byte B = b; + short s = 14; + char c = 15; + int i = 16; + long l = 17; + Long L = l; + float f = 0.18f; + double d = 0.19; + + Assert.assertEquals(cond ? i : B, Data.conditonalIByte(cond, i, B)); + Assert.assertEquals((Object) (cond ? i : L), (Object) Data.conditonalILong(cond, i, L)); + } + +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit003/jack/Data.java b/jack-tests/tests/com/android/jack/cast/implicit003/jack/Data.java new file mode 100644 index 00000000..ec38ee1a --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit003/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit003.jack; + +public class Data { + + @SuppressWarnings("boxing") + public static int conditonalIByte(boolean cond, int a, Byte b) { + return cond ? a : b; + } + + @SuppressWarnings("boxing") + public static Long conditonalILong(boolean cond, int a, Long b) { + return cond ? a : b; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit004/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/implicit004/dx/Tests.java new file mode 100644 index 00000000..8d9d98f5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit004/dx/Tests.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit004.dx; + + +import com.android.jack.cast.implicit004.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void test1() { + byte[] array = new byte[]{1, 2, 3}; + int index = 2; + byte or = 127; + int m1 = array[index] | or; + Assert.assertEquals(m1, Data.m1(array, index, or)); + Assert.assertEquals(m1, array[index]); + } + + @Test + public void test2() { + double[] array = new double[]{1.0, 2.0, 3.0}; + int index = 2; + byte or1 = 127; + byte or2 = 7; + double m2 = or1 | or2; + Assert.assertEquals(m2, Data.m2(array, index, or1, or2), 0.0); + Assert.assertEquals(m2, array[index], 0.0); + } + + @Test + public void test3() { + char[] array = new char[]{1, 2, 3}; + int index = 2; + byte or = 127; + char m3 = (char) (array[index] | or); + Assert.assertEquals(m3, Data.m3(array, index, or)); + Assert.assertEquals(m3, array[index]); + } + + @Test + public void test4() { + byte[] array = new byte[]{1, 2, 3}; + int index = 2; + byte b = 127; + byte m4 = (byte) ~b; + Assert.assertEquals(m4, Data.m4(array, index, b)); + Assert.assertEquals(m4, array[index]); + } + + @Test + public void test5() { + byte[] array = new byte[]{1, 2, 3}; + int index = 2; + byte b = 127; + byte m5 = (byte) (b + 1); + Assert.assertEquals(m5, Data.m5(array, index, b)); + Assert.assertEquals(m5, array[index]); + } + + @Test + public void test6() { + Assert.assertEquals(-1, Data.m6((byte) 1)); + } + +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit004/jack/Data.java b/jack-tests/tests/com/android/jack/cast/implicit004/jack/Data.java new file mode 100644 index 00000000..c125c8e2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit004/jack/Data.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit004.jack; + +public class Data { + + public static byte m1(byte[] array, int index, byte or) { + array[index] |= or; + return array[index]; + } + + public static double m2(double[] array, int index, byte or1, byte or2) { + array[index] = or1 | or2; + return array[index]; + } + + public static char m3(char[] array, int index, byte or) { + array[index] |= or; + return array[index]; + } + + public static int m3(byte b2) { + byte b1; + byte b3; + char c; + int i; + i = b1 = b3 = b2; + return b1 + i; + } + + public static byte m4(byte[] array, int index, byte b) { + array[index] = (byte) ~b; + return array[index]; + } + + public static byte m5(byte[] array, int index, byte b) { + array[index] = ++b; + return array[index]; + } + + public static int m6(byte b) { + int i = -b; + return i; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/implicit005/jack/Data.java b/jack-tests/tests/com/android/jack/cast/implicit005/jack/Data.java new file mode 100644 index 00000000..455cc743 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/implicit005/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.implicit005.jack; + +public class Data { + + public void concat() { + int i = 0; + try { + i = 1; + } finally { + String s = "S" + i + ':'; + } + } + +} diff --git a/jack-tests/tests/com/android/jack/cast/useless001/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/useless001/dx/Tests.java new file mode 100644 index 00000000..c6b180c6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/useless001/dx/Tests.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.useless001.dx; + + +import com.android.jack.cast.useless001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests useless cast. + */ +public class Tests { + + @Test + public void testValue1() { + Data data = new Data(); + Assert.assertEquals(2, data.getValue1()); + } + + @Test + public void testValue2() { + Data data = new Data(); + Assert.assertEquals(3, data.getValue2()); + } + + @Test + public void getValue3() { + Data data = new Data(); + Assert.assertEquals(3, data.getValue3()); + } + + @Test + public void getValue4() { + Data data = new Data(); + Assert.assertEquals(3, data.getValue4()); + } + + @Test + public void getValue5() { + Data data = new Data(); + Assert.assertEquals(3, data.getValue5(new Object[]{null,null,null})); + } +} diff --git a/jack-tests/tests/com/android/jack/cast/useless001/jack/Data.java b/jack-tests/tests/com/android/jack/cast/useless001/jack/Data.java new file mode 100644 index 00000000..9f586968 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/useless001/jack/Data.java @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.useless001.jack; + + + +public class Data { + + class A { + private int f = 1; + + public int getInt() { + return 1; + } + + private int getIntPrivate() { + return 1; + } + + public int getInt3(A a) { + return 1; + } + } + + class B extends A { + private int f = 2; + + @Override + public int getInt() { + return 2; + } + + private int getIntPrivate() { + return 2; + } + + public int getInt3(B b) { + return 2; + } + } + + public int getValue1() { + B b = new B(); + return (((A)b).getInt()); + } + + public int getValue2() { + B b = new B(); + return (((A)b).getIntPrivate() + b.getIntPrivate()); + } + + public int getValue3() { + B b = new B(); + return (((A)b).f + b.f); + } + + public int getValue4() { + B b = new B(); + return (b.getInt3(new B()) + ((A)b).getInt3(new B())); + } + + public int getValue5(Object o) { + return ((Object[]) o).length; + } +} diff --git a/jack-tests/tests/com/android/jack/cast/useless002/dx/Tests.java b/jack-tests/tests/com/android/jack/cast/useless002/dx/Tests.java new file mode 100644 index 00000000..b541bee5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/useless002/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.useless002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.cast.useless002.jack.UselessCast; + +/** + * JUnit test related to useless cast. + */ +public class Tests { + + @Test + public void uselessCastCodeExpansion() { + Assert.assertEquals(1, UselessCast.uselessCast(1, 2, 3)); + Assert.assertEquals(0, UselessCast.uselessCast(2, 1, 3)); + Assert.assertEquals(0, UselessCast.uselessCast(1, 2, 0)); + } +} diff --git a/jack-tests/tests/com/android/jack/cast/useless002/jack/UselessCast.java b/jack-tests/tests/com/android/jack/cast/useless002/jack/UselessCast.java new file mode 100644 index 00000000..cb709f5d --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/useless002/jack/UselessCast.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.useless002.jack; + +/** + * JUnit test allowing to verify that useless casts are not generated. + */ +public class UselessCast { + + // Jack IR should not contains cast between int to long. + public static long uselessCast(int i1, int i2, int i3) { + if (i1 < i2) { + return i3 != 0 ? 1 : 0; + } else { + return 0; + } + } +} diff --git a/jack-tests/tests/com/android/jack/cast/useless003/jack/UselessCast.java b/jack-tests/tests/com/android/jack/cast/useless003/jack/UselessCast.java new file mode 100644 index 00000000..3d6cef61 --- /dev/null +++ b/jack-tests/tests/com/android/jack/cast/useless003/jack/UselessCast.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.cast.useless003.jack; + +/** + * Test allowing to verify that useless casts are not generated. + */ +public class UselessCast { + + long val1; + long val2; + + // Jack IR should not contains cast between int to long. + public void nestedAssign() { + val1 = val2 = 0; + } +} diff --git a/jack-tests/tests/com/android/jack/classpath/test001/jack/Classpath001.java b/jack-tests/tests/com/android/jack/classpath/test001/jack/Classpath001.java new file mode 100644 index 00000000..9bfe71cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test001/jack/Classpath001.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test001.jack; + +import com.android.jack.classpath.test001.lib.Classpath001Lib; + +public class Classpath001 { + + public static int test() { + return Classpath001Lib.f; + } +} diff --git a/jack-tests/tests/com/android/jack/classpath/test001/lib/Classpath001Lib.java b/jack-tests/tests/com/android/jack/classpath/test001/lib/Classpath001Lib.java new file mode 100644 index 00000000..130b8cee --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test001/lib/Classpath001Lib.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test001.lib; + +public class Classpath001Lib { + + public static int f = 5; + +} diff --git a/jack-tests/tests/com/android/jack/classpath/test002/jack/Classpath002.java b/jack-tests/tests/com/android/jack/classpath/test002/jack/Classpath002.java new file mode 100644 index 00000000..e1b6a067 --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test002/jack/Classpath002.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test002.jack; + +import com.android.jack.classpath.test002.lib2.B; + +public class Classpath002 { + + public static int test() { + return B.used(); + } +} diff --git a/jack-tests/tests/com/android/jack/classpath/test002/lib1/A.java b/jack-tests/tests/com/android/jack/classpath/test002/lib1/A.java new file mode 100644 index 00000000..bd5a8978 --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test002/lib1/A.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test002.lib1; + +public class A { + + public static int m() { + return 1; + } + +} diff --git a/jack-tests/tests/com/android/jack/classpath/test002/lib1override/A.java b/jack-tests/tests/com/android/jack/classpath/test002/lib1override/A.java new file mode 100644 index 00000000..fe33edc2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test002/lib1override/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test002.lib1; + +public class A { + +} diff --git a/jack-tests/tests/com/android/jack/classpath/test002/lib2/B.java b/jack-tests/tests/com/android/jack/classpath/test002/lib2/B.java new file mode 100644 index 00000000..f743b995 --- /dev/null +++ b/jack-tests/tests/com/android/jack/classpath/test002/lib2/B.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.classpath.test002.lib2; + +import com.android.jack.classpath.test002.lib1.A; + +public class B { + + public static int used() { + return 3; + } + + private static int deadCode() { + return A.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/clinit/jack/ClInit.java b/jack-tests/tests/com/android/jack/clinit/jack/ClInit.java new file mode 100644 index 00000000..680f9cff --- /dev/null +++ b/jack-tests/tests/com/android/jack/clinit/jack/ClInit.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.clinit.jack; + +public class ClInit { + +} diff --git a/jack-tests/tests/com/android/jack/clinit/jack/ClInitWithVariableInit.java b/jack-tests/tests/com/android/jack/clinit/jack/ClInitWithVariableInit.java new file mode 100644 index 00000000..8c344dd9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/clinit/jack/ClInitWithVariableInit.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.clinit.jack; + +public class ClInitWithVariableInit { + + static { + int lv = 5; + } +} diff --git a/jack-tests/tests/com/android/jack/comparison/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/comparison/test001/dx/Tests.java new file mode 100644 index 00000000..6903ea57 --- /dev/null +++ b/jack-tests/tests/com/android/jack/comparison/test001/dx/Tests.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.comparison.test001.dx; + +import com.android.jack.comparison.test001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about comparisons. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertTrue(Data.test001(1)); + Assert.assertFalse(Data.test001(-1)); + Assert.assertTrue(Data.test002(1)); + Assert.assertFalse(Data.test002(-1)); + Assert.assertEquals(1, Data.test003(-1)); + Assert.assertEquals(2, Data.test003(2)); + Assert.assertEquals(-1, Data.test004(-1)); + Assert.assertEquals(1, Data.test004(2)); + Assert.assertEquals(1, Data.test004(9)); + Assert.assertEquals(1, Data.test004(1)); + Assert.assertEquals(1, Data.test004(7)); + Assert.assertEquals(11, Data.test004(11)); + Assert.assertTrue(Data.test005(1)); + Assert.assertTrue(Data.test005(-1)); + Assert.assertTrue(Data.test005(2)); + Assert.assertTrue(Data.test005(7)); + Assert.assertTrue(Data.test005(9)); + Assert.assertTrue(Data.test005(11)); + } + + @Test + public void test2() { + Assert.assertTrue(Data.test006("abc", "abc")); + Assert.assertFalse(Data.test006("abc", new String("abc"))); + Object o = null; + Assert.assertTrue(Data.test006(o, null)); + } + + @Test + public void test6() { + Assert.assertEquals((byte)10, Data.test007(5, (byte) 10)); + Assert.assertEquals(11, Data.test007(11, (byte) 7)); + } + + @Test + public void test8() { + Assert.assertEquals(2, Data.test008(1)); + } + + @Test + public void test9() { + Assert.assertEquals(2, Data.test009()); + } + + @Test + public void test10() { + Assert.assertEquals(2, Data.test010()); + } + + @Test + public void test11() { + Assert.assertEquals(1, Data.test011()); + } + + @Test + public void test12() { + Data.testFloatCompare(-5.0f, 4.0f, 4.0f, (1.0f/0.0f) / (1.0f/0.0f)); + } +} diff --git a/jack-tests/tests/com/android/jack/comparison/test001/jack/Data.java b/jack-tests/tests/com/android/jack/comparison/test001/jack/Data.java new file mode 100644 index 00000000..0f46f766 --- /dev/null +++ b/jack-tests/tests/com/android/jack/comparison/test001/jack/Data.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.comparison.test001.jack; + +import junit.framework.Assert; + +/** + * Comparison test. + */ +public class Data { + + public static boolean test001(int a) { + boolean b = a > 0; + return b; + } + + public static boolean test002(int a) { + boolean b; + b = a >= 0; + return b; + } + + public static int test003(int a) { + if (a < 0) { + a = 1; + } + return a; + } + + public static int test004(int a) { + boolean b = (a > 0 && a < 10) || (a > 2 && a < 8); + if (b) { + a = 1; + } + return a; + } + + public static boolean test005(int a) { + return m((a > 0 || a < 10) && (a > 2 || a < 8)); + } + + private static boolean m(boolean b){ + return b; + } + + public static boolean test006(Object o1, Object o2) { + return o1 == o2; + } + + public static int test007(int a, byte b) { + if (a < b) { + return b; + } + return a; + } + + public static int test008(int count) { + boolean allowFrontSur = false; + boolean allowEndSur = true; + if ((count & 1) == 1 && (!allowFrontSur || !allowEndSur)) { + return 2; + } + return 3; + } + + public static int test009() { + boolean allowFrontSur = false; + if (!allowFrontSur) { + return 2; + } + return 3; + } + + public static int test010() { + boolean allowFrontSur = false; + return !allowFrontSur ? 2 : 3; + } + + public static int test011() { + int value = 1; + if (!(3 <= value)) { + return 1; + } + return 2; + } + + public static void testFloatCompare(float minus, float plus, float plus2, float nan) { + + if (minus > plus) + Assert.assertTrue(false); + if (plus < minus) + Assert.assertTrue(false); + if (plus == minus) + Assert.assertTrue(false); + if (plus != plus2) + Assert.assertTrue(false); + + if (plus <= nan) + Assert.assertTrue(false); + if (plus >= nan) + Assert.assertTrue(false); + if (minus <= nan) + Assert.assertTrue(false); + if (minus >= nan) + Assert.assertTrue(false); + if (nan >= plus) + Assert.assertTrue(false); + if (nan <= plus) + Assert.assertTrue(false); + + if (nan == nan) + Assert.assertTrue(false); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test001/dx/Tests.java new file mode 100644 index 00000000..db9b9daf --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test001/dx/Tests.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test001.dx; + +import com.android.jack.conditional.test001.jack.Conditional; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Conditional.test_conditionalCode001(15)); + Assert.assertEquals(-1, Conditional.test_conditionalCode001(-15)); + Assert.assertEquals(15, Conditional.test_conditionalCode002(15, -15)); + Assert.assertEquals(1, Conditional.test_conditionalCode003(15, -15)); + Assert.assertEquals(-1, Conditional.test_conditionalCode004(1, 2, 3, 3, 5, 8, 6)); + Assert.assertEquals(1, Conditional.test_conditionalCode005(15, -15)); + Assert.assertEquals(1, Conditional.test_conditionalCode006(true)); + Assert.assertEquals(-1, Conditional.test_conditionalCode006(false)); + + Assert.assertEquals(4, Conditional.test_conditionalCode007(false)); + Assert.assertEquals(5, Conditional.test_conditionalCode008(false)); + Assert.assertEquals(5, Conditional.test_conditionalCode009(false)); + Assert.assertEquals(3, Conditional.test_conditionalCode010(false)); + Assert.assertEquals(4, Conditional.test_conditionalCode011(false)); + Assert.assertEquals(1, Conditional.test_conditionalCode012(false)); + Assert.assertEquals(2, Conditional.test_conditionalCode013(false)); + Assert.assertEquals(4, Conditional.test_conditionalCode014(false)); + Assert.assertEquals(3, Conditional.test_conditionalCode015(false)); + Assert.assertEquals(4, Conditional.test_conditionalCode016(false)); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test001/jack/Conditional.java b/jack-tests/tests/com/android/jack/conditional/test001/jack/Conditional.java new file mode 100644 index 00000000..c0912d03 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test001/jack/Conditional.java @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test001.jack; + +public class Conditional { + + public static int test_conditionalCode001(int a) { + int b = (a > 0) ? 1 : -1; + return b; + } + + public static int test_conditionalCode002(int a, int b) { + int c = (a > 0) ? ((b > a) ? b : a) : -1; + return c; + } + + public static int test_conditionalCode003(int a, int b) { + int c; + if (((a > 0) ? ((b > a) ? b : a) : -1) > 0) { + c = 1; + } else { + c = 3; + } + return c; + } + + public static int test_conditionalCode004(int a, int b, int c, int d, int e, int f, int g) { + int i = + ((c > d) ? (e == f) : (g == a)) ? ((((b == f) ? e : g) > a) ? ((a < c) ? b : g) : a) : -1; + return i; + } + + public static int test_conditionalCode005(int a, int b) { + int x = (a < b) ? (1) : (getValue((b > 0) ? 2 : 3 )); + return x; + } + + public static int test_conditionalCode006(boolean a) { + int b; + b = a ? 1 : -1; + return b; + } + + + public static int test_conditionalCode007(boolean a) { + byte b = 1; + char c = 2; + return m(a ? b : c); + } + + public static int test_conditionalCode008(boolean a) { + byte b = 1; + return m(a ? b : null); + } + + public static int test_conditionalCode009(boolean a) { + byte b = 1; + return m(a ? null : b); + } + + public static int test_conditionalCode010(boolean a) { + byte b = 1; + short c = 1; + return m(a ? c : b); + } + + public static int test_conditionalCode011(boolean a) { + byte b = 1; + return m(a ? 256 : b); + } + + public static int test_conditionalCode012(boolean a) { + byte b = 1; + return m(a ? 12 : b); + } + + public static int test_conditionalCode013(boolean a) { + char b = 1; + return m(a ? 12 : b); + } + + public static int test_conditionalCode014(boolean a) { + char b = 1; + return m(a ? -1 : b); + } + + public static int test_conditionalCode015(boolean a) { + short b = 1; + return m(a ? -1 : b); + } + + public static int test_conditionalCode016(boolean a) { + short b = 1; + return m(a ? 1234567890 : b); + } + + public static int m(byte a) { + return 1; + } + + public static int m(char a) { + return 2; + } + + public static int m(short a) { + return 3; + } + + public static int m(int a) { + return 4; + } + + public static int m(Object a) { + return 5; + } + + public static int getValue(int c) { + return 1; + } + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test002/dx/Tests.java new file mode 100644 index 00000000..b5d41cd6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/dx/Tests.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.dx; + +import com.android.jack.conditional.test002.jack.Conditional2; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Conditional2.test1(true)); + Assert.assertEquals(2, Conditional2.test1(false)); + Assert.assertEquals(2, Conditional2.test2(true)); + Assert.assertEquals(0, Conditional2.test2(false)); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/C.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/C.java new file mode 100644 index 00000000..2046e82a --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/C.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public class C { + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/C1.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/C1.java new file mode 100644 index 00000000..0829440c --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/C1.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public class C1 extends C implements I1, I2 { + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/C2.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/C2.java new file mode 100644 index 00000000..3f60f162 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/C2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public class C2 extends C implements I1, I2 { + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/Conditional2.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/Conditional2.java new file mode 100644 index 00000000..72e800b2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/Conditional2.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public class Conditional2 { + public static int test1(boolean cond) { + return m(cond ? new C1() : new C2()); + } + + private static int m(I1 i1) { + if (i1 instanceof C2) { + return 2; + } else if (i1 instanceof C1) { + return 1; + } else { + return 0; + } + } + public static int test2(boolean cond) { + return m2(cond ? new C1[2] : new C[0]); + } + + private static int m2(C[] cs) { + return cs.length; + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/I1.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/I1.java new file mode 100644 index 00000000..4d63321f --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/I1.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public interface I1 { + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test002/jack/I2.java b/jack-tests/tests/com/android/jack/conditional/test002/jack/I2.java new file mode 100644 index 00000000..2a357f42 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test002/jack/I2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test002.jack; + +public interface I2 { + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test003/dx/Tests.java new file mode 100644 index 00000000..81c79bce --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test003/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test003.dx; + +import com.android.jack.conditional.test003.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals("null", Data.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test003/jack/Data.java b/jack-tests/tests/com/android/jack/conditional/test003/jack/Data.java new file mode 100644 index 00000000..48d9ada5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test003/jack/Data.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test003.jack; + +public class Data { + public static String m() { + String s = "" + (true ? null : null); + return s; + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test004/dx/Tests.java new file mode 100644 index 00000000..9307a306 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test004/dx/Tests.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test004.dx; + +import com.android.jack.conditional.test004.jack.Conditional004; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(2, Conditional004.get(false)); + try { + Conditional004.get(true); + Assert.fail(); + } catch (NullPointerException e) { + // expected + } + } + + @Test + public void test2() { + Assert.assertEquals(2, Conditional004.get2(true)); + try { + Conditional004.get2(false); + Assert.fail(); + } catch (NullPointerException e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test004/jack/Conditional004.java b/jack-tests/tests/com/android/jack/conditional/test004/jack/Conditional004.java new file mode 100644 index 00000000..e93eb2c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test004/jack/Conditional004.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test004.jack; + +public class Conditional004 { + + @SuppressWarnings("boxing") + public static int get(boolean cond) { + return cond ? null : 2; + } + + @SuppressWarnings("boxing") + public static int get2(boolean cond) { + return cond ? 2 : null; + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test005/dx/Tests.java new file mode 100644 index 00000000..662f2504 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test005/dx/Tests.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test005.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.conditional.test005.jack.Conditional005; +import com.android.jack.conditional.test005.jack.Conditional005.A; + +public class Tests { + + @Test + public void test001() { + A[] i = new A[]{new A()}; + Assert.assertEquals(1, Conditional005.test001(i)); + Assert.assertEquals(-1, Conditional005.test001(null)); + } + + @Test + public void test002() { + A[][] i = new A[][]{{new A(), new A()}}; + Assert.assertEquals(1, Conditional005.test002(i)); + Assert.assertEquals(-1, Conditional005.test002(null)); + } + + @Test + public void test003() { + A[] i = new A[]{}; + Assert.assertEquals(0, Conditional005.test003(i)); + Assert.assertEquals(1, Conditional005.test003(null)); + } + + @Test + public void test004() { + int[] i = new int[]{2}; + Assert.assertEquals(3, Conditional005.test004(i)); + Assert.assertEquals(2, Conditional005.test004(null)); + } + + @Test + public void test005() { + int[] i = new int[]{2}; + Assert.assertEquals(i, Conditional005.test005(i)); + Assert.assertNotNull(Conditional005.test005(null)); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test005/jack/Conditional005.java b/jack-tests/tests/com/android/jack/conditional/test005/jack/Conditional005.java new file mode 100644 index 00000000..01d47d36 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test005/jack/Conditional005.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test005.jack; + +public class Conditional005 { + + public static class A { + protected int i = 1; + } + + public static class B extends A{ + public B() { + super(); + i = -1; + } + } + + // Check that type of '?' expression is an array + public static int test001(A[] ai) { + B[] ai1 = new B[]{new B()}; + return (ai == null ? ai1 : ai)[0].i; + } + + // Check that type of '?' expression is an array + public static int test002(A[][] ai) { + B[][] ai1 = new B[][]{{new B(), new B()}}; + return (ai == null ? ai1 : ai)[0][0].i; + } + + // Check that type of '?' expression is an array + public static int test003(A[] ai) { + B[][] ai1 = new B[][]{{new B(), new B()}}; + return (ai == null ? ai1 : ai).length; + } + + // Check that type of '?' expression is an array + public static int test004(int[] ai) { + int[] ai1 = new int[]{1}; + return (ai == null ? ai1 : ai)[0] + 1; + } + + // Check that type of '?' expression is an array + public static Object test005(int[] ai) { + byte[] ai1 = new byte[]{1}; + return (ai == null ? ai1 : ai); + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test006/dx/Tests.java new file mode 100644 index 00000000..0717be13 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test006/dx/Tests.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test006.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.conditional.test006.jack.ConditionalTest006; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(null, ConditionalTest006.test001()); + } + + @Test + public void test002() { + try { + ConditionalTest006.test002(); + Assert.fail("Npe expected"); + } catch (NullPointerException npe) { + // OK + } + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test006/jack/ConditionalTest006.java b/jack-tests/tests/com/android/jack/conditional/test006/jack/ConditionalTest006.java new file mode 100644 index 00000000..63d33e23 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test006/jack/ConditionalTest006.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test006.jack; + +public class ConditionalTest006 { + + // Check that null is assigned to f1 + public static Float test001() { + @SuppressWarnings({"boxing", "unused"}) + Float f1 = false? 1.0f: null; + return f1; + } + + // Check that null pointer exception is trigger due to unboxing of null + public static Float test002() { + @SuppressWarnings({"boxing", "unused"}) + Float f2 = false? 1.0f: false? 1.0f: null; + return f2; + } +} diff --git a/jack-tests/tests/com/android/jack/conditional/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/conditional/test007/dx/Tests.java new file mode 100644 index 00000000..f23b9a22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test007/dx/Tests.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test007.dx; + +import com.android.jack.conditional.test007.jack.ConditionalTest007; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals((short) 1, ConditionalTest007.test001(1, true)); + Assert.assertEquals((short) 2, ConditionalTest007.test001(1, false)); + + Assert.assertEquals((short) 1, ConditionalTest007.test001(2, true)); + Assert.assertEquals((short) 2, ConditionalTest007.test001(2, false)); + + Assert.assertEquals((short) 1, ConditionalTest007.test001(3, true)); + Assert.assertEquals((short) 2, ConditionalTest007.test001(3, false)); + + Assert.assertEquals((short) 1, ConditionalTest007.test001(4, true)); + Assert.assertEquals((short) 2, ConditionalTest007.test001(4, false)); + } + + public void test002() { + Assert.assertEquals((byte) 1, ConditionalTest007.test002a(true)); + Assert.assertEquals((byte) 4, ConditionalTest007.test002a(false)); + + Assert.assertEquals((short) 1, ConditionalTest007.test002b(true)); + Assert.assertEquals((short) 4, ConditionalTest007.test002b(false)); + + Assert.assertEquals('a', ConditionalTest007.test002c(true)); + Assert.assertEquals('a', ConditionalTest007.test002c(false)); + } + + public void test003() { + Assert.assertEquals((byte) 1, ConditionalTest007.test003a(true)); + Assert.assertEquals((byte) 4, ConditionalTest007.test003a(false)); + + Assert.assertEquals((short) 1, ConditionalTest007.test003b(true)); + Assert.assertEquals((short) 4, ConditionalTest007.test003b(false)); + + Assert.assertEquals('a', ConditionalTest007.test003c(true)); + Assert.assertEquals('a', ConditionalTest007.test003c(false)); + } + + +} diff --git a/jack-tests/tests/com/android/jack/conditional/test007/jack/ConditionalTest007.java b/jack-tests/tests/com/android/jack/conditional/test007/jack/ConditionalTest007.java new file mode 100644 index 00000000..4b879db8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/conditional/test007/jack/ConditionalTest007.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.conditional.test007.jack; + +public class ConditionalTest007 { + + @SuppressWarnings("boxing") + public static short test001(int test, boolean condition) { + + Byte b1 = new Byte((byte) 1); + byte b2 = 1; + + Short s1 = new Short((short) 2); + short s2 = 2; + + switch (test) { + case 1: + return condition ? b1 : s1; + case 2: + return condition ? b2 : s1; + case 3: + return condition ? b1 : s2; + case 4: + return condition ? b2 : s2; + default: + throw new AssertionError(); + } + } + + public static byte test002a(boolean condition) { + byte b = 1; + + byte resultByte = condition ? b : 2*2; + + return resultByte; + } + + public static short test002b(boolean condition) { + short s = 1; + + short resultShort = condition ? s : 2*2; + + return resultShort; + } + + public static char test002c(boolean condition) { + char c = 'a'; + + char resultChar = condition ? c : 2*2; + + return resultChar; + } + + + public static byte test003a(boolean condition) { + @SuppressWarnings("boxing") + Byte b = 1; + + @SuppressWarnings("boxing") + byte resultByte = condition ? b : 2*2; + + return resultByte; + } + + public static short test003b(boolean condition) { + @SuppressWarnings("boxing") + Short s = 1; + + @SuppressWarnings("boxing") + short resultShort = condition ? s : 2*2; + + return resultShort; + } + + public static char test003c(boolean condition) { + @SuppressWarnings("boxing") + Character c = 'a'; + + @SuppressWarnings("boxing") + char resultChar = condition ? c : 2*2; + + return resultChar; + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java new file mode 100644 index 00000000..583b5de8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.clazz.dx; + +import com.android.jack.constant.clazz.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +/** + * Tests class. + */ +public class Tests { + + @Test + public void getPrimitiveVoidClass() { + Assert.assertTrue(Data.getPrimitiveVoidClass().getName().equals("void")); + } + + @Test + public void getPrimitiveByteClass() { + Assert.assertTrue(Data.getPrimitiveByteClass().getName().equals("byte")); + } + + @Test + public void getPrimitiveBooleanClass() { + Assert.assertTrue(Data.getPrimitiveBooleanClass().getName().equals("boolean")); + } + + @Test + public void getPrimitiveCharClass() { + Assert.assertTrue(Data.getPrimitiveCharClass().getName().equals("char")); + } + + @Test + public void getPrimitiveShortClass() { + Assert.assertTrue(Data.getPrimitiveShortClass().getName().equals("short")); + } + + @Test + public void getPrimitiveIntClass() { + Assert.assertTrue(Data.getPrimitiveIntClass().getName().equals("int")); + } + + @Test + public void getPrimitiveFloatClass() { + Assert.assertTrue(Data.getPrimitiveFloatClass().getName().equals("float")); + } + + @Test + public void getPrimitiveLongClass() { + Assert.assertTrue(Data.getPrimitiveLongClass().getName().equals("long")); + } + + @Test + public void getPrimitiveDoubleClass() { + Assert.assertTrue(Data.getPrimitiveDoubleClass().getName().equals("double")); + } + + @Test + public void getObjectVoidClass() { + System.out.println(Data.getObjectVoidClass().getName()); + Assert.assertTrue(Data.getObjectVoidClass().getName().equals("java.lang.Void")); + } +} diff --git a/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java b/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java new file mode 100644 index 00000000..a108f22a --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.clazz.jack; + +public class Data { + + public static Class getPrimitiveVoidClass() { + return void.class; + } + + public static Class getPrimitiveIntClass() { + return int.class; + } + + public static Class getPrimitiveBooleanClass() { + return boolean.class; + } + + public static Class getPrimitiveByteClass() { + return byte.class; + } + + public static Class getPrimitiveCharClass() { + return char.class; + } + + public static Class getPrimitiveShortClass() { + return short.class; + } + + public static Class getPrimitiveFloatClass() { + return float.class; + } + + public static Class getPrimitiveDoubleClass() { + return double.class; + } + + public static Class getPrimitiveLongClass() { + return long.class; + } + + public static Class getObjectVoidClass() { + return Void.class; + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test001/dx/Tests.java new file mode 100644 index 00000000..6c824638 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test001/dx/Tests.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test001.dx; + +import com.android.jack.constant.test001.jack.Constant; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + @Test + public void constantBooleanTrue() { + Assert.assertTrue(Constant.getBooleanTrue()); + } + + @Test + public void constantBooleanFalse() { + Assert.assertFalse(Constant.getBooleanFalse()); + } + + @Test + public void constantChar() { + Assert.assertEquals('d', Constant.getChar()); + } + + @Test + public void constantDouble() { + Assert.assertEquals(12.3, Constant.getDouble(), 0); + } + + @Test + public void constantFloat() { + Assert.assertEquals(23.4f, Constant.getFloat(), 0); + } + + @Test + public void constantInt() { + Assert.assertEquals(1337, Constant.getInt()); + } + + @Test + public void constantLong() { + Assert.assertEquals(345l, Constant.getLong()); + } + + @Test + public void constantByte() { + Assert.assertEquals(-1, Constant.getByte()); + } + + @Test + public void constantShort() { + Assert.assertEquals(456, Constant.getShort()); + } + + @Test + public void constantString() { + Assert.assertEquals("abc", Constant.getString()); + } + + @Test + public void constantNull() { + Assert.assertNull(Constant.getNull()); + } + + public void constantObjectClass() { + Class cl = Constant.getObjectClass(); + Assert.assertNotNull(cl); + Assert.assertEquals("java.lang.Object", cl.getName()); + } + + @Test + public void constantClass() { + Class cl = Constant.getConstantClass(); + Assert.assertNotNull(cl); + Assert.assertEquals("com.android.jack.constant.test001.jack.Constant", cl.getName()); + } + + @Test + public void constantIntClass() { + Class cl = Constant.getIntClass(); + Assert.assertNotNull(cl); + Assert.assertEquals("int", cl.getName()); + } + + @Test + public void constantArrayClass() { + Class cl = Constant.getArrayClass(); + Assert.assertNotNull(cl); + Assert.assertEquals("[I", cl.getName()); + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test001/jack/Constant.java b/jack-tests/tests/com/android/jack/constant/test001/jack/Constant.java new file mode 100644 index 00000000..1d3cedb2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test001/jack/Constant.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test001.jack; + +public class Constant { + + public static boolean getBooleanTrue() { + return true; + } + + public static boolean getBooleanFalse() { + return false; + } + + public static char getChar() { + return 'd'; + } + + public static double getDouble() { + return 12.3; + } + + public static float getFloat() { + return 23.4f; + } + + public static int getInt() { + return 1337; + } + + public static long getLong() { + return 345l; + } + + public static byte getByte() { + return -1; + } + + public static short getShort() { + return 456; + } + + public static String getString() { + return "abc"; + } + + public static Object getNull() { + return null; + } + + public static Class getObjectClass() { + return Object.class; + } + + public static Class getConstantClass() { + return Constant.class; + } + + public static Class getIntClass() { + return int.class; + } + + public static Class getArrayClass() { + return int[].class; + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test002/dx/Tests.java new file mode 100644 index 00000000..d619c3b2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test002/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test002.dx; + +import com.android.jack.constant.test002.jack.ConstantReuse; + +import org.junit.Test; + +public class Tests { + @Test + public void test() { + ConstantReuse cr = new ConstantReuse(); + cr.booleanConstantReuse(); + cr.byteConstantReuse(); + cr.charConstantReuse(); + cr.doubleConstantReuse(); + cr.floatConstantReuse(); + cr.intConstantReuse(); + cr.longConstantReuse(); + cr.shortConstantReuse(); + cr.nullConstantReuse(); + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test002/jack/ConstantReuse.java b/jack-tests/tests/com/android/jack/constant/test002/jack/ConstantReuse.java new file mode 100644 index 00000000..a9f8b5b4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test002/jack/ConstantReuse.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test002.jack; + +public class ConstantReuse { + + public void intConstantReuse() { + int a = 0; + int b = 0; + int c = 1; + int d = 1; + } + + public void byteConstantReuse() { + byte a = (byte) 0; + byte b = (byte) 0; + byte c = (byte) 1; + byte d = (byte) 1; + } + + public void shortConstantReuse() { + short a = (short) 0; + short b = (short) 0; + short c = (short) 1; + short d = (short) 1; + } + + public void charConstantReuse() { + char a = (char) 0; + char b = (char) 0; + char c = (char) 1; + char d = (char) 1; + } + + public void floatConstantReuse() { + float a = (float) 0.0; + float b = (float) 0.0; + float c = (float) 1.2; + float d = (float) 1.2; + } + + public void longConstantReuse() { + long a = 0L; + long b = 0L; + long c = 1L; + long d = 1L; + } + + public void doubleConstantReuse() { + double a = 0.0; + double b = 0.0; + double c = 1.2; + double d = 1.2; + } + + public void booleanConstantReuse() { + boolean a = true; + boolean b = true; + boolean c = false; + boolean d = false; + } + + public void nullConstantReuse() { + Object a = null; + Object b = null; + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test003/dx/Tests.java new file mode 100644 index 00000000..06957811 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test003/dx/Tests.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test003.dx; + +import com.android.jack.constant.test003.jack.Constant003; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testNPE() { + try { + Constant003.getZERO(); + Assert.fail(); + } catch (NullPointerException e) { + // expected + } + } + + @Test + public void testSwitch() { + Assert.assertEquals(0, new Constant003().get(0)); + Assert.assertEquals(1, new Constant003().get(1)); + Assert.assertEquals(2, new Constant003().get(2)); + Assert.assertEquals(2, new Constant003().get(-1)); + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/test003/jack/Constant003.java b/jack-tests/tests/com/android/jack/constant/test003/jack/Constant003.java new file mode 100644 index 00000000..178d5461 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test003/jack/Constant003.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test003.jack; + +public class Constant003 { + + private final int ZERO = 0; + private static final int ONE = 1; + + public static int getZERO() { + return ((Constant003) null).ZERO; + } + + public int get(int value) { + switch (value) { + case ZERO: + return 0; + case ONE: + return 1; + default: + return 2; + } + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test004/dx/Tests.java new file mode 100644 index 00000000..35779ca3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test004/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test004.dx; + +import com.android.jack.constant.test004.jack.Constant004; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testSccpBehavior() { + Assert.assertEquals(3, new Constant004().get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/test004/jack/Constant004.java b/jack-tests/tests/com/android/jack/constant/test004/jack/Constant004.java new file mode 100644 index 00000000..5537ccc7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test004/jack/Constant004.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test004.jack; + +public class Constant004 { + + public int get() { + boolean a = true; + if (a) { + return 3; + } else { + return 2; + } + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test005/dx/Tests.java new file mode 100644 index 00000000..c6fa8485 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test005/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test005.dx; + +import com.android.jack.constant.test005.jack.Constant005; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testWithConstant() { + Assert.assertEquals(56, new Constant005().test()); + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/test005/jack/Constant005.java b/jack-tests/tests/com/android/jack/constant/test005/jack/Constant005.java new file mode 100644 index 00000000..5b5982bc --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test005/jack/Constant005.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test005.jack; + +/** + * Test checking that there is only seven constant defined into the generated code. + */ +public class Constant005 { + + public int sum(int a, int b) { + return a + b; + } + + public int test() { + int a = 1; + int b = 2; + int c = 3; + int d = 4; + int e = 5; + int f = 6; + int g = 7; + int sum1 = sum (a,a); + int sum2 = sum (b,b); + int sum3 = sum (c,c); + int sum4 = sum (d,d); + int sum5 = sum (e,e); + int sum6 = sum (f,f); + int sum7 = sum (g,g); + return sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/constant/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test006/dx/Tests.java new file mode 100644 index 00000000..a79a85f1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test006/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test006.dx; + +import com.android.jack.constant.test006.jack.Constant006; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testWithConstant() { + Assert.assertEquals(11, new Constant006().test(true)); + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/test006/jack/Constant006.java b/jack-tests/tests/com/android/jack/constant/test006/jack/Constant006.java new file mode 100644 index 00000000..ff06cd91 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test006/jack/Constant006.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test006.jack; + +/** + * Test checking that the constant {@code a} is not propagate as a float. + */ +public class Constant006 { + + public int test(boolean b) { + int a = 10; + float c = a; + return a + 1; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/constant/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/test007/dx/Tests.java new file mode 100644 index 00000000..4a5608cb --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test007/dx/Tests.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test007.dx; + + +import com.android.jack.constant.test007.jack.Constant007; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testConstant() { + Assert.assertEquals(1000, new Constant007().get(500), 0); + Assert.assertEquals(500, new Constant007().get(1000), 0); + } + +} diff --git a/jack-tests/tests/com/android/jack/constant/test007/jack/Constant007.java b/jack-tests/tests/com/android/jack/constant/test007/jack/Constant007.java new file mode 100644 index 00000000..4d59ae29 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test007/jack/Constant007.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test007.jack; + +/** + * Test checking that the constant {@code time} is not propagated as a float. + */ +public class Constant007 { + + public float get(int value) { + int time = 500; + if (value == time) { + time = 1000; + } + return time; + } +} diff --git a/jack-tests/tests/com/android/jack/constant/test008/jack/Constant008.java b/jack-tests/tests/com/android/jack/constant/test008/jack/Constant008.java new file mode 100644 index 00000000..5753b8cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/test008/jack/Constant008.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.constant.test008.jack; + +/** + * Test checking that type of {@code time} is not changed to long due to constant optimization. + */ +public class Constant008 { + + private int field = 500; + + public long get() { + int time = field; + if (time < 0) { + time = 1; + } else { + time = 2; + } + return time; + } +} diff --git a/jack-tests/tests/com/android/jack/debug/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/debug/test001/dx/Tests.java new file mode 100644 index 00000000..8d118aa9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test001/dx/Tests.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test001.dx; + +import com.android.jack.debug.test001.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + try { + Data.throwNew(); + Assert.fail(); + } catch (Exception e) { + StackTraceElement stackHead = e.getStackTrace()[0]; + Assert.assertEquals("Data.java", stackHead.getFileName()); + Assert.assertEquals(22, stackHead.getLineNumber()); + } + } +} diff --git a/jack-tests/tests/com/android/jack/debug/test001/jack/Data.java b/jack-tests/tests/com/android/jack/debug/test001/jack/Data.java new file mode 100644 index 00000000..c5f7fe37 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test001/jack/Data.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test001.jack; + +public class Data { + + public static void throwNew() throws Exception { + throw new Exception(); + } +} diff --git a/jack-tests/tests/com/android/jack/debug/test001/test.mk b/jack-tests/tests/com/android/jack/debug/test001/test.mk new file mode 100644 index 00000000..45748cd7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test001/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := debug/test001 +JACKTEST_ARGS := -g +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(call all-java-files-under, $(abspath $(private_path)/dx/)) +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/debug/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/debug/test002/dx/Tests.java new file mode 100644 index 00000000..259d97f3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test002/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test002.dx; + +import com.android.jack.debug.test002.jack.Debug002; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Debug002.staticM(24); + new Debug002().instance(56); + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test002/jack/Debug002.java b/jack-tests/tests/com/android/jack/debug/test002/jack/Debug002.java new file mode 100644 index 00000000..fd2b14eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test002/jack/Debug002.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test002.jack; + +public class Debug002 { + + public static int staticM(int arg) { + int lv1 = 4; + lv1 = incM(lv1); + lv1 += arg; + return lv1; + } + + public int instance(int arg) { + int lv1 = 4; + inc(lv1); + lv1 += arg; + return lv1; + } + + public static int incM(int i) { + return i++; + } + + public int inc(int i) { + return i++; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test003/jack/Debug003.java b/jack-tests/tests/com/android/jack/debug/test003/jack/Debug003.java new file mode 100644 index 00000000..a0bb78e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test003/jack/Debug003.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test003.jack; + +public class Debug003 extends Throwable { + + public boolean testNullDebugInfo() { + String value = null; + if (value != null) { + return true; + } + value = "default"; + return "default" == value; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/debug/test004/dx/Tests.java new file mode 100644 index 00000000..866316dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test004/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test004.dx; + +import com.android.jack.debug.test004.jack.Debug004; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(10, Debug004.getNullDebugInfo()); + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test004/jack/Debug004.java b/jack-tests/tests/com/android/jack/debug/test004/jack/Debug004.java new file mode 100644 index 00000000..ab337b02 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test004/jack/Debug004.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test004.jack; + +public class Debug004 extends Exception { + + public static int getNullDebugInfo() { + String value = null; + Integer value2 = null; + String tmp = null; + value = "default"; + value2 = 3; + return value.length() + value2.intValue(); + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test005/jack/ImplicitReturn.java b/jack-tests/tests/com/android/jack/debug/test005/jack/ImplicitReturn.java new file mode 100644 index 00000000..8b7fe941 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test005/jack/ImplicitReturn.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test005.jack; + +public class ImplicitReturn { + + public void implicitReturn() { + String value = null; + int value2 = 3; + } + + public static void staticImplicitReturn() { + String value = null; + int value2 = 3; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test006/jack/MultipleLineStatement.java b/jack-tests/tests/com/android/jack/debug/test006/jack/MultipleLineStatement.java new file mode 100644 index 00000000..0f290a5c --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test006/jack/MultipleLineStatement.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test006.jack; + +public class MultipleLineStatement { + + public void multipleLineStatement1() { + int value2 + = 3; + } + + public int multipleLineStatement2() { + return + 4; + } + + public int multipleLineStatement3(boolean b, int i) { + return b? + i: + 4; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test007/jack/Test007.java b/jack-tests/tests/com/android/jack/debug/test007/jack/Test007.java new file mode 100644 index 00000000..f845d724 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test007/jack/Test007.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test007.jack; + +public class Test007 { + + int i = 1; + + char c; + + boolean z = false; + + long j = 12345678901234l; + +} diff --git a/jack-tests/tests/com/android/jack/debug/test008/jack/Test008.java b/jack-tests/tests/com/android/jack/debug/test008/jack/Test008.java new file mode 100644 index 00000000..c04814e0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test008/jack/Test008.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test008.jack; + +public class Test008 { + + int i = 1; + + char c; + + boolean z = false; + + long j = 12345678901234l; + + public Test008() { + + } + public Test008(String arg) { + return; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test009/jack/Test009.java b/jack-tests/tests/com/android/jack/debug/test009/jack/Test009.java new file mode 100644 index 00000000..a86825f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test009/jack/Test009.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test009.jack; + +public class Test009 { + + public static final class A { + public static final int ZERO = 0; + + public static final int ONE = 1; + + public static final int TWO = 2; + + public static final int THREE = 3; + + + + public static final int FOUR = 4; + + } + + public static final class B { + public static final int ZERO = 0; + + public static final int ONE = 1; + + public static final int TWO = 2; + + public static final int THREE = 3; + + + + public static final int FOUR = 4; + + } + + public static final class C { + public final int ZERO = 0; + + public final int ONE = 1; + + public final int TWO = 2; + + public final int THREE = 3; + + + + public final int FOUR = 4; + + } + + +} diff --git a/jack-tests/tests/com/android/jack/debug/test010/jack/Test010.java b/jack-tests/tests/com/android/jack/debug/test010/jack/Test010.java new file mode 100644 index 00000000..f10ffdb8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test010/jack/Test010.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test010.jack; + +public class Test010 { + + public static final class C { + public final int ZERO = 0; + + public final int ONE = 1; + + public final int TWO = 2; + + public final int THREE = 3; + + + + public final int FOUR = 4; + + } + + +} diff --git a/jack-tests/tests/com/android/jack/debug/test011/jack/Test011.java b/jack-tests/tests/com/android/jack/debug/test011/jack/Test011.java new file mode 100644 index 00000000..b9e26cd7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test011/jack/Test011.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test011.jack; + +public class Test011 { + + + + + +} diff --git a/jack-tests/tests/com/android/jack/debug/test012/jack/Debug012.java b/jack-tests/tests/com/android/jack/debug/test012/jack/Debug012.java new file mode 100644 index 00000000..ca5cdb19 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test012/jack/Debug012.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test012.jack; + +public class Debug012 { + + int v; + + public Debug012(int arg1, + int arg2, int arg3, + int arg4) { + v = arg4; + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test013/jack/Debug013.java b/jack-tests/tests/com/android/jack/debug/test013/jack/Debug013.java new file mode 100644 index 00000000..95422823 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test013/jack/Debug013.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test013.jack; + +public class Debug013 { + + public void add(E o) { + System.out.println(o); + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test014/jack/Debug014.java b/jack-tests/tests/com/android/jack/debug/test014/jack/Debug014.java new file mode 100644 index 00000000..11549651 --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test014/jack/Debug014.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test014.jack; + +public class Debug014 { + + public void debug014() { + Coll coll = new Coll(); + } + + static class Coll { + + } + +} diff --git a/jack-tests/tests/com/android/jack/debug/test019/jack/Debug019.java b/jack-tests/tests/com/android/jack/debug/test019/jack/Debug019.java new file mode 100644 index 00000000..9dde15bf --- /dev/null +++ b/jack-tests/tests/com/android/jack/debug/test019/jack/Debug019.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.debug.test019.jack; + +public class Debug019 { + public Object get(boolean cond) { + Object object; + if (cond) + object = null; + else + object = this; + return object; + } +} diff --git a/jack-tests/tests/com/android/jack/dx/compiler/dx/Tests.java b/jack-tests/tests/com/android/jack/dx/compiler/dx/Tests.java new file mode 100644 index 00000000..bc8888ff --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/compiler/dx/Tests.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.compiler.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.dx.compiler.jack.Data; + + +/** + * Tests bug related to dx. + */ +public class Tests { + + @Test + public void subInt() { + Assert.assertEquals(0, Data.apply()); + } + + @Test + public void largeFrame() { + Assert.assertEquals(499500, Data.largeFrame()); + } + + @Test + public void getArray() { + Assert.assertEquals(11, Data.getArray(5)[0]); + } +} diff --git a/jack-tests/tests/com/android/jack/dx/compiler/jack/Data.java b/jack-tests/tests/com/android/jack/dx/compiler/jack/Data.java new file mode 100644 index 00000000..e449372a --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/compiler/jack/Data.java @@ -0,0 +1,4316 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.compiler.jack; + +/** + * Test dx related bug. + */ +public class Data { + + public static int getValue(int a) { + return a; + } + + public static int apply() { + int tmp; + int tmp2; + + int reserved0; + int reserved1; + int reserved2; + int reserved3; + int reserved4; + int reserved5; + int reserved6; + int reserved7; + int reserved8; + int reserved9; + int reserved10; + int reserved11; + int reserved12; + int reserved13; + int reserved14; + int reserved15; + int reserved16; + int reserved17; + int reserved18; + int reserved19; + int reserved20; + int reserved21; + int reserved22; + int reserved23; + int reserved24; + int reserved25; + int reserved26; + int reserved27; + int reserved28; + int reserved29; + int reserved30; + int reserved31; + int reserved32; + int reserved33; + int reserved34; + int reserved35; + int reserved36; + int reserved37; + int reserved38; + int reserved39; + int reserved40; + int reserved41; + int reserved42; + int reserved43; + int reserved44; + int reserved45; + int reserved46; + int reserved47; + int reserved48; + int reserved49; + int reserved50; + int reserved51; + int reserved52; + int reserved53; + int reserved54; + int reserved55; + int reserved56; + int reserved57; + int reserved58; + int reserved59; + int reserved60; + int reserved61; + int reserved62; + int reserved63; + int reserved64; + int reserved65; + int reserved66; + int reserved67; + int reserved68; + int reserved69; + int reserved70; + int reserved71; + int reserved72; + int reserved73; + int reserved74; + int reserved75; + int reserved76; + int reserved77; + int reserved78; + int reserved79; + int reserved80; + int reserved81; + int reserved82; + int reserved83; + int reserved84; + int reserved85; + int reserved86; + int reserved87; + int reserved88; + int reserved89; + int reserved90; + int reserved91; + int reserved92; + int reserved93; + int reserved94; + int reserved95; + int reserved96; + int reserved97; + int reserved98; + int reserved99; + int reserved100; + int reserved101; + int reserved102; + int reserved103; + int reserved104; + int reserved105; + int reserved106; + int reserved107; + int reserved108; + int reserved109; + int reserved110; + int reserved111; + int reserved112; + int reserved113; + int reserved114; + int reserved115; + int reserved116; + int reserved117; + int reserved118; + int reserved119; + int reserved120; + int reserved121; + int reserved122; + int reserved123; + int reserved124; + int reserved125; + int reserved126; + int reserved127; + int reserved128; + int reserved129; + int reserved130; + int reserved131; + int reserved132; + int reserved133; + int reserved134; + int reserved135; + int reserved136; + int reserved137; + int reserved138; + int reserved139; + int reserved140; + int reserved141; + int reserved142; + int reserved143; + int reserved144; + int reserved145; + int reserved146; + int reserved147; + int reserved148; + int reserved149; + int reserved150; + int reserved151; + int reserved152; + int reserved153; + int reserved154; + int reserved155; + int reserved156; + int reserved157; + int reserved158; + int reserved159; + int reserved160; + int reserved161; + int reserved162; + int reserved163; + int reserved164; + int reserved165; + int reserved166; + int reserved167; + int reserved168; + int reserved169; + int reserved170; + int reserved171; + int reserved172; + int reserved173; + int reserved174; + int reserved175; + int reserved176; + int reserved177; + int reserved178; + int reserved179; + int reserved180; + int reserved181; + int reserved182; + int reserved183; + int reserved184; + int reserved185; + int reserved186; + int reserved187; + int reserved188; + int reserved189; + int reserved190; + int reserved191; + int reserved192; + int reserved193; + int reserved194; + int reserved195; + int reserved196; + int reserved197; + int reserved198; + int reserved199; + int reserved200; + int reserved201; + int reserved202; + int reserved203; + int reserved204; + int reserved205; + int reserved206; + int reserved207; + int reserved208; + int reserved209; + int reserved210; + int reserved211; + int reserved212; + int reserved213; + int reserved214; + int reserved215; + int reserved216; + int reserved217; + int reserved218; + int reserved219; + int reserved220; + int reserved221; + int reserved222; + int reserved223; + int reserved224; + int reserved225; + int reserved226; + int reserved227; + int reserved228; + int reserved229; + int reserved230; + int reserved231; + int reserved232; + int reserved233; + int reserved234; + int reserved235; + int reserved236; + int reserved237; + int reserved238; + int reserved239; + int reserved240; + int reserved241; + int reserved242; + int reserved243; + int reserved244; + int reserved245; + int reserved246; + int reserved247; + int reserved248; + int reserved249; + int reserved250; + int reserved251; + int reserved252; + int reserved253; + int reserved254; + int reserved255; + + int i = 1; + + tmp = getValue(i); + tmp2 = i - tmp; + i = tmp2; + + return i; + } + + public static long largeFrame() { + int i0 = 0; + long l0 = 0; + int i1 = 1; + long l1 = 1; + int i2 = 2; + long l2 = 2; + int i3 = 3; + long l3 = 3; + int i4 = 4; + long l4 = 4; + int i5 = 5; + long l5 = 5; + int i6 = 6; + long l6 = 6; + int i7 = 7; + long l7 = 7; + int i8 = 8; + long l8 = 8; + int i9 = 9; + long l9 = 9; + int i10 = 10; + long l10 = 10; + int i11 = 11; + long l11 = 11; + int i12 = 12; + long l12 = 12; + int i13 = 13; + long l13 = 13; + int i14 = 14; + long l14 = 14; + int i15 = 15; + long l15 = 15; + int i16 = 16; + long l16 = 16; + int i17 = 17; + long l17 = 17; + int i18 = 18; + long l18 = 18; + int i19 = 19; + long l19 = 19; + int i20 = 20; + long l20 = 20; + int i21 = 21; + long l21 = 21; + int i22 = 22; + long l22 = 22; + int i23 = 23; + long l23 = 23; + int i24 = 24; + long l24 = 24; + int i25 = 25; + long l25 = 25; + int i26 = 26; + long l26 = 26; + int i27 = 27; + long l27 = 27; + int i28 = 28; + long l28 = 28; + int i29 = 29; + long l29 = 29; + int i30 = 30; + long l30 = 30; + int i31 = 31; + long l31 = 31; + int i32 = 32; + long l32 = 32; + int i33 = 33; + long l33 = 33; + int i34 = 34; + long l34 = 34; + int i35 = 35; + long l35 = 35; + int i36 = 36; + long l36 = 36; + int i37 = 37; + long l37 = 37; + int i38 = 38; + long l38 = 38; + int i39 = 39; + long l39 = 39; + int i40 = 40; + long l40 = 40; + int i41 = 41; + long l41 = 41; + int i42 = 42; + long l42 = 42; + int i43 = 43; + long l43 = 43; + int i44 = 44; + long l44 = 44; + int i45 = 45; + long l45 = 45; + int i46 = 46; + long l46 = 46; + int i47 = 47; + long l47 = 47; + int i48 = 48; + long l48 = 48; + int i49 = 49; + long l49 = 49; + int i50 = 50; + long l50 = 50; + int i51 = 51; + long l51 = 51; + int i52 = 52; + long l52 = 52; + int i53 = 53; + long l53 = 53; + int i54 = 54; + long l54 = 54; + int i55 = 55; + long l55 = 55; + int i56 = 56; + long l56 = 56; + int i57 = 57; + long l57 = 57; + int i58 = 58; + long l58 = 58; + int i59 = 59; + long l59 = 59; + int i60 = 60; + long l60 = 60; + int i61 = 61; + long l61 = 61; + int i62 = 62; + long l62 = 62; + int i63 = 63; + long l63 = 63; + int i64 = 64; + long l64 = 64; + int i65 = 65; + long l65 = 65; + int i66 = 66; + long l66 = 66; + int i67 = 67; + long l67 = 67; + int i68 = 68; + long l68 = 68; + int i69 = 69; + long l69 = 69; + int i70 = 70; + long l70 = 70; + int i71 = 71; + long l71 = 71; + int i72 = 72; + long l72 = 72; + int i73 = 73; + long l73 = 73; + int i74 = 74; + long l74 = 74; + int i75 = 75; + long l75 = 75; + int i76 = 76; + long l76 = 76; + int i77 = 77; + long l77 = 77; + int i78 = 78; + long l78 = 78; + int i79 = 79; + long l79 = 79; + int i80 = 80; + long l80 = 80; + int i81 = 81; + long l81 = 81; + int i82 = 82; + long l82 = 82; + int i83 = 83; + long l83 = 83; + int i84 = 84; + long l84 = 84; + int i85 = 85; + long l85 = 85; + int i86 = 86; + long l86 = 86; + int i87 = 87; + long l87 = 87; + int i88 = 88; + long l88 = 88; + int i89 = 89; + long l89 = 89; + int i90 = 90; + long l90 = 90; + int i91 = 91; + long l91 = 91; + int i92 = 92; + long l92 = 92; + int i93 = 93; + long l93 = 93; + int i94 = 94; + long l94 = 94; + int i95 = 95; + long l95 = 95; + int i96 = 96; + long l96 = 96; + int i97 = 97; + long l97 = 97; + int i98 = 98; + long l98 = 98; + int i99 = 99; + long l99 = 99; + int i100 = 100; + long l100 = 100; + int i101 = 101; + long l101 = 101; + int i102 = 102; + long l102 = 102; + int i103 = 103; + long l103 = 103; + int i104 = 104; + long l104 = 104; + int i105 = 105; + long l105 = 105; + int i106 = 106; + long l106 = 106; + int i107 = 107; + long l107 = 107; + int i108 = 108; + long l108 = 108; + int i109 = 109; + long l109 = 109; + int i110 = 110; + long l110 = 110; + int i111 = 111; + long l111 = 111; + int i112 = 112; + long l112 = 112; + int i113 = 113; + long l113 = 113; + int i114 = 114; + long l114 = 114; + int i115 = 115; + long l115 = 115; + int i116 = 116; + long l116 = 116; + int i117 = 117; + long l117 = 117; + int i118 = 118; + long l118 = 118; + int i119 = 119; + long l119 = 119; + int i120 = 120; + long l120 = 120; + int i121 = 121; + long l121 = 121; + int i122 = 122; + long l122 = 122; + int i123 = 123; + long l123 = 123; + int i124 = 124; + long l124 = 124; + int i125 = 125; + long l125 = 125; + int i126 = 126; + long l126 = 126; + int i127 = 127; + long l127 = 127; + int i128 = 128; + long l128 = 128; + int i129 = 129; + long l129 = 129; + int i130 = 130; + long l130 = 130; + int i131 = 131; + long l131 = 131; + int i132 = 132; + long l132 = 132; + int i133 = 133; + long l133 = 133; + int i134 = 134; + long l134 = 134; + int i135 = 135; + long l135 = 135; + int i136 = 136; + long l136 = 136; + int i137 = 137; + long l137 = 137; + int i138 = 138; + long l138 = 138; + int i139 = 139; + long l139 = 139; + int i140 = 140; + long l140 = 140; + int i141 = 141; + long l141 = 141; + int i142 = 142; + long l142 = 142; + int i143 = 143; + long l143 = 143; + int i144 = 144; + long l144 = 144; + int i145 = 145; + long l145 = 145; + int i146 = 146; + long l146 = 146; + int i147 = 147; + long l147 = 147; + int i148 = 148; + long l148 = 148; + int i149 = 149; + long l149 = 149; + int i150 = 150; + long l150 = 150; + int i151 = 151; + long l151 = 151; + int i152 = 152; + long l152 = 152; + int i153 = 153; + long l153 = 153; + int i154 = 154; + long l154 = 154; + int i155 = 155; + long l155 = 155; + int i156 = 156; + long l156 = 156; + int i157 = 157; + long l157 = 157; + int i158 = 158; + long l158 = 158; + int i159 = 159; + long l159 = 159; + int i160 = 160; + long l160 = 160; + int i161 = 161; + long l161 = 161; + int i162 = 162; + long l162 = 162; + int i163 = 163; + long l163 = 163; + int i164 = 164; + long l164 = 164; + int i165 = 165; + long l165 = 165; + int i166 = 166; + long l166 = 166; + int i167 = 167; + long l167 = 167; + int i168 = 168; + long l168 = 168; + int i169 = 169; + long l169 = 169; + int i170 = 170; + long l170 = 170; + int i171 = 171; + long l171 = 171; + int i172 = 172; + long l172 = 172; + int i173 = 173; + long l173 = 173; + int i174 = 174; + long l174 = 174; + int i175 = 175; + long l175 = 175; + int i176 = 176; + long l176 = 176; + int i177 = 177; + long l177 = 177; + int i178 = 178; + long l178 = 178; + int i179 = 179; + long l179 = 179; + int i180 = 180; + long l180 = 180; + int i181 = 181; + long l181 = 181; + int i182 = 182; + long l182 = 182; + int i183 = 183; + long l183 = 183; + int i184 = 184; + long l184 = 184; + int i185 = 185; + long l185 = 185; + int i186 = 186; + long l186 = 186; + int i187 = 187; + long l187 = 187; + int i188 = 188; + long l188 = 188; + int i189 = 189; + long l189 = 189; + int i190 = 190; + long l190 = 190; + int i191 = 191; + long l191 = 191; + int i192 = 192; + long l192 = 192; + int i193 = 193; + long l193 = 193; + int i194 = 194; + long l194 = 194; + int i195 = 195; + long l195 = 195; + int i196 = 196; + long l196 = 196; + int i197 = 197; + long l197 = 197; + int i198 = 198; + long l198 = 198; + int i199 = 199; + long l199 = 199; + int i200 = 200; + long l200 = 200; + int i201 = 201; + long l201 = 201; + int i202 = 202; + long l202 = 202; + int i203 = 203; + long l203 = 203; + int i204 = 204; + long l204 = 204; + int i205 = 205; + long l205 = 205; + int i206 = 206; + long l206 = 206; + int i207 = 207; + long l207 = 207; + int i208 = 208; + long l208 = 208; + int i209 = 209; + long l209 = 209; + int i210 = 210; + long l210 = 210; + int i211 = 211; + long l211 = 211; + int i212 = 212; + long l212 = 212; + int i213 = 213; + long l213 = 213; + int i214 = 214; + long l214 = 214; + int i215 = 215; + long l215 = 215; + int i216 = 216; + long l216 = 216; + int i217 = 217; + long l217 = 217; + int i218 = 218; + long l218 = 218; + int i219 = 219; + long l219 = 219; + int i220 = 220; + long l220 = 220; + int i221 = 221; + long l221 = 221; + int i222 = 222; + long l222 = 222; + int i223 = 223; + long l223 = 223; + int i224 = 224; + long l224 = 224; + int i225 = 225; + long l225 = 225; + int i226 = 226; + long l226 = 226; + int i227 = 227; + long l227 = 227; + int i228 = 228; + long l228 = 228; + int i229 = 229; + long l229 = 229; + int i230 = 230; + long l230 = 230; + int i231 = 231; + long l231 = 231; + int i232 = 232; + long l232 = 232; + int i233 = 233; + long l233 = 233; + int i234 = 234; + long l234 = 234; + int i235 = 235; + long l235 = 235; + int i236 = 236; + long l236 = 236; + int i237 = 237; + long l237 = 237; + int i238 = 238; + long l238 = 238; + int i239 = 239; + long l239 = 239; + int i240 = 240; + long l240 = 240; + int i241 = 241; + long l241 = 241; + int i242 = 242; + long l242 = 242; + int i243 = 243; + long l243 = 243; + int i244 = 244; + long l244 = 244; + int i245 = 245; + long l245 = 245; + int i246 = 246; + long l246 = 246; + int i247 = 247; + long l247 = 247; + int i248 = 248; + long l248 = 248; + int i249 = 249; + long l249 = 249; + int i250 = 250; + long l250 = 250; + int i251 = 251; + long l251 = 251; + int i252 = 252; + long l252 = 252; + int i253 = 253; + long l253 = 253; + int i254 = 254; + long l254 = 254; + int i255 = 255; + long l255 = 255; + int i256 = 256; + long l256 = 256; + int i257 = 257; + long l257 = 257; + int i258 = 258; + long l258 = 258; + int i259 = 259; + long l259 = 259; + int i260 = 260; + long l260 = 260; + int i261 = 261; + long l261 = 261; + int i262 = 262; + long l262 = 262; + int i263 = 263; + long l263 = 263; + int i264 = 264; + long l264 = 264; + int i265 = 265; + long l265 = 265; + int i266 = 266; + long l266 = 266; + int i267 = 267; + long l267 = 267; + int i268 = 268; + long l268 = 268; + int i269 = 269; + long l269 = 269; + int i270 = 270; + long l270 = 270; + int i271 = 271; + long l271 = 271; + int i272 = 272; + long l272 = 272; + int i273 = 273; + long l273 = 273; + int i274 = 274; + long l274 = 274; + int i275 = 275; + long l275 = 275; + int i276 = 276; + long l276 = 276; + int i277 = 277; + long l277 = 277; + int i278 = 278; + long l278 = 278; + int i279 = 279; + long l279 = 279; + int i280 = 280; + long l280 = 280; + int i281 = 281; + long l281 = 281; + int i282 = 282; + long l282 = 282; + int i283 = 283; + long l283 = 283; + int i284 = 284; + long l284 = 284; + int i285 = 285; + long l285 = 285; + int i286 = 286; + long l286 = 286; + int i287 = 287; + long l287 = 287; + int i288 = 288; + long l288 = 288; + int i289 = 289; + long l289 = 289; + int i290 = 290; + long l290 = 290; + int i291 = 291; + long l291 = 291; + int i292 = 292; + long l292 = 292; + int i293 = 293; + long l293 = 293; + int i294 = 294; + long l294 = 294; + int i295 = 295; + long l295 = 295; + int i296 = 296; + long l296 = 296; + int i297 = 297; + long l297 = 297; + int i298 = 298; + long l298 = 298; + int i299 = 299; + long l299 = 299; + int i300 = 300; + long l300 = 300; + int i301 = 301; + long l301 = 301; + int i302 = 302; + long l302 = 302; + int i303 = 303; + long l303 = 303; + int i304 = 304; + long l304 = 304; + int i305 = 305; + long l305 = 305; + int i306 = 306; + long l306 = 306; + int i307 = 307; + long l307 = 307; + int i308 = 308; + long l308 = 308; + int i309 = 309; + long l309 = 309; + int i310 = 310; + long l310 = 310; + int i311 = 311; + long l311 = 311; + int i312 = 312; + long l312 = 312; + int i313 = 313; + long l313 = 313; + int i314 = 314; + long l314 = 314; + int i315 = 315; + long l315 = 315; + int i316 = 316; + long l316 = 316; + int i317 = 317; + long l317 = 317; + int i318 = 318; + long l318 = 318; + int i319 = 319; + long l319 = 319; + int i320 = 320; + long l320 = 320; + int i321 = 321; + long l321 = 321; + int i322 = 322; + long l322 = 322; + int i323 = 323; + long l323 = 323; + int i324 = 324; + long l324 = 324; + int i325 = 325; + long l325 = 325; + int i326 = 326; + long l326 = 326; + int i327 = 327; + long l327 = 327; + int i328 = 328; + long l328 = 328; + int i329 = 329; + long l329 = 329; + int i330 = 330; + long l330 = 330; + int i331 = 331; + long l331 = 331; + int i332 = 332; + long l332 = 332; + int i333 = 333; + long l333 = 333; + int i334 = 334; + long l334 = 334; + int i335 = 335; + long l335 = 335; + int i336 = 336; + long l336 = 336; + int i337 = 337; + long l337 = 337; + int i338 = 338; + long l338 = 338; + int i339 = 339; + long l339 = 339; + int i340 = 340; + long l340 = 340; + int i341 = 341; + long l341 = 341; + int i342 = 342; + long l342 = 342; + int i343 = 343; + long l343 = 343; + int i344 = 344; + long l344 = 344; + int i345 = 345; + long l345 = 345; + int i346 = 346; + long l346 = 346; + int i347 = 347; + long l347 = 347; + int i348 = 348; + long l348 = 348; + int i349 = 349; + long l349 = 349; + int i350 = 350; + long l350 = 350; + int i351 = 351; + long l351 = 351; + int i352 = 352; + long l352 = 352; + int i353 = 353; + long l353 = 353; + int i354 = 354; + long l354 = 354; + int i355 = 355; + long l355 = 355; + int i356 = 356; + long l356 = 356; + int i357 = 357; + long l357 = 357; + int i358 = 358; + long l358 = 358; + int i359 = 359; + long l359 = 359; + int i360 = 360; + long l360 = 360; + int i361 = 361; + long l361 = 361; + int i362 = 362; + long l362 = 362; + int i363 = 363; + long l363 = 363; + int i364 = 364; + long l364 = 364; + int i365 = 365; + long l365 = 365; + int i366 = 366; + long l366 = 366; + int i367 = 367; + long l367 = 367; + int i368 = 368; + long l368 = 368; + int i369 = 369; + long l369 = 369; + int i370 = 370; + long l370 = 370; + int i371 = 371; + long l371 = 371; + int i372 = 372; + long l372 = 372; + int i373 = 373; + long l373 = 373; + int i374 = 374; + long l374 = 374; + int i375 = 375; + long l375 = 375; + int i376 = 376; + long l376 = 376; + int i377 = 377; + long l377 = 377; + int i378 = 378; + long l378 = 378; + int i379 = 379; + long l379 = 379; + int i380 = 380; + long l380 = 380; + int i381 = 381; + long l381 = 381; + int i382 = 382; + long l382 = 382; + int i383 = 383; + long l383 = 383; + int i384 = 384; + long l384 = 384; + int i385 = 385; + long l385 = 385; + int i386 = 386; + long l386 = 386; + int i387 = 387; + long l387 = 387; + int i388 = 388; + long l388 = 388; + int i389 = 389; + long l389 = 389; + int i390 = 390; + long l390 = 390; + int i391 = 391; + long l391 = 391; + int i392 = 392; + long l392 = 392; + int i393 = 393; + long l393 = 393; + int i394 = 394; + long l394 = 394; + int i395 = 395; + long l395 = 395; + int i396 = 396; + long l396 = 396; + int i397 = 397; + long l397 = 397; + int i398 = 398; + long l398 = 398; + int i399 = 399; + long l399 = 399; + int i400 = 400; + long l400 = 400; + int i401 = 401; + long l401 = 401; + int i402 = 402; + long l402 = 402; + int i403 = 403; + long l403 = 403; + int i404 = 404; + long l404 = 404; + int i405 = 405; + long l405 = 405; + int i406 = 406; + long l406 = 406; + int i407 = 407; + long l407 = 407; + int i408 = 408; + long l408 = 408; + int i409 = 409; + long l409 = 409; + int i410 = 410; + long l410 = 410; + int i411 = 411; + long l411 = 411; + int i412 = 412; + long l412 = 412; + int i413 = 413; + long l413 = 413; + int i414 = 414; + long l414 = 414; + int i415 = 415; + long l415 = 415; + int i416 = 416; + long l416 = 416; + int i417 = 417; + long l417 = 417; + int i418 = 418; + long l418 = 418; + int i419 = 419; + long l419 = 419; + int i420 = 420; + long l420 = 420; + int i421 = 421; + long l421 = 421; + int i422 = 422; + long l422 = 422; + int i423 = 423; + long l423 = 423; + int i424 = 424; + long l424 = 424; + int i425 = 425; + long l425 = 425; + int i426 = 426; + long l426 = 426; + int i427 = 427; + long l427 = 427; + int i428 = 428; + long l428 = 428; + int i429 = 429; + long l429 = 429; + int i430 = 430; + long l430 = 430; + int i431 = 431; + long l431 = 431; + int i432 = 432; + long l432 = 432; + int i433 = 433; + long l433 = 433; + int i434 = 434; + long l434 = 434; + int i435 = 435; + long l435 = 435; + int i436 = 436; + long l436 = 436; + int i437 = 437; + long l437 = 437; + int i438 = 438; + long l438 = 438; + int i439 = 439; + long l439 = 439; + int i440 = 440; + long l440 = 440; + int i441 = 441; + long l441 = 441; + int i442 = 442; + long l442 = 442; + int i443 = 443; + long l443 = 443; + int i444 = 444; + long l444 = 444; + int i445 = 445; + long l445 = 445; + int i446 = 446; + long l446 = 446; + int i447 = 447; + long l447 = 447; + int i448 = 448; + long l448 = 448; + int i449 = 449; + long l449 = 449; + int i450 = 450; + long l450 = 450; + int i451 = 451; + long l451 = 451; + int i452 = 452; + long l452 = 452; + int i453 = 453; + long l453 = 453; + int i454 = 454; + long l454 = 454; + int i455 = 455; + long l455 = 455; + int i456 = 456; + long l456 = 456; + int i457 = 457; + long l457 = 457; + int i458 = 458; + long l458 = 458; + int i459 = 459; + long l459 = 459; + int i460 = 460; + long l460 = 460; + int i461 = 461; + long l461 = 461; + int i462 = 462; + long l462 = 462; + int i463 = 463; + long l463 = 463; + int i464 = 464; + long l464 = 464; + int i465 = 465; + long l465 = 465; + int i466 = 466; + long l466 = 466; + int i467 = 467; + long l467 = 467; + int i468 = 468; + long l468 = 468; + int i469 = 469; + long l469 = 469; + int i470 = 470; + long l470 = 470; + int i471 = 471; + long l471 = 471; + int i472 = 472; + long l472 = 472; + int i473 = 473; + long l473 = 473; + int i474 = 474; + long l474 = 474; + int i475 = 475; + long l475 = 475; + int i476 = 476; + long l476 = 476; + int i477 = 477; + long l477 = 477; + int i478 = 478; + long l478 = 478; + int i479 = 479; + long l479 = 479; + int i480 = 480; + long l480 = 480; + int i481 = 481; + long l481 = 481; + int i482 = 482; + long l482 = 482; + int i483 = 483; + long l483 = 483; + int i484 = 484; + long l484 = 484; + int i485 = 485; + long l485 = 485; + int i486 = 486; + long l486 = 486; + int i487 = 487; + long l487 = 487; + int i488 = 488; + long l488 = 488; + int i489 = 489; + long l489 = 489; + int i490 = 490; + long l490 = 490; + int i491 = 491; + long l491 = 491; + int i492 = 492; + long l492 = 492; + int i493 = 493; + long l493 = 493; + int i494 = 494; + long l494 = 494; + int i495 = 495; + long l495 = 495; + int i496 = 496; + long l496 = 496; + int i497 = 497; + long l497 = 497; + int i498 = 498; + long l498 = 498; + int i499 = 499; + long l499 = 499; + int i500 = 500; + long l500 = 500; + int i501 = 501; + long l501 = 501; + int i502 = 502; + long l502 = 502; + int i503 = 503; + long l503 = 503; + int i504 = 504; + long l504 = 504; + int i505 = 505; + long l505 = 505; + int i506 = 506; + long l506 = 506; + int i507 = 507; + long l507 = 507; + int i508 = 508; + long l508 = 508; + int i509 = 509; + long l509 = 509; + int i510 = 510; + long l510 = 510; + int i511 = 511; + long l511 = 511; + int i512 = 512; + long l512 = 512; + int i513 = 513; + long l513 = 513; + int i514 = 514; + long l514 = 514; + int i515 = 515; + long l515 = 515; + int i516 = 516; + long l516 = 516; + int i517 = 517; + long l517 = 517; + int i518 = 518; + long l518 = 518; + int i519 = 519; + long l519 = 519; + int i520 = 520; + long l520 = 520; + int i521 = 521; + long l521 = 521; + int i522 = 522; + long l522 = 522; + int i523 = 523; + long l523 = 523; + int i524 = 524; + long l524 = 524; + int i525 = 525; + long l525 = 525; + int i526 = 526; + long l526 = 526; + int i527 = 527; + long l527 = 527; + int i528 = 528; + long l528 = 528; + int i529 = 529; + long l529 = 529; + int i530 = 530; + long l530 = 530; + int i531 = 531; + long l531 = 531; + int i532 = 532; + long l532 = 532; + int i533 = 533; + long l533 = 533; + int i534 = 534; + long l534 = 534; + int i535 = 535; + long l535 = 535; + int i536 = 536; + long l536 = 536; + int i537 = 537; + long l537 = 537; + int i538 = 538; + long l538 = 538; + int i539 = 539; + long l539 = 539; + int i540 = 540; + long l540 = 540; + int i541 = 541; + long l541 = 541; + int i542 = 542; + long l542 = 542; + int i543 = 543; + long l543 = 543; + int i544 = 544; + long l544 = 544; + int i545 = 545; + long l545 = 545; + int i546 = 546; + long l546 = 546; + int i547 = 547; + long l547 = 547; + int i548 = 548; + long l548 = 548; + int i549 = 549; + long l549 = 549; + int i550 = 550; + long l550 = 550; + int i551 = 551; + long l551 = 551; + int i552 = 552; + long l552 = 552; + int i553 = 553; + long l553 = 553; + int i554 = 554; + long l554 = 554; + int i555 = 555; + long l555 = 555; + int i556 = 556; + long l556 = 556; + int i557 = 557; + long l557 = 557; + int i558 = 558; + long l558 = 558; + int i559 = 559; + long l559 = 559; + int i560 = 560; + long l560 = 560; + int i561 = 561; + long l561 = 561; + int i562 = 562; + long l562 = 562; + int i563 = 563; + long l563 = 563; + int i564 = 564; + long l564 = 564; + int i565 = 565; + long l565 = 565; + int i566 = 566; + long l566 = 566; + int i567 = 567; + long l567 = 567; + int i568 = 568; + long l568 = 568; + int i569 = 569; + long l569 = 569; + int i570 = 570; + long l570 = 570; + int i571 = 571; + long l571 = 571; + int i572 = 572; + long l572 = 572; + int i573 = 573; + long l573 = 573; + int i574 = 574; + long l574 = 574; + int i575 = 575; + long l575 = 575; + int i576 = 576; + long l576 = 576; + int i577 = 577; + long l577 = 577; + int i578 = 578; + long l578 = 578; + int i579 = 579; + long l579 = 579; + int i580 = 580; + long l580 = 580; + int i581 = 581; + long l581 = 581; + int i582 = 582; + long l582 = 582; + int i583 = 583; + long l583 = 583; + int i584 = 584; + long l584 = 584; + int i585 = 585; + long l585 = 585; + int i586 = 586; + long l586 = 586; + int i587 = 587; + long l587 = 587; + int i588 = 588; + long l588 = 588; + int i589 = 589; + long l589 = 589; + int i590 = 590; + long l590 = 590; + int i591 = 591; + long l591 = 591; + int i592 = 592; + long l592 = 592; + int i593 = 593; + long l593 = 593; + int i594 = 594; + long l594 = 594; + int i595 = 595; + long l595 = 595; + int i596 = 596; + long l596 = 596; + int i597 = 597; + long l597 = 597; + int i598 = 598; + long l598 = 598; + int i599 = 599; + long l599 = 599; + int i600 = 600; + long l600 = 600; + int i601 = 601; + long l601 = 601; + int i602 = 602; + long l602 = 602; + int i603 = 603; + long l603 = 603; + int i604 = 604; + long l604 = 604; + int i605 = 605; + long l605 = 605; + int i606 = 606; + long l606 = 606; + int i607 = 607; + long l607 = 607; + int i608 = 608; + long l608 = 608; + int i609 = 609; + long l609 = 609; + int i610 = 610; + long l610 = 610; + int i611 = 611; + long l611 = 611; + int i612 = 612; + long l612 = 612; + int i613 = 613; + long l613 = 613; + int i614 = 614; + long l614 = 614; + int i615 = 615; + long l615 = 615; + int i616 = 616; + long l616 = 616; + int i617 = 617; + long l617 = 617; + int i618 = 618; + long l618 = 618; + int i619 = 619; + long l619 = 619; + int i620 = 620; + long l620 = 620; + int i621 = 621; + long l621 = 621; + int i622 = 622; + long l622 = 622; + int i623 = 623; + long l623 = 623; + int i624 = 624; + long l624 = 624; + int i625 = 625; + long l625 = 625; + int i626 = 626; + long l626 = 626; + int i627 = 627; + long l627 = 627; + int i628 = 628; + long l628 = 628; + int i629 = 629; + long l629 = 629; + int i630 = 630; + long l630 = 630; + int i631 = 631; + long l631 = 631; + int i632 = 632; + long l632 = 632; + int i633 = 633; + long l633 = 633; + int i634 = 634; + long l634 = 634; + int i635 = 635; + long l635 = 635; + int i636 = 636; + long l636 = 636; + int i637 = 637; + long l637 = 637; + int i638 = 638; + long l638 = 638; + int i639 = 639; + long l639 = 639; + int i640 = 640; + long l640 = 640; + int i641 = 641; + long l641 = 641; + int i642 = 642; + long l642 = 642; + int i643 = 643; + long l643 = 643; + int i644 = 644; + long l644 = 644; + int i645 = 645; + long l645 = 645; + int i646 = 646; + long l646 = 646; + int i647 = 647; + long l647 = 647; + int i648 = 648; + long l648 = 648; + int i649 = 649; + long l649 = 649; + int i650 = 650; + long l650 = 650; + int i651 = 651; + long l651 = 651; + int i652 = 652; + long l652 = 652; + int i653 = 653; + long l653 = 653; + int i654 = 654; + long l654 = 654; + int i655 = 655; + long l655 = 655; + int i656 = 656; + long l656 = 656; + int i657 = 657; + long l657 = 657; + int i658 = 658; + long l658 = 658; + int i659 = 659; + long l659 = 659; + int i660 = 660; + long l660 = 660; + int i661 = 661; + long l661 = 661; + int i662 = 662; + long l662 = 662; + int i663 = 663; + long l663 = 663; + int i664 = 664; + long l664 = 664; + int i665 = 665; + long l665 = 665; + int i666 = 666; + long l666 = 666; + int i667 = 667; + long l667 = 667; + int i668 = 668; + long l668 = 668; + int i669 = 669; + long l669 = 669; + int i670 = 670; + long l670 = 670; + int i671 = 671; + long l671 = 671; + int i672 = 672; + long l672 = 672; + int i673 = 673; + long l673 = 673; + int i674 = 674; + long l674 = 674; + int i675 = 675; + long l675 = 675; + int i676 = 676; + long l676 = 676; + int i677 = 677; + long l677 = 677; + int i678 = 678; + long l678 = 678; + int i679 = 679; + long l679 = 679; + int i680 = 680; + long l680 = 680; + int i681 = 681; + long l681 = 681; + int i682 = 682; + long l682 = 682; + int i683 = 683; + long l683 = 683; + int i684 = 684; + long l684 = 684; + int i685 = 685; + long l685 = 685; + int i686 = 686; + long l686 = 686; + int i687 = 687; + long l687 = 687; + int i688 = 688; + long l688 = 688; + int i689 = 689; + long l689 = 689; + int i690 = 690; + long l690 = 690; + int i691 = 691; + long l691 = 691; + int i692 = 692; + long l692 = 692; + int i693 = 693; + long l693 = 693; + int i694 = 694; + long l694 = 694; + int i695 = 695; + long l695 = 695; + int i696 = 696; + long l696 = 696; + int i697 = 697; + long l697 = 697; + int i698 = 698; + long l698 = 698; + int i699 = 699; + long l699 = 699; + int i700 = 700; + long l700 = 700; + int i701 = 701; + long l701 = 701; + int i702 = 702; + long l702 = 702; + int i703 = 703; + long l703 = 703; + int i704 = 704; + long l704 = 704; + int i705 = 705; + long l705 = 705; + int i706 = 706; + long l706 = 706; + int i707 = 707; + long l707 = 707; + int i708 = 708; + long l708 = 708; + int i709 = 709; + long l709 = 709; + int i710 = 710; + long l710 = 710; + int i711 = 711; + long l711 = 711; + int i712 = 712; + long l712 = 712; + int i713 = 713; + long l713 = 713; + int i714 = 714; + long l714 = 714; + int i715 = 715; + long l715 = 715; + int i716 = 716; + long l716 = 716; + int i717 = 717; + long l717 = 717; + int i718 = 718; + long l718 = 718; + int i719 = 719; + long l719 = 719; + int i720 = 720; + long l720 = 720; + int i721 = 721; + long l721 = 721; + int i722 = 722; + long l722 = 722; + int i723 = 723; + long l723 = 723; + int i724 = 724; + long l724 = 724; + int i725 = 725; + long l725 = 725; + int i726 = 726; + long l726 = 726; + int i727 = 727; + long l727 = 727; + int i728 = 728; + long l728 = 728; + int i729 = 729; + long l729 = 729; + int i730 = 730; + long l730 = 730; + int i731 = 731; + long l731 = 731; + int i732 = 732; + long l732 = 732; + int i733 = 733; + long l733 = 733; + int i734 = 734; + long l734 = 734; + int i735 = 735; + long l735 = 735; + int i736 = 736; + long l736 = 736; + int i737 = 737; + long l737 = 737; + int i738 = 738; + long l738 = 738; + int i739 = 739; + long l739 = 739; + int i740 = 740; + long l740 = 740; + int i741 = 741; + long l741 = 741; + int i742 = 742; + long l742 = 742; + int i743 = 743; + long l743 = 743; + int i744 = 744; + long l744 = 744; + int i745 = 745; + long l745 = 745; + int i746 = 746; + long l746 = 746; + int i747 = 747; + long l747 = 747; + int i748 = 748; + long l748 = 748; + int i749 = 749; + long l749 = 749; + int i750 = 750; + long l750 = 750; + int i751 = 751; + long l751 = 751; + int i752 = 752; + long l752 = 752; + int i753 = 753; + long l753 = 753; + int i754 = 754; + long l754 = 754; + int i755 = 755; + long l755 = 755; + int i756 = 756; + long l756 = 756; + int i757 = 757; + long l757 = 757; + int i758 = 758; + long l758 = 758; + int i759 = 759; + long l759 = 759; + int i760 = 760; + long l760 = 760; + int i761 = 761; + long l761 = 761; + int i762 = 762; + long l762 = 762; + int i763 = 763; + long l763 = 763; + int i764 = 764; + long l764 = 764; + int i765 = 765; + long l765 = 765; + int i766 = 766; + long l766 = 766; + int i767 = 767; + long l767 = 767; + int i768 = 768; + long l768 = 768; + int i769 = 769; + long l769 = 769; + int i770 = 770; + long l770 = 770; + int i771 = 771; + long l771 = 771; + int i772 = 772; + long l772 = 772; + int i773 = 773; + long l773 = 773; + int i774 = 774; + long l774 = 774; + int i775 = 775; + long l775 = 775; + int i776 = 776; + long l776 = 776; + int i777 = 777; + long l777 = 777; + int i778 = 778; + long l778 = 778; + int i779 = 779; + long l779 = 779; + int i780 = 780; + long l780 = 780; + int i781 = 781; + long l781 = 781; + int i782 = 782; + long l782 = 782; + int i783 = 783; + long l783 = 783; + int i784 = 784; + long l784 = 784; + int i785 = 785; + long l785 = 785; + int i786 = 786; + long l786 = 786; + int i787 = 787; + long l787 = 787; + int i788 = 788; + long l788 = 788; + int i789 = 789; + long l789 = 789; + int i790 = 790; + long l790 = 790; + int i791 = 791; + long l791 = 791; + int i792 = 792; + long l792 = 792; + int i793 = 793; + long l793 = 793; + int i794 = 794; + long l794 = 794; + int i795 = 795; + long l795 = 795; + int i796 = 796; + long l796 = 796; + int i797 = 797; + long l797 = 797; + int i798 = 798; + long l798 = 798; + int i799 = 799; + long l799 = 799; + int i800 = 800; + long l800 = 800; + int i801 = 801; + long l801 = 801; + int i802 = 802; + long l802 = 802; + int i803 = 803; + long l803 = 803; + int i804 = 804; + long l804 = 804; + int i805 = 805; + long l805 = 805; + int i806 = 806; + long l806 = 806; + int i807 = 807; + long l807 = 807; + int i808 = 808; + long l808 = 808; + int i809 = 809; + long l809 = 809; + int i810 = 810; + long l810 = 810; + int i811 = 811; + long l811 = 811; + int i812 = 812; + long l812 = 812; + int i813 = 813; + long l813 = 813; + int i814 = 814; + long l814 = 814; + int i815 = 815; + long l815 = 815; + int i816 = 816; + long l816 = 816; + int i817 = 817; + long l817 = 817; + int i818 = 818; + long l818 = 818; + int i819 = 819; + long l819 = 819; + int i820 = 820; + long l820 = 820; + int i821 = 821; + long l821 = 821; + int i822 = 822; + long l822 = 822; + int i823 = 823; + long l823 = 823; + int i824 = 824; + long l824 = 824; + int i825 = 825; + long l825 = 825; + int i826 = 826; + long l826 = 826; + int i827 = 827; + long l827 = 827; + int i828 = 828; + long l828 = 828; + int i829 = 829; + long l829 = 829; + int i830 = 830; + long l830 = 830; + int i831 = 831; + long l831 = 831; + int i832 = 832; + long l832 = 832; + int i833 = 833; + long l833 = 833; + int i834 = 834; + long l834 = 834; + int i835 = 835; + long l835 = 835; + int i836 = 836; + long l836 = 836; + int i837 = 837; + long l837 = 837; + int i838 = 838; + long l838 = 838; + int i839 = 839; + long l839 = 839; + int i840 = 840; + long l840 = 840; + int i841 = 841; + long l841 = 841; + int i842 = 842; + long l842 = 842; + int i843 = 843; + long l843 = 843; + int i844 = 844; + long l844 = 844; + int i845 = 845; + long l845 = 845; + int i846 = 846; + long l846 = 846; + int i847 = 847; + long l847 = 847; + int i848 = 848; + long l848 = 848; + int i849 = 849; + long l849 = 849; + int i850 = 850; + long l850 = 850; + int i851 = 851; + long l851 = 851; + int i852 = 852; + long l852 = 852; + int i853 = 853; + long l853 = 853; + int i854 = 854; + long l854 = 854; + int i855 = 855; + long l855 = 855; + int i856 = 856; + long l856 = 856; + int i857 = 857; + long l857 = 857; + int i858 = 858; + long l858 = 858; + int i859 = 859; + long l859 = 859; + int i860 = 860; + long l860 = 860; + int i861 = 861; + long l861 = 861; + int i862 = 862; + long l862 = 862; + int i863 = 863; + long l863 = 863; + int i864 = 864; + long l864 = 864; + int i865 = 865; + long l865 = 865; + int i866 = 866; + long l866 = 866; + int i867 = 867; + long l867 = 867; + int i868 = 868; + long l868 = 868; + int i869 = 869; + long l869 = 869; + int i870 = 870; + long l870 = 870; + int i871 = 871; + long l871 = 871; + int i872 = 872; + long l872 = 872; + int i873 = 873; + long l873 = 873; + int i874 = 874; + long l874 = 874; + int i875 = 875; + long l875 = 875; + int i876 = 876; + long l876 = 876; + int i877 = 877; + long l877 = 877; + int i878 = 878; + long l878 = 878; + int i879 = 879; + long l879 = 879; + int i880 = 880; + long l880 = 880; + int i881 = 881; + long l881 = 881; + int i882 = 882; + long l882 = 882; + int i883 = 883; + long l883 = 883; + int i884 = 884; + long l884 = 884; + int i885 = 885; + long l885 = 885; + int i886 = 886; + long l886 = 886; + int i887 = 887; + long l887 = 887; + int i888 = 888; + long l888 = 888; + int i889 = 889; + long l889 = 889; + int i890 = 890; + long l890 = 890; + int i891 = 891; + long l891 = 891; + int i892 = 892; + long l892 = 892; + int i893 = 893; + long l893 = 893; + int i894 = 894; + long l894 = 894; + int i895 = 895; + long l895 = 895; + int i896 = 896; + long l896 = 896; + int i897 = 897; + long l897 = 897; + int i898 = 898; + long l898 = 898; + int i899 = 899; + long l899 = 899; + int i900 = 900; + long l900 = 900; + int i901 = 901; + long l901 = 901; + int i902 = 902; + long l902 = 902; + int i903 = 903; + long l903 = 903; + int i904 = 904; + long l904 = 904; + int i905 = 905; + long l905 = 905; + int i906 = 906; + long l906 = 906; + int i907 = 907; + long l907 = 907; + int i908 = 908; + long l908 = 908; + int i909 = 909; + long l909 = 909; + int i910 = 910; + long l910 = 910; + int i911 = 911; + long l911 = 911; + int i912 = 912; + long l912 = 912; + int i913 = 913; + long l913 = 913; + int i914 = 914; + long l914 = 914; + int i915 = 915; + long l915 = 915; + int i916 = 916; + long l916 = 916; + int i917 = 917; + long l917 = 917; + int i918 = 918; + long l918 = 918; + int i919 = 919; + long l919 = 919; + int i920 = 920; + long l920 = 920; + int i921 = 921; + long l921 = 921; + int i922 = 922; + long l922 = 922; + int i923 = 923; + long l923 = 923; + int i924 = 924; + long l924 = 924; + int i925 = 925; + long l925 = 925; + int i926 = 926; + long l926 = 926; + int i927 = 927; + long l927 = 927; + int i928 = 928; + long l928 = 928; + int i929 = 929; + long l929 = 929; + int i930 = 930; + long l930 = 930; + int i931 = 931; + long l931 = 931; + int i932 = 932; + long l932 = 932; + int i933 = 933; + long l933 = 933; + int i934 = 934; + long l934 = 934; + int i935 = 935; + long l935 = 935; + int i936 = 936; + long l936 = 936; + int i937 = 937; + long l937 = 937; + int i938 = 938; + long l938 = 938; + int i939 = 939; + long l939 = 939; + int i940 = 940; + long l940 = 940; + int i941 = 941; + long l941 = 941; + int i942 = 942; + long l942 = 942; + int i943 = 943; + long l943 = 943; + int i944 = 944; + long l944 = 944; + int i945 = 945; + long l945 = 945; + int i946 = 946; + long l946 = 946; + int i947 = 947; + long l947 = 947; + int i948 = 948; + long l948 = 948; + int i949 = 949; + long l949 = 949; + int i950 = 950; + long l950 = 950; + int i951 = 951; + long l951 = 951; + int i952 = 952; + long l952 = 952; + int i953 = 953; + long l953 = 953; + int i954 = 954; + long l954 = 954; + int i955 = 955; + long l955 = 955; + int i956 = 956; + long l956 = 956; + int i957 = 957; + long l957 = 957; + int i958 = 958; + long l958 = 958; + int i959 = 959; + long l959 = 959; + int i960 = 960; + long l960 = 960; + int i961 = 961; + long l961 = 961; + int i962 = 962; + long l962 = 962; + int i963 = 963; + long l963 = 963; + int i964 = 964; + long l964 = 964; + int i965 = 965; + long l965 = 965; + int i966 = 966; + long l966 = 966; + int i967 = 967; + long l967 = 967; + int i968 = 968; + long l968 = 968; + int i969 = 969; + long l969 = 969; + int i970 = 970; + long l970 = 970; + int i971 = 971; + long l971 = 971; + int i972 = 972; + long l972 = 972; + int i973 = 973; + long l973 = 973; + int i974 = 974; + long l974 = 974; + int i975 = 975; + long l975 = 975; + int i976 = 976; + long l976 = 976; + int i977 = 977; + long l977 = 977; + int i978 = 978; + long l978 = 978; + int i979 = 979; + long l979 = 979; + int i980 = 980; + long l980 = 980; + int i981 = 981; + long l981 = 981; + int i982 = 982; + long l982 = 982; + int i983 = 983; + long l983 = 983; + int i984 = 984; + long l984 = 984; + int i985 = 985; + long l985 = 985; + int i986 = 986; + long l986 = 986; + int i987 = 987; + long l987 = 987; + int i988 = 988; + long l988 = 988; + int i989 = 989; + long l989 = 989; + int i990 = 990; + long l990 = 990; + int i991 = 991; + long l991 = 991; + int i992 = 992; + long l992 = 992; + int i993 = 993; + long l993 = 993; + int i994 = 994; + long l994 = 994; + int i995 = 995; + long l995 = 995; + int i996 = 996; + long l996 = 996; + int i997 = 997; + long l997 = 997; + int i998 = 998; + long l998 = 998; + int i999 = 999; + long l999 = 999; + i1 += i0; + l1 = l0; + i2 += i1; + l2 = l1; + i3 += i2; + l3 = l2; + i4 += i3; + l4 = l3; + i5 += i4; + l5 = l4; + i6 += i5; + l6 = l5; + i7 += i6; + l7 = l6; + i8 += i7; + l8 = l7; + i9 += i8; + l9 = l8; + i10 += i9; + l10 = l9; + i11 += i10; + l11 = l10; + i12 += i11; + l12 = l11; + i13 += i12; + l13 = l12; + i14 += i13; + l14 = l13; + i15 += i14; + l15 = l14; + i16 += i15; + l16 = l15; + i17 += i16; + l17 = l16; + i18 += i17; + l18 = l17; + i19 += i18; + l19 = l18; + i20 += i19; + l20 = l19; + i21 += i20; + l21 = l20; + i22 += i21; + l22 = l21; + i23 += i22; + l23 = l22; + i24 += i23; + l24 = l23; + i25 += i24; + l25 = l24; + i26 += i25; + l26 = l25; + i27 += i26; + l27 = l26; + i28 += i27; + l28 = l27; + i29 += i28; + l29 = l28; + i30 += i29; + l30 = l29; + i31 += i30; + l31 = l30; + i32 += i31; + l32 = l31; + i33 += i32; + l33 = l32; + i34 += i33; + l34 = l33; + i35 += i34; + l35 = l34; + i36 += i35; + l36 = l35; + i37 += i36; + l37 = l36; + i38 += i37; + l38 = l37; + i39 += i38; + l39 = l38; + i40 += i39; + l40 = l39; + i41 += i40; + l41 = l40; + i42 += i41; + l42 = l41; + i43 += i42; + l43 = l42; + i44 += i43; + l44 = l43; + i45 += i44; + l45 = l44; + i46 += i45; + l46 = l45; + i47 += i46; + l47 = l46; + i48 += i47; + l48 = l47; + i49 += i48; + l49 = l48; + i50 += i49; + l50 = l49; + i51 += i50; + l51 = l50; + i52 += i51; + l52 = l51; + i53 += i52; + l53 = l52; + i54 += i53; + l54 = l53; + i55 += i54; + l55 = l54; + i56 += i55; + l56 = l55; + i57 += i56; + l57 = l56; + i58 += i57; + l58 = l57; + i59 += i58; + l59 = l58; + i60 += i59; + l60 = l59; + i61 += i60; + l61 = l60; + i62 += i61; + l62 = l61; + i63 += i62; + l63 = l62; + i64 += i63; + l64 = l63; + i65 += i64; + l65 = l64; + i66 += i65; + l66 = l65; + i67 += i66; + l67 = l66; + i68 += i67; + l68 = l67; + i69 += i68; + l69 = l68; + i70 += i69; + l70 = l69; + i71 += i70; + l71 = l70; + i72 += i71; + l72 = l71; + i73 += i72; + l73 = l72; + i74 += i73; + l74 = l73; + i75 += i74; + l75 = l74; + i76 += i75; + l76 = l75; + i77 += i76; + l77 = l76; + i78 += i77; + l78 = l77; + i79 += i78; + l79 = l78; + i80 += i79; + l80 = l79; + i81 += i80; + l81 = l80; + i82 += i81; + l82 = l81; + i83 += i82; + l83 = l82; + i84 += i83; + l84 = l83; + i85 += i84; + l85 = l84; + i86 += i85; + l86 = l85; + i87 += i86; + l87 = l86; + i88 += i87; + l88 = l87; + i89 += i88; + l89 = l88; + i90 += i89; + l90 = l89; + i91 += i90; + l91 = l90; + i92 += i91; + l92 = l91; + i93 += i92; + l93 = l92; + i94 += i93; + l94 = l93; + i95 += i94; + l95 = l94; + i96 += i95; + l96 = l95; + i97 += i96; + l97 = l96; + i98 += i97; + l98 = l97; + i99 += i98; + l99 = l98; + i100 += i99; + l100 = l99; + i101 += i100; + l101 = l100; + i102 += i101; + l102 = l101; + i103 += i102; + l103 = l102; + i104 += i103; + l104 = l103; + i105 += i104; + l105 = l104; + i106 += i105; + l106 = l105; + i107 += i106; + l107 = l106; + i108 += i107; + l108 = l107; + i109 += i108; + l109 = l108; + i110 += i109; + l110 = l109; + i111 += i110; + l111 = l110; + i112 += i111; + l112 = l111; + i113 += i112; + l113 = l112; + i114 += i113; + l114 = l113; + i115 += i114; + l115 = l114; + i116 += i115; + l116 = l115; + i117 += i116; + l117 = l116; + i118 += i117; + l118 = l117; + i119 += i118; + l119 = l118; + i120 += i119; + l120 = l119; + i121 += i120; + l121 = l120; + i122 += i121; + l122 = l121; + i123 += i122; + l123 = l122; + i124 += i123; + l124 = l123; + i125 += i124; + l125 = l124; + i126 += i125; + l126 = l125; + i127 += i126; + l127 = l126; + i128 += i127; + l128 = l127; + i129 += i128; + l129 = l128; + i130 += i129; + l130 = l129; + i131 += i130; + l131 = l130; + i132 += i131; + l132 = l131; + i133 += i132; + l133 = l132; + i134 += i133; + l134 = l133; + i135 += i134; + l135 = l134; + i136 += i135; + l136 = l135; + i137 += i136; + l137 = l136; + i138 += i137; + l138 = l137; + i139 += i138; + l139 = l138; + i140 += i139; + l140 = l139; + i141 += i140; + l141 = l140; + i142 += i141; + l142 = l141; + i143 += i142; + l143 = l142; + i144 += i143; + l144 = l143; + i145 += i144; + l145 = l144; + i146 += i145; + l146 = l145; + i147 += i146; + l147 = l146; + i148 += i147; + l148 = l147; + i149 += i148; + l149 = l148; + i150 += i149; + l150 = l149; + i151 += i150; + l151 = l150; + i152 += i151; + l152 = l151; + i153 += i152; + l153 = l152; + i154 += i153; + l154 = l153; + i155 += i154; + l155 = l154; + i156 += i155; + l156 = l155; + i157 += i156; + l157 = l156; + i158 += i157; + l158 = l157; + i159 += i158; + l159 = l158; + i160 += i159; + l160 = l159; + i161 += i160; + l161 = l160; + i162 += i161; + l162 = l161; + i163 += i162; + l163 = l162; + i164 += i163; + l164 = l163; + i165 += i164; + l165 = l164; + i166 += i165; + l166 = l165; + i167 += i166; + l167 = l166; + i168 += i167; + l168 = l167; + i169 += i168; + l169 = l168; + i170 += i169; + l170 = l169; + i171 += i170; + l171 = l170; + i172 += i171; + l172 = l171; + i173 += i172; + l173 = l172; + i174 += i173; + l174 = l173; + i175 += i174; + l175 = l174; + i176 += i175; + l176 = l175; + i177 += i176; + l177 = l176; + i178 += i177; + l178 = l177; + i179 += i178; + l179 = l178; + i180 += i179; + l180 = l179; + i181 += i180; + l181 = l180; + i182 += i181; + l182 = l181; + i183 += i182; + l183 = l182; + i184 += i183; + l184 = l183; + i185 += i184; + l185 = l184; + i186 += i185; + l186 = l185; + i187 += i186; + l187 = l186; + i188 += i187; + l188 = l187; + i189 += i188; + l189 = l188; + i190 += i189; + l190 = l189; + i191 += i190; + l191 = l190; + i192 += i191; + l192 = l191; + i193 += i192; + l193 = l192; + i194 += i193; + l194 = l193; + i195 += i194; + l195 = l194; + i196 += i195; + l196 = l195; + i197 += i196; + l197 = l196; + i198 += i197; + l198 = l197; + i199 += i198; + l199 = l198; + i200 += i199; + l200 = l199; + i201 += i200; + l201 = l200; + i202 += i201; + l202 = l201; + i203 += i202; + l203 = l202; + i204 += i203; + l204 = l203; + i205 += i204; + l205 = l204; + i206 += i205; + l206 = l205; + i207 += i206; + l207 = l206; + i208 += i207; + l208 = l207; + i209 += i208; + l209 = l208; + i210 += i209; + l210 = l209; + i211 += i210; + l211 = l210; + i212 += i211; + l212 = l211; + i213 += i212; + l213 = l212; + i214 += i213; + l214 = l213; + i215 += i214; + l215 = l214; + i216 += i215; + l216 = l215; + i217 += i216; + l217 = l216; + i218 += i217; + l218 = l217; + i219 += i218; + l219 = l218; + i220 += i219; + l220 = l219; + i221 += i220; + l221 = l220; + i222 += i221; + l222 = l221; + i223 += i222; + l223 = l222; + i224 += i223; + l224 = l223; + i225 += i224; + l225 = l224; + i226 += i225; + l226 = l225; + i227 += i226; + l227 = l226; + i228 += i227; + l228 = l227; + i229 += i228; + l229 = l228; + i230 += i229; + l230 = l229; + i231 += i230; + l231 = l230; + i232 += i231; + l232 = l231; + i233 += i232; + l233 = l232; + i234 += i233; + l234 = l233; + i235 += i234; + l235 = l234; + i236 += i235; + l236 = l235; + i237 += i236; + l237 = l236; + i238 += i237; + l238 = l237; + i239 += i238; + l239 = l238; + i240 += i239; + l240 = l239; + i241 += i240; + l241 = l240; + i242 += i241; + l242 = l241; + i243 += i242; + l243 = l242; + i244 += i243; + l244 = l243; + i245 += i244; + l245 = l244; + i246 += i245; + l246 = l245; + i247 += i246; + l247 = l246; + i248 += i247; + l248 = l247; + i249 += i248; + l249 = l248; + i250 += i249; + l250 = l249; + i251 += i250; + l251 = l250; + i252 += i251; + l252 = l251; + i253 += i252; + l253 = l252; + i254 += i253; + l254 = l253; + i255 += i254; + l255 = l254; + i256 += i255; + l256 = l255; + i257 += i256; + l257 = l256; + i258 += i257; + l258 = l257; + i259 += i258; + l259 = l258; + i260 += i259; + l260 = l259; + i261 += i260; + l261 = l260; + i262 += i261; + l262 = l261; + i263 += i262; + l263 = l262; + i264 += i263; + l264 = l263; + i265 += i264; + l265 = l264; + i266 += i265; + l266 = l265; + i267 += i266; + l267 = l266; + i268 += i267; + l268 = l267; + i269 += i268; + l269 = l268; + i270 += i269; + l270 = l269; + i271 += i270; + l271 = l270; + i272 += i271; + l272 = l271; + i273 += i272; + l273 = l272; + i274 += i273; + l274 = l273; + i275 += i274; + l275 = l274; + i276 += i275; + l276 = l275; + i277 += i276; + l277 = l276; + i278 += i277; + l278 = l277; + i279 += i278; + l279 = l278; + i280 += i279; + l280 = l279; + i281 += i280; + l281 = l280; + i282 += i281; + l282 = l281; + i283 += i282; + l283 = l282; + i284 += i283; + l284 = l283; + i285 += i284; + l285 = l284; + i286 += i285; + l286 = l285; + i287 += i286; + l287 = l286; + i288 += i287; + l288 = l287; + i289 += i288; + l289 = l288; + i290 += i289; + l290 = l289; + i291 += i290; + l291 = l290; + i292 += i291; + l292 = l291; + i293 += i292; + l293 = l292; + i294 += i293; + l294 = l293; + i295 += i294; + l295 = l294; + i296 += i295; + l296 = l295; + i297 += i296; + l297 = l296; + i298 += i297; + l298 = l297; + i299 += i298; + l299 = l298; + i300 += i299; + l300 = l299; + i301 += i300; + l301 = l300; + i302 += i301; + l302 = l301; + i303 += i302; + l303 = l302; + i304 += i303; + l304 = l303; + i305 += i304; + l305 = l304; + i306 += i305; + l306 = l305; + i307 += i306; + l307 = l306; + i308 += i307; + l308 = l307; + i309 += i308; + l309 = l308; + i310 += i309; + l310 = l309; + i311 += i310; + l311 = l310; + i312 += i311; + l312 = l311; + i313 += i312; + l313 = l312; + i314 += i313; + l314 = l313; + i315 += i314; + l315 = l314; + i316 += i315; + l316 = l315; + i317 += i316; + l317 = l316; + i318 += i317; + l318 = l317; + i319 += i318; + l319 = l318; + i320 += i319; + l320 = l319; + i321 += i320; + l321 = l320; + i322 += i321; + l322 = l321; + i323 += i322; + l323 = l322; + i324 += i323; + l324 = l323; + i325 += i324; + l325 = l324; + i326 += i325; + l326 = l325; + i327 += i326; + l327 = l326; + i328 += i327; + l328 = l327; + i329 += i328; + l329 = l328; + i330 += i329; + l330 = l329; + i331 += i330; + l331 = l330; + i332 += i331; + l332 = l331; + i333 += i332; + l333 = l332; + i334 += i333; + l334 = l333; + i335 += i334; + l335 = l334; + i336 += i335; + l336 = l335; + i337 += i336; + l337 = l336; + i338 += i337; + l338 = l337; + i339 += i338; + l339 = l338; + i340 += i339; + l340 = l339; + i341 += i340; + l341 = l340; + i342 += i341; + l342 = l341; + i343 += i342; + l343 = l342; + i344 += i343; + l344 = l343; + i345 += i344; + l345 = l344; + i346 += i345; + l346 = l345; + i347 += i346; + l347 = l346; + i348 += i347; + l348 = l347; + i349 += i348; + l349 = l348; + i350 += i349; + l350 = l349; + i351 += i350; + l351 = l350; + i352 += i351; + l352 = l351; + i353 += i352; + l353 = l352; + i354 += i353; + l354 = l353; + i355 += i354; + l355 = l354; + i356 += i355; + l356 = l355; + i357 += i356; + l357 = l356; + i358 += i357; + l358 = l357; + i359 += i358; + l359 = l358; + i360 += i359; + l360 = l359; + i361 += i360; + l361 = l360; + i362 += i361; + l362 = l361; + i363 += i362; + l363 = l362; + i364 += i363; + l364 = l363; + i365 += i364; + l365 = l364; + i366 += i365; + l366 = l365; + i367 += i366; + l367 = l366; + i368 += i367; + l368 = l367; + i369 += i368; + l369 = l368; + i370 += i369; + l370 = l369; + i371 += i370; + l371 = l370; + i372 += i371; + l372 = l371; + i373 += i372; + l373 = l372; + i374 += i373; + l374 = l373; + i375 += i374; + l375 = l374; + i376 += i375; + l376 = l375; + i377 += i376; + l377 = l376; + i378 += i377; + l378 = l377; + i379 += i378; + l379 = l378; + i380 += i379; + l380 = l379; + i381 += i380; + l381 = l380; + i382 += i381; + l382 = l381; + i383 += i382; + l383 = l382; + i384 += i383; + l384 = l383; + i385 += i384; + l385 = l384; + i386 += i385; + l386 = l385; + i387 += i386; + l387 = l386; + i388 += i387; + l388 = l387; + i389 += i388; + l389 = l388; + i390 += i389; + l390 = l389; + i391 += i390; + l391 = l390; + i392 += i391; + l392 = l391; + i393 += i392; + l393 = l392; + i394 += i393; + l394 = l393; + i395 += i394; + l395 = l394; + i396 += i395; + l396 = l395; + i397 += i396; + l397 = l396; + i398 += i397; + l398 = l397; + i399 += i398; + l399 = l398; + i400 += i399; + l400 = l399; + i401 += i400; + l401 = l400; + i402 += i401; + l402 = l401; + i403 += i402; + l403 = l402; + i404 += i403; + l404 = l403; + i405 += i404; + l405 = l404; + i406 += i405; + l406 = l405; + i407 += i406; + l407 = l406; + i408 += i407; + l408 = l407; + i409 += i408; + l409 = l408; + i410 += i409; + l410 = l409; + i411 += i410; + l411 = l410; + i412 += i411; + l412 = l411; + i413 += i412; + l413 = l412; + i414 += i413; + l414 = l413; + i415 += i414; + l415 = l414; + i416 += i415; + l416 = l415; + i417 += i416; + l417 = l416; + i418 += i417; + l418 = l417; + i419 += i418; + l419 = l418; + i420 += i419; + l420 = l419; + i421 += i420; + l421 = l420; + i422 += i421; + l422 = l421; + i423 += i422; + l423 = l422; + i424 += i423; + l424 = l423; + i425 += i424; + l425 = l424; + i426 += i425; + l426 = l425; + i427 += i426; + l427 = l426; + i428 += i427; + l428 = l427; + i429 += i428; + l429 = l428; + i430 += i429; + l430 = l429; + i431 += i430; + l431 = l430; + i432 += i431; + l432 = l431; + i433 += i432; + l433 = l432; + i434 += i433; + l434 = l433; + i435 += i434; + l435 = l434; + i436 += i435; + l436 = l435; + i437 += i436; + l437 = l436; + i438 += i437; + l438 = l437; + i439 += i438; + l439 = l438; + i440 += i439; + l440 = l439; + i441 += i440; + l441 = l440; + i442 += i441; + l442 = l441; + i443 += i442; + l443 = l442; + i444 += i443; + l444 = l443; + i445 += i444; + l445 = l444; + i446 += i445; + l446 = l445; + i447 += i446; + l447 = l446; + i448 += i447; + l448 = l447; + i449 += i448; + l449 = l448; + i450 += i449; + l450 = l449; + i451 += i450; + l451 = l450; + i452 += i451; + l452 = l451; + i453 += i452; + l453 = l452; + i454 += i453; + l454 = l453; + i455 += i454; + l455 = l454; + i456 += i455; + l456 = l455; + i457 += i456; + l457 = l456; + i458 += i457; + l458 = l457; + i459 += i458; + l459 = l458; + i460 += i459; + l460 = l459; + i461 += i460; + l461 = l460; + i462 += i461; + l462 = l461; + i463 += i462; + l463 = l462; + i464 += i463; + l464 = l463; + i465 += i464; + l465 = l464; + i466 += i465; + l466 = l465; + i467 += i466; + l467 = l466; + i468 += i467; + l468 = l467; + i469 += i468; + l469 = l468; + i470 += i469; + l470 = l469; + i471 += i470; + l471 = l470; + i472 += i471; + l472 = l471; + i473 += i472; + l473 = l472; + i474 += i473; + l474 = l473; + i475 += i474; + l475 = l474; + i476 += i475; + l476 = l475; + i477 += i476; + l477 = l476; + i478 += i477; + l478 = l477; + i479 += i478; + l479 = l478; + i480 += i479; + l480 = l479; + i481 += i480; + l481 = l480; + i482 += i481; + l482 = l481; + i483 += i482; + l483 = l482; + i484 += i483; + l484 = l483; + i485 += i484; + l485 = l484; + i486 += i485; + l486 = l485; + i487 += i486; + l487 = l486; + i488 += i487; + l488 = l487; + i489 += i488; + l489 = l488; + i490 += i489; + l490 = l489; + i491 += i490; + l491 = l490; + i492 += i491; + l492 = l491; + i493 += i492; + l493 = l492; + i494 += i493; + l494 = l493; + i495 += i494; + l495 = l494; + i496 += i495; + l496 = l495; + i497 += i496; + l497 = l496; + i498 += i497; + l498 = l497; + i499 += i498; + l499 = l498; + i500 += i499; + l500 = l499; + i501 += i500; + l501 = l500; + i502 += i501; + l502 = l501; + i503 += i502; + l503 = l502; + i504 += i503; + l504 = l503; + i505 += i504; + l505 = l504; + i506 += i505; + l506 = l505; + i507 += i506; + l507 = l506; + i508 += i507; + l508 = l507; + i509 += i508; + l509 = l508; + i510 += i509; + l510 = l509; + i511 += i510; + l511 = l510; + i512 += i511; + l512 = l511; + i513 += i512; + l513 = l512; + i514 += i513; + l514 = l513; + i515 += i514; + l515 = l514; + i516 += i515; + l516 = l515; + i517 += i516; + l517 = l516; + i518 += i517; + l518 = l517; + i519 += i518; + l519 = l518; + i520 += i519; + l520 = l519; + i521 += i520; + l521 = l520; + i522 += i521; + l522 = l521; + i523 += i522; + l523 = l522; + i524 += i523; + l524 = l523; + i525 += i524; + l525 = l524; + i526 += i525; + l526 = l525; + i527 += i526; + l527 = l526; + i528 += i527; + l528 = l527; + i529 += i528; + l529 = l528; + i530 += i529; + l530 = l529; + i531 += i530; + l531 = l530; + i532 += i531; + l532 = l531; + i533 += i532; + l533 = l532; + i534 += i533; + l534 = l533; + i535 += i534; + l535 = l534; + i536 += i535; + l536 = l535; + i537 += i536; + l537 = l536; + i538 += i537; + l538 = l537; + i539 += i538; + l539 = l538; + i540 += i539; + l540 = l539; + i541 += i540; + l541 = l540; + i542 += i541; + l542 = l541; + i543 += i542; + l543 = l542; + i544 += i543; + l544 = l543; + i545 += i544; + l545 = l544; + i546 += i545; + l546 = l545; + i547 += i546; + l547 = l546; + i548 += i547; + l548 = l547; + i549 += i548; + l549 = l548; + i550 += i549; + l550 = l549; + i551 += i550; + l551 = l550; + i552 += i551; + l552 = l551; + i553 += i552; + l553 = l552; + i554 += i553; + l554 = l553; + i555 += i554; + l555 = l554; + i556 += i555; + l556 = l555; + i557 += i556; + l557 = l556; + i558 += i557; + l558 = l557; + i559 += i558; + l559 = l558; + i560 += i559; + l560 = l559; + i561 += i560; + l561 = l560; + i562 += i561; + l562 = l561; + i563 += i562; + l563 = l562; + i564 += i563; + l564 = l563; + i565 += i564; + l565 = l564; + i566 += i565; + l566 = l565; + i567 += i566; + l567 = l566; + i568 += i567; + l568 = l567; + i569 += i568; + l569 = l568; + i570 += i569; + l570 = l569; + i571 += i570; + l571 = l570; + i572 += i571; + l572 = l571; + i573 += i572; + l573 = l572; + i574 += i573; + l574 = l573; + i575 += i574; + l575 = l574; + i576 += i575; + l576 = l575; + i577 += i576; + l577 = l576; + i578 += i577; + l578 = l577; + i579 += i578; + l579 = l578; + i580 += i579; + l580 = l579; + i581 += i580; + l581 = l580; + i582 += i581; + l582 = l581; + i583 += i582; + l583 = l582; + i584 += i583; + l584 = l583; + i585 += i584; + l585 = l584; + i586 += i585; + l586 = l585; + i587 += i586; + l587 = l586; + i588 += i587; + l588 = l587; + i589 += i588; + l589 = l588; + i590 += i589; + l590 = l589; + i591 += i590; + l591 = l590; + i592 += i591; + l592 = l591; + i593 += i592; + l593 = l592; + i594 += i593; + l594 = l593; + i595 += i594; + l595 = l594; + i596 += i595; + l596 = l595; + i597 += i596; + l597 = l596; + i598 += i597; + l598 = l597; + i599 += i598; + l599 = l598; + i600 += i599; + l600 = l599; + i601 += i600; + l601 = l600; + i602 += i601; + l602 = l601; + i603 += i602; + l603 = l602; + i604 += i603; + l604 = l603; + i605 += i604; + l605 = l604; + i606 += i605; + l606 = l605; + i607 += i606; + l607 = l606; + i608 += i607; + l608 = l607; + i609 += i608; + l609 = l608; + i610 += i609; + l610 = l609; + i611 += i610; + l611 = l610; + i612 += i611; + l612 = l611; + i613 += i612; + l613 = l612; + i614 += i613; + l614 = l613; + i615 += i614; + l615 = l614; + i616 += i615; + l616 = l615; + i617 += i616; + l617 = l616; + i618 += i617; + l618 = l617; + i619 += i618; + l619 = l618; + i620 += i619; + l620 = l619; + i621 += i620; + l621 = l620; + i622 += i621; + l622 = l621; + i623 += i622; + l623 = l622; + i624 += i623; + l624 = l623; + i625 += i624; + l625 = l624; + i626 += i625; + l626 = l625; + i627 += i626; + l627 = l626; + i628 += i627; + l628 = l627; + i629 += i628; + l629 = l628; + i630 += i629; + l630 = l629; + i631 += i630; + l631 = l630; + i632 += i631; + l632 = l631; + i633 += i632; + l633 = l632; + i634 += i633; + l634 = l633; + i635 += i634; + l635 = l634; + i636 += i635; + l636 = l635; + i637 += i636; + l637 = l636; + i638 += i637; + l638 = l637; + i639 += i638; + l639 = l638; + i640 += i639; + l640 = l639; + i641 += i640; + l641 = l640; + i642 += i641; + l642 = l641; + i643 += i642; + l643 = l642; + i644 += i643; + l644 = l643; + i645 += i644; + l645 = l644; + i646 += i645; + l646 = l645; + i647 += i646; + l647 = l646; + i648 += i647; + l648 = l647; + i649 += i648; + l649 = l648; + i650 += i649; + l650 = l649; + i651 += i650; + l651 = l650; + i652 += i651; + l652 = l651; + i653 += i652; + l653 = l652; + i654 += i653; + l654 = l653; + i655 += i654; + l655 = l654; + i656 += i655; + l656 = l655; + i657 += i656; + l657 = l656; + i658 += i657; + l658 = l657; + i659 += i658; + l659 = l658; + i660 += i659; + l660 = l659; + i661 += i660; + l661 = l660; + i662 += i661; + l662 = l661; + i663 += i662; + l663 = l662; + i664 += i663; + l664 = l663; + i665 += i664; + l665 = l664; + i666 += i665; + l666 = l665; + i667 += i666; + l667 = l666; + i668 += i667; + l668 = l667; + i669 += i668; + l669 = l668; + i670 += i669; + l670 = l669; + i671 += i670; + l671 = l670; + i672 += i671; + l672 = l671; + i673 += i672; + l673 = l672; + i674 += i673; + l674 = l673; + i675 += i674; + l675 = l674; + i676 += i675; + l676 = l675; + i677 += i676; + l677 = l676; + i678 += i677; + l678 = l677; + i679 += i678; + l679 = l678; + i680 += i679; + l680 = l679; + i681 += i680; + l681 = l680; + i682 += i681; + l682 = l681; + i683 += i682; + l683 = l682; + i684 += i683; + l684 = l683; + i685 += i684; + l685 = l684; + i686 += i685; + l686 = l685; + i687 += i686; + l687 = l686; + i688 += i687; + l688 = l687; + i689 += i688; + l689 = l688; + i690 += i689; + l690 = l689; + i691 += i690; + l691 = l690; + i692 += i691; + l692 = l691; + i693 += i692; + l693 = l692; + i694 += i693; + l694 = l693; + i695 += i694; + l695 = l694; + i696 += i695; + l696 = l695; + i697 += i696; + l697 = l696; + i698 += i697; + l698 = l697; + i699 += i698; + l699 = l698; + i700 += i699; + l700 = l699; + i701 += i700; + l701 = l700; + i702 += i701; + l702 = l701; + i703 += i702; + l703 = l702; + i704 += i703; + l704 = l703; + i705 += i704; + l705 = l704; + i706 += i705; + l706 = l705; + i707 += i706; + l707 = l706; + i708 += i707; + l708 = l707; + i709 += i708; + l709 = l708; + i710 += i709; + l710 = l709; + i711 += i710; + l711 = l710; + i712 += i711; + l712 = l711; + i713 += i712; + l713 = l712; + i714 += i713; + l714 = l713; + i715 += i714; + l715 = l714; + i716 += i715; + l716 = l715; + i717 += i716; + l717 = l716; + i718 += i717; + l718 = l717; + i719 += i718; + l719 = l718; + i720 += i719; + l720 = l719; + i721 += i720; + l721 = l720; + i722 += i721; + l722 = l721; + i723 += i722; + l723 = l722; + i724 += i723; + l724 = l723; + i725 += i724; + l725 = l724; + i726 += i725; + l726 = l725; + i727 += i726; + l727 = l726; + i728 += i727; + l728 = l727; + i729 += i728; + l729 = l728; + i730 += i729; + l730 = l729; + i731 += i730; + l731 = l730; + i732 += i731; + l732 = l731; + i733 += i732; + l733 = l732; + i734 += i733; + l734 = l733; + i735 += i734; + l735 = l734; + i736 += i735; + l736 = l735; + i737 += i736; + l737 = l736; + i738 += i737; + l738 = l737; + i739 += i738; + l739 = l738; + i740 += i739; + l740 = l739; + i741 += i740; + l741 = l740; + i742 += i741; + l742 = l741; + i743 += i742; + l743 = l742; + i744 += i743; + l744 = l743; + i745 += i744; + l745 = l744; + i746 += i745; + l746 = l745; + i747 += i746; + l747 = l746; + i748 += i747; + l748 = l747; + i749 += i748; + l749 = l748; + i750 += i749; + l750 = l749; + i751 += i750; + l751 = l750; + i752 += i751; + l752 = l751; + i753 += i752; + l753 = l752; + i754 += i753; + l754 = l753; + i755 += i754; + l755 = l754; + i756 += i755; + l756 = l755; + i757 += i756; + l757 = l756; + i758 += i757; + l758 = l757; + i759 += i758; + l759 = l758; + i760 += i759; + l760 = l759; + i761 += i760; + l761 = l760; + i762 += i761; + l762 = l761; + i763 += i762; + l763 = l762; + i764 += i763; + l764 = l763; + i765 += i764; + l765 = l764; + i766 += i765; + l766 = l765; + i767 += i766; + l767 = l766; + i768 += i767; + l768 = l767; + i769 += i768; + l769 = l768; + i770 += i769; + l770 = l769; + i771 += i770; + l771 = l770; + i772 += i771; + l772 = l771; + i773 += i772; + l773 = l772; + i774 += i773; + l774 = l773; + i775 += i774; + l775 = l774; + i776 += i775; + l776 = l775; + i777 += i776; + l777 = l776; + i778 += i777; + l778 = l777; + i779 += i778; + l779 = l778; + i780 += i779; + l780 = l779; + i781 += i780; + l781 = l780; + i782 += i781; + l782 = l781; + i783 += i782; + l783 = l782; + i784 += i783; + l784 = l783; + i785 += i784; + l785 = l784; + i786 += i785; + l786 = l785; + i787 += i786; + l787 = l786; + i788 += i787; + l788 = l787; + i789 += i788; + l789 = l788; + i790 += i789; + l790 = l789; + i791 += i790; + l791 = l790; + i792 += i791; + l792 = l791; + i793 += i792; + l793 = l792; + i794 += i793; + l794 = l793; + i795 += i794; + l795 = l794; + i796 += i795; + l796 = l795; + i797 += i796; + l797 = l796; + i798 += i797; + l798 = l797; + i799 += i798; + l799 = l798; + i800 += i799; + l800 = l799; + i801 += i800; + l801 = l800; + i802 += i801; + l802 = l801; + i803 += i802; + l803 = l802; + i804 += i803; + l804 = l803; + i805 += i804; + l805 = l804; + i806 += i805; + l806 = l805; + i807 += i806; + l807 = l806; + i808 += i807; + l808 = l807; + i809 += i808; + l809 = l808; + i810 += i809; + l810 = l809; + i811 += i810; + l811 = l810; + i812 += i811; + l812 = l811; + i813 += i812; + l813 = l812; + i814 += i813; + l814 = l813; + i815 += i814; + l815 = l814; + i816 += i815; + l816 = l815; + i817 += i816; + l817 = l816; + i818 += i817; + l818 = l817; + i819 += i818; + l819 = l818; + i820 += i819; + l820 = l819; + i821 += i820; + l821 = l820; + i822 += i821; + l822 = l821; + i823 += i822; + l823 = l822; + i824 += i823; + l824 = l823; + i825 += i824; + l825 = l824; + i826 += i825; + l826 = l825; + i827 += i826; + l827 = l826; + i828 += i827; + l828 = l827; + i829 += i828; + l829 = l828; + i830 += i829; + l830 = l829; + i831 += i830; + l831 = l830; + i832 += i831; + l832 = l831; + i833 += i832; + l833 = l832; + i834 += i833; + l834 = l833; + i835 += i834; + l835 = l834; + i836 += i835; + l836 = l835; + i837 += i836; + l837 = l836; + i838 += i837; + l838 = l837; + i839 += i838; + l839 = l838; + i840 += i839; + l840 = l839; + i841 += i840; + l841 = l840; + i842 += i841; + l842 = l841; + i843 += i842; + l843 = l842; + i844 += i843; + l844 = l843; + i845 += i844; + l845 = l844; + i846 += i845; + l846 = l845; + i847 += i846; + l847 = l846; + i848 += i847; + l848 = l847; + i849 += i848; + l849 = l848; + i850 += i849; + l850 = l849; + i851 += i850; + l851 = l850; + i852 += i851; + l852 = l851; + i853 += i852; + l853 = l852; + i854 += i853; + l854 = l853; + i855 += i854; + l855 = l854; + i856 += i855; + l856 = l855; + i857 += i856; + l857 = l856; + i858 += i857; + l858 = l857; + i859 += i858; + l859 = l858; + i860 += i859; + l860 = l859; + i861 += i860; + l861 = l860; + i862 += i861; + l862 = l861; + i863 += i862; + l863 = l862; + i864 += i863; + l864 = l863; + i865 += i864; + l865 = l864; + i866 += i865; + l866 = l865; + i867 += i866; + l867 = l866; + i868 += i867; + l868 = l867; + i869 += i868; + l869 = l868; + i870 += i869; + l870 = l869; + i871 += i870; + l871 = l870; + i872 += i871; + l872 = l871; + i873 += i872; + l873 = l872; + i874 += i873; + l874 = l873; + i875 += i874; + l875 = l874; + i876 += i875; + l876 = l875; + i877 += i876; + l877 = l876; + i878 += i877; + l878 = l877; + i879 += i878; + l879 = l878; + i880 += i879; + l880 = l879; + i881 += i880; + l881 = l880; + i882 += i881; + l882 = l881; + i883 += i882; + l883 = l882; + i884 += i883; + l884 = l883; + i885 += i884; + l885 = l884; + i886 += i885; + l886 = l885; + i887 += i886; + l887 = l886; + i888 += i887; + l888 = l887; + i889 += i888; + l889 = l888; + i890 += i889; + l890 = l889; + i891 += i890; + l891 = l890; + i892 += i891; + l892 = l891; + i893 += i892; + l893 = l892; + i894 += i893; + l894 = l893; + i895 += i894; + l895 = l894; + i896 += i895; + l896 = l895; + i897 += i896; + l897 = l896; + i898 += i897; + l898 = l897; + i899 += i898; + l899 = l898; + i900 += i899; + l900 = l899; + i901 += i900; + l901 = l900; + i902 += i901; + l902 = l901; + i903 += i902; + l903 = l902; + i904 += i903; + l904 = l903; + i905 += i904; + l905 = l904; + i906 += i905; + l906 = l905; + i907 += i906; + l907 = l906; + i908 += i907; + l908 = l907; + i909 += i908; + l909 = l908; + i910 += i909; + l910 = l909; + i911 += i910; + l911 = l910; + i912 += i911; + l912 = l911; + i913 += i912; + l913 = l912; + i914 += i913; + l914 = l913; + i915 += i914; + l915 = l914; + i916 += i915; + l916 = l915; + i917 += i916; + l917 = l916; + i918 += i917; + l918 = l917; + i919 += i918; + l919 = l918; + i920 += i919; + l920 = l919; + i921 += i920; + l921 = l920; + i922 += i921; + l922 = l921; + i923 += i922; + l923 = l922; + i924 += i923; + l924 = l923; + i925 += i924; + l925 = l924; + i926 += i925; + l926 = l925; + i927 += i926; + l927 = l926; + i928 += i927; + l928 = l927; + i929 += i928; + l929 = l928; + i930 += i929; + l930 = l929; + i931 += i930; + l931 = l930; + i932 += i931; + l932 = l931; + i933 += i932; + l933 = l932; + i934 += i933; + l934 = l933; + i935 += i934; + l935 = l934; + i936 += i935; + l936 = l935; + i937 += i936; + l937 = l936; + i938 += i937; + l938 = l937; + i939 += i938; + l939 = l938; + i940 += i939; + l940 = l939; + i941 += i940; + l941 = l940; + i942 += i941; + l942 = l941; + i943 += i942; + l943 = l942; + i944 += i943; + l944 = l943; + i945 += i944; + l945 = l944; + i946 += i945; + l946 = l945; + i947 += i946; + l947 = l946; + i948 += i947; + l948 = l947; + i949 += i948; + l949 = l948; + i950 += i949; + l950 = l949; + i951 += i950; + l951 = l950; + i952 += i951; + l952 = l951; + i953 += i952; + l953 = l952; + i954 += i953; + l954 = l953; + i955 += i954; + l955 = l954; + i956 += i955; + l956 = l955; + i957 += i956; + l957 = l956; + i958 += i957; + l958 = l957; + i959 += i958; + l959 = l958; + i960 += i959; + l960 = l959; + i961 += i960; + l961 = l960; + i962 += i961; + l962 = l961; + i963 += i962; + l963 = l962; + i964 += i963; + l964 = l963; + i965 += i964; + l965 = l964; + i966 += i965; + l966 = l965; + i967 += i966; + l967 = l966; + i968 += i967; + l968 = l967; + i969 += i968; + l969 = l968; + i970 += i969; + l970 = l969; + i971 += i970; + l971 = l970; + i972 += i971; + l972 = l971; + i973 += i972; + l973 = l972; + i974 += i973; + l974 = l973; + i975 += i974; + l975 = l974; + i976 += i975; + l976 = l975; + i977 += i976; + l977 = l976; + i978 += i977; + l978 = l977; + i979 += i978; + l979 = l978; + i980 += i979; + l980 = l979; + i981 += i980; + l981 = l980; + i982 += i981; + l982 = l981; + i983 += i982; + l983 = l982; + i984 += i983; + l984 = l983; + i985 += i984; + l985 = l984; + i986 += i985; + l986 = l985; + i987 += i986; + l987 = l986; + i988 += i987; + l988 = l987; + i989 += i988; + l989 = l988; + i990 += i989; + l990 = l989; + i991 += i990; + l991 = l990; + i992 += i991; + l992 = l991; + i993 += i992; + l993 = l992; + i994 += i993; + l994 = l993; + i995 += i994; + l995 = l994; + i996 += i995; + l996 = l995; + i997 += i996; + l997 = l996; + i998 += i997; + l998 = l997; + i999 += i998; + l999 = l998; + return i999 + l999; + } + + public static synchronized int[] getArray(int num) { + int[] nums = new int[num]; + + try { + for (int i = 0; i < num; ++i) { + nums[i] = 10; + } + } catch (Exception ex) { + throw new Error(""); + } finally { + for (int i = 0; i < num; ++i) { + nums[i] = 11; + } + } + return nums; + } +} diff --git a/jack-tests/tests/com/android/jack/dx/optimizer/dx/Tests.java b/jack-tests/tests/com/android/jack/dx/optimizer/dx/Tests.java new file mode 100644 index 00000000..b4467981 --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/optimizer/dx/Tests.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.optimizer.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.dx.optimizer.jack.Data; + + +/** + * Tests that failed in optimizer. + */ +public class Tests { + @Test + public void charConstant() { + Assert.assertEquals(0, Data.charConstant('0')); + Assert.assertEquals(1, Data.charConstant('2')); + } +} diff --git a/jack-tests/tests/com/android/jack/dx/optimizer/jack/Data.java b/jack-tests/tests/com/android/jack/dx/optimizer/jack/Data.java new file mode 100644 index 00000000..79e62860 --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/optimizer/jack/Data.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.optimizer.jack; + +public class Data { + + public static int charConstant(int d) { + for (int c = 0; c < d; c++) { + if (c >= '0' && c <= '9') { + return 1; + } + } + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/dx/overlapping/dx/Tests.java b/jack-tests/tests/com/android/jack/dx/overlapping/dx/Tests.java new file mode 100644 index 00000000..640728c4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/overlapping/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.overlapping.dx; + +import com.android.jack.dx.overlapping.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + + +/** + * Tests that generate overlapping. + */ +public class Tests { + @Test + public void registerOverlapping001() { + Assert.assertEquals(1009572021, new Data().test001(10, 123456789876545321L, 10242048396L)); + } + + @Test + public void registerOverlapping002() { + Assert.assertEquals(-1017, Data.test002(1, 2l, 3)); + } + +} diff --git a/jack-tests/tests/com/android/jack/dx/overlapping/jack/Data.java b/jack-tests/tests/com/android/jack/dx/overlapping/jack/Data.java new file mode 100644 index 00000000..09d2c73e --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/overlapping/jack/Data.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.overlapping.jack; + +public class Data { + + private final Object o = null; + + private long getLongValue() { + return 1024L; + } + + private static int getResult(Object o1, long l1, long l2, Object o2) { + return (int)(l1 + l2); + } + + public final long test001(int i, long position, long size) { + long alignment = position - position % getLongValue(); + int offset = (int) (position - alignment); + int result = Data.getResult(o, alignment, size + offset, null); + return result; + } + + + public static long test002(int val0, long val1, long val2) { + long val3 = val1 - 1024l; + return (compute(1, val3, val2, val0)); + } + + private static long compute(int val0, long val1, long val2, int val3) { + return val0 + val1 + val2 + val3; + } +} diff --git a/jack-tests/tests/com/android/jack/dx/regallocator/jack/Data.java b/jack-tests/tests/com/android/jack/dx/regallocator/jack/Data.java new file mode 100644 index 00000000..e5d992b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/dx/regallocator/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.dx.regallocator.jack; + + +/** + * Test that highlight a sub-optimal instruction selection due to register allocator. + */ +public class Data { + + private int field = 1024; + + // The generated dex should contain 'div-int/2addr' instruction. + public int compute1(int val0) { + return (field / val0); + } + + // The generated dex should contain 'div-int/2addr' instruction. + public int compute2(int val0) { + return (val0 / field); + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/enums/test001/dx/Tests.java new file mode 100644 index 00000000..c8912cb0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test001/dx/Tests.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test001.dx; + +import com.android.jack.enums.test001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertArrayEquals(new Data[]{Data.A, Data.B, Data.C, Data.D, Data.E}, Data.values()); + Assert.assertEquals(0, Data.A.ordinal()); + Assert.assertEquals(4, Data.E.ordinal()); + Assert.assertEquals(Data.A, Data.valueOf("A")); + Assert.assertEquals(Data.B, Enum.valueOf(Data.class, "B")); + } + @Test + public void test2() { + Data d = Data.D; + int r = -1; + switch (d) { + case A: + r = 2; + break; + case B: + r = 3; + break; + case C: + r = 14; + break; + case D: + r = 5; + break; + case E: + r = 7; + break; + default: + r = 9; + break; + } + Assert.assertEquals(5, r); + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test001/jack/Data.java b/jack-tests/tests/com/android/jack/enums/test001/jack/Data.java new file mode 100644 index 00000000..e596014d --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test001/jack/Data.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test001.jack; + +public enum Data { + A, B, C, D, E; +} diff --git a/jack-tests/tests/com/android/jack/enums/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/enums/test002/dx/Tests.java new file mode 100644 index 00000000..33107224 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test002/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test002.dx; + +import com.android.jack.enums.test002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(5, Data.get(Data.D)); + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test002/jack/Data.java b/jack-tests/tests/com/android/jack/enums/test002/jack/Data.java new file mode 100644 index 00000000..293afed1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test002/jack/Data.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test002.jack; + +public enum Data { + A, B, C, D, E; + + public static int get(Data d) { + int r = -1; + switch (d) { + case A: + r = 2; + break; + case B: + r = 3; + break; + case C: + r = 14; + break; + case D: + r = 5; + break; + case E: + r = 7; + break; + default: + r = 9; + break; + } + return r; + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/enums/test003/dx/Tests.java new file mode 100644 index 00000000..47892a9d --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/dx/Tests.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.dx; + + +import com.android.jack.enums.test003.jack.Data; +import com.android.jack.enums.test003.jack.Other; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals("ZERO", Data.get1()); + } + + @Test + public void test2() { + Assert.assertEquals("ZERO", Data.get2()); + } + + @Test + public void test3() { + Assert.assertEquals("ONE", Data.get3(Other.ONE)); + } + + @Test + public void test4() { + Assert.assertEquals("ONE", Data.get4()); + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/jack/Data.java b/jack-tests/tests/com/android/jack/enums/test003/jack/Data.java new file mode 100644 index 00000000..277b8278 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/jack/Data.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.jack; + +public class Data { + + public static String get1() { + for (Values a : Values.values()) { + switch (a) { + case ONE: + break; + case TWO: + break; + default: + return a.toString(); + } + } + + return "None"; + } + + public static String get2() { + for (Other a : Other.values()) { + switch (a) { + case ONE: + break; + case TWO: + break; + default: + return a.toString(); + } + } + + return "None"; + } + + public static String get3(Other a) { + switch (a) { + case ONE: + return "ONE"; + case TWO: + return "TWO"; + default: + return a.toString(); + } + } + + private static Other getEnumValue() { + return Other.ONE; + } + public static String get4() { + switch (getEnumValue()) { + case ONE: + return "ONE"; + case TWO: + return "TWO"; + default: + return "default"; + } + } +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/jack/Other.java b/jack-tests/tests/com/android/jack/enums/test003/jack/Other.java new file mode 100644 index 00000000..f43b68a6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/jack/Other.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.jack; + +public enum Other { + ONE, + TWO +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/jack/Values.java b/jack-tests/tests/com/android/jack/enums/test003/jack/Values.java new file mode 100644 index 00000000..0f8e7730 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/jack/Values.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.jack; + +public enum Values { + ONE, + TWO +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/link/Other.java b/jack-tests/tests/com/android/jack/enums/test003/link/Other.java new file mode 100644 index 00000000..bdf93713 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/link/Other.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.jack; + +public enum Other { + ZERO, + ONE, + TWO +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/enums/test003/link/Values.java b/jack-tests/tests/com/android/jack/enums/test003/link/Values.java new file mode 100644 index 00000000..6e986919 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/link/Values.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.enums.test003.jack; + +public enum Values { + ZERO, + ONE, + TWO +} diff --git a/jack-tests/tests/com/android/jack/enums/test003/test.mk b/jack-tests/tests/com/android/jack/enums/test003/test.mk new file mode 100644 index 00000000..04e7a919 --- /dev/null +++ b/jack-tests/tests/com/android/jack/enums/test003/test.mk @@ -0,0 +1,26 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := enums/test003 +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(call all-java-files-under, $(abspath $(private_path)/dx/)) +JACKTEST_LINK_SRC := $(call all-java-files-under, $(abspath $(private_path)/link/)) +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests +JACKTEST_DALVIK_FLAGS := -Xdexopt:none -Xverify:none + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/error/test001/jack/A.java b/jack-tests/tests/com/android/jack/error/test001/jack/A.java new file mode 100644 index 00000000..3b24e34e --- /dev/null +++ b/jack-tests/tests/com/android/jack/error/test001/jack/A.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.error.test001.jack; + +/** + * Check that compilation failed properly + */ +public class A extends B { + +} diff --git a/jack-tests/tests/com/android/jack/error/test002/jack/A.java b/jack-tests/tests/com/android/jack/error/test002/jack/A.java new file mode 100644 index 00000000..1fa2acd9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/error/test002/jack/A.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.error.test002.jack; + +/** + * Check that compilation failed properly + */ +public class A { + + public boolean test(Object o) { + return o instanceof B; + } +} diff --git a/jack-tests/tests/com/android/jack/external/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/external/test001/dx/Tests.java new file mode 100644 index 00000000..4b1b8ed7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/external/test001/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.external.test001.dx; + +import com.android.jack.external.test001.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(42, d.getValue()); + } +} diff --git a/jack-tests/tests/com/android/jack/external/test001/jack/Data.java b/jack-tests/tests/com/android/jack/external/test001/jack/Data.java new file mode 100644 index 00000000..e224deaa --- /dev/null +++ b/jack-tests/tests/com/android/jack/external/test001/jack/Data.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.external.test001.jack; + +import com.android.jack.external.test001.lib.Data2; + +public class Data extends Data2 { + + public int getValue() { + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/external/test001/lib/Data2.java b/jack-tests/tests/com/android/jack/external/test001/lib/Data2.java new file mode 100644 index 00000000..72f14a48 --- /dev/null +++ b/jack-tests/tests/com/android/jack/external/test001/lib/Data2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.external.test001.lib; + +public class Data2 { + protected int value = 42; +} diff --git a/jack-tests/tests/com/android/jack/fibonacci/dx/Tests.java b/jack-tests/tests/com/android/jack/fibonacci/dx/Tests.java new file mode 100644 index 00000000..4bdf6f7b --- /dev/null +++ b/jack-tests/tests/com/android/jack/fibonacci/dx/Tests.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.fibonacci.dx; + +import com.android.jack.fibonacci.jack.FibonacciThreeAddress; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test0() { + Assert.assertEquals(0, FibonacciThreeAddress.fibonacci(0)); + } + + @Test + public void test1() { + Assert.assertEquals(1, FibonacciThreeAddress.fibonacci(1)); + } + + @Test + public void test2() { + Assert.assertEquals(1, FibonacciThreeAddress.fibonacci(2)); + } + + @Test + public void test3() { + Assert.assertEquals(2, FibonacciThreeAddress.fibonacci(3)); + } + + @Test + public void test4() { + Assert.assertEquals(3, FibonacciThreeAddress.fibonacci(4)); + } + + @Test + public void test5() { + Assert.assertEquals(5, FibonacciThreeAddress.fibonacci(5)); + } + + @Test + public void test10() { + Assert.assertEquals(55, FibonacciThreeAddress.fibonacci(10)); + } +} diff --git a/jack-tests/tests/com/android/jack/fibonacci/jack/Fibo.java b/jack-tests/tests/com/android/jack/fibonacci/jack/Fibo.java new file mode 100644 index 00000000..fdaf4be3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/fibonacci/jack/Fibo.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.fibonacci.jack; + +/** + * Fibonacci test. + */ +public class Fibo { + + /** + * Recursive Fibonacci test. + */ + public static int fibo(int n) { + if (n < 2) { + return n; + } + return fibo(n - 1) + fibo(n - 2); + } + +} diff --git a/jack-tests/tests/com/android/jack/fibonacci/jack/FibonacciThreeAddress.java b/jack-tests/tests/com/android/jack/fibonacci/jack/FibonacciThreeAddress.java new file mode 100644 index 00000000..099cbf12 --- /dev/null +++ b/jack-tests/tests/com/android/jack/fibonacci/jack/FibonacciThreeAddress.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.fibonacci.jack; + +/** + * Fibonacci test in three-address style. + */ +public class FibonacciThreeAddress { + + /** + * Recursive Fibonacci test in three-address style. + */ + public static int fibonacci(int n) { + if (n < 2) { + return n; + } + int n1 = n - 1; + int n2 = n - 2; + int fibo1 = fibonacci(n1); + int fibo2 = fibonacci(n2); + int result = fibo1 + fibo2; + return result; + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance001/dx/Tests.java b/jack-tests/tests/com/android/jack/field/instance001/dx/Tests.java new file mode 100644 index 00000000..88b90fa4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance001/dx/Tests.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance001.dx; + +import com.android.jack.field.instance001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + private Data instance = new Data(); + + @Test + public void test1() { + testOneValue(0); + testOneValue(17); + testOneValue(0); + testOneValue(-1); + testOneValue(Integer.MAX_VALUE); + testOneValue(Integer.MIN_VALUE); + } + + private void testOneValue(int value) { + instance.set(value); + Assert.assertEquals(value, instance.field); + Assert.assertEquals(value, instance.get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/field/instance001/jack/Data.java b/jack-tests/tests/com/android/jack/field/instance001/jack/Data.java new file mode 100644 index 00000000..5300a183 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance001/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance001.jack; + +public class Data { + + public int field; + + public void set(int value) { + field = value; + } + + public int get() { + return field; + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance002/dx/Tests.java b/jack-tests/tests/com/android/jack/field/instance002/dx/Tests.java new file mode 100644 index 00000000..45804463 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance002/dx/Tests.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance002.dx; + +import com.android.jack.field.instance002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + private Data instance = new Data(); + + @Test + public void test1() { + testOneValue(0); + testOneValue(17); + testOneValue(0); + testOneValue(-1); + testOneValue(Integer.MAX_VALUE); + testOneValue(Integer.MIN_VALUE); + } + + private void testOneValue(int value) { + instance.set(value); + Assert.assertEquals(value, instance.field); + Assert.assertEquals(value, instance.get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/field/instance002/jack/Data.java b/jack-tests/tests/com/android/jack/field/instance002/jack/Data.java new file mode 100644 index 00000000..7df025e2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance002/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance002.jack; + +public class Data { + + public int field; + + public int set(int value) { + return field = value; + } + + public int get() { + return field; + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance003/dx/Tests.java b/jack-tests/tests/com/android/jack/field/instance003/dx/Tests.java new file mode 100644 index 00000000..6b844d67 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance003/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance003.dx; + +import com.android.jack.field.instance003.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertTrue(d.check()); + Assert.assertTrue(d.check2()); + Assert.assertTrue(d.check3()); + Assert.assertTrue(d.check4()); + Assert.assertTrue(d.check5()); + Assert.assertTrue(d.check6()); + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance003/jack/Data.java b/jack-tests/tests/com/android/jack/field/instance003/jack/Data.java new file mode 100644 index 00000000..ad346eaf --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance003/jack/Data.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance003.jack; + +import com.android.jack.field.instance003.jack.other.PublicClass; + + +public class Data extends PublicClass { + public boolean f = false; + + public boolean check() { + return !f; + } + + public boolean check2() { + return getI() == 45; + } + + public boolean check3() { + return getS() != 99; + } + + public boolean check4() { + return getS2() != 77; + } + + public boolean check5() { + return super.f; + } + + public boolean check6() { + Data d = this; + return d.b; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/field/instance003/jack/other/ProtectedClass.java b/jack-tests/tests/com/android/jack/field/instance003/jack/other/ProtectedClass.java new file mode 100644 index 00000000..c69253ba --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance003/jack/other/ProtectedClass.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance003.jack.other; + + +class ProtectedClass { + public boolean b = true; + public boolean f = true; + public int i = 45; + public static int s = 99; +} diff --git a/jack-tests/tests/com/android/jack/field/instance003/jack/other/PublicClass.java b/jack-tests/tests/com/android/jack/field/instance003/jack/other/PublicClass.java new file mode 100644 index 00000000..600ef6b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance003/jack/other/PublicClass.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance003.jack.other; + + +public class PublicClass extends ProtectedClass { + public int i = 42; + public static int s = 77; + + public int getI() { + return super.i; + } + + public int getS() { + return s; + } + + public int getS2() { + return ProtectedClass.s; + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/dx/Tests.java b/jack-tests/tests/com/android/jack/field/instance004/dx/Tests.java new file mode 100644 index 00000000..5637968f --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/dx/Tests.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.dx; + +import com.android.jack.field.instance004.jack.Data; +import com.android.jack.field.instance004.jack.Data10; +import com.android.jack.field.instance004.jack.Data11; +import com.android.jack.field.instance004.jack.Data2; +import com.android.jack.field.instance004.jack.Data3; +import com.android.jack.field.instance004.jack.Data4; +import com.android.jack.field.instance004.jack.Data5; +import com.android.jack.field.instance004.jack.Data6; +import com.android.jack.field.instance004.jack.Data7; +import com.android.jack.field.instance004.jack.Data8; +import com.android.jack.field.instance004.jack.Data9; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(1, d.j); + } + + @Test + public void test2() { + Data2 d = new Data2(); + Assert.assertEquals(1, d.j); + } + + @Test + public void test3() { + Data3 d = new Data3(); + Assert.assertEquals(0, d.j); + } + + @Test + public void test4() { + Data4 d = new Data4(); + Assert.assertEquals(1, d.j); + } + + @Test + public void test5() { + Data5 d = new Data5(); + Assert.assertEquals(1, d.j); + } + + @Test + public void test6() { + Data6 d = new Data6(); + Assert.assertEquals(1, d.j); + } + + @Test + public void test7() { + Data7.Data7Bis d = new Data7.Data7Bis(); + Assert.assertEquals(1, d.k); + } + + @SuppressWarnings("static-access") + @Test + public void test8() { + try { + new Data8().m(); + Assert.fail(); + } catch(NullPointerException npe) { + // Ok + } + } + + @Test + public void test9() { + try { + Data9.m(); + Assert.fail(); + } catch(NullPointerException npe) { + // Ok + } + } + + @Test + public void test10() { + try { + new Data10().m(); + Assert.fail(); + } catch(NullPointerException e) { + // Ok + } + } + + @Test + public void test11() { + Assert.assertEquals(1, new Data11().m()); + } +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data.java new file mode 100644 index 00000000..91ff6248 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data { + int m() { + return this.i; + } + + public int j = m(); + + final int i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data10.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data10.java new file mode 100644 index 00000000..4be45e42 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data10.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data10 { + C getC() { + return null; + } + + public int m() { + return getC().i; + } + + public int j = m(); + + final int i = 1; +} + +class C { + final int i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data11.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data11.java new file mode 100644 index 00000000..f0e19480 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data11.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data11 { + D getD() { + return null; + } + + @SuppressWarnings("static-access") + public int m() { + return getD().i; + } + + public int j = m(); + + final int i = 1; +} + +class D { + static final int i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data2.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data2.java new file mode 100644 index 00000000..1bbc1777 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data2.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data2 { + int m() { + return this.i; + } + + public int j = m(); + + final byte i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data3.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data3.java new file mode 100644 index 00000000..7cd3c36b --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data3.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data3 { + int m() { + return this.i; + } + + public int j = m(); + + final int i = this.k; + + final short k = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data4.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data4.java new file mode 100644 index 00000000..fde7cefd --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data4.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data4 { + int m() { + return i; + } + + public int j = m(); + + final int i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data5.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data5.java new file mode 100644 index 00000000..7d27ad2b --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data5.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data5 { + + public static class Data5Bis { + static final int i = 1; + + static { + int lv = i / 0; + } + } + + int m() { + return Data5Bis.i; + } + + public int j = m(); +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data6.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data6.java new file mode 100644 index 00000000..2c4d0e3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data6.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + + +public class Data6 { + + public static class Data5Bis { + static { + int lv = 0 / 0; + } + + static final int i = 1; + } + + int m() { + return Data6.Data5Bis.i; + } + + public int j = m(); +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data7.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data7.java new file mode 100644 index 00000000..7e0bede8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data7.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + + +public class Data7 { + + public static class Data7Bis { + public int k = i; + } + + static final int i = 1; +} diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data8.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data8.java new file mode 100644 index 00000000..8a526fdb --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data8.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + + +public class Data8 { + @SuppressWarnings("null") + public static int m() { + A a = null; + return a.f; + } +} + +class A { + final int f = 1; + static { + int i = 5/0; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/field/instance004/jack/Data9.java b/jack-tests/tests/com/android/jack/field/instance004/jack/Data9.java new file mode 100644 index 00000000..f9a052d4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance004/jack/Data9.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance004.jack; + +public class Data9 { + public static int m() { + B a = new B(); + return a.b.f; + } +} + +class B { + final int f = 1; + public B b; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/field/instance005/jack/InstanceField.java b/jack-tests/tests/com/android/jack/field/instance005/jack/InstanceField.java new file mode 100644 index 00000000..5b3f3940 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/instance005/jack/InstanceField.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.instance005.jack; + +public class InstanceField { + public int f01; + public final int f02; + public final int f03 = 3; + + int f11; + final int f12; + final int f13 = 13; + + protected int f21; + protected final int f22; + protected final int f23 = 23; + + @SuppressWarnings("unused") + private int f31; + @SuppressWarnings("unused") + private final int f32; + @SuppressWarnings("unused") + private final int f33 = 33; + + + { + f02=2; + f12=12; + f22=22; + f01++; + f32=32; + } +} diff --git a/jack-tests/tests/com/android/jack/field/static001/dx/Tests.java b/jack-tests/tests/com/android/jack/field/static001/dx/Tests.java new file mode 100644 index 00000000..187cfc73 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static001/dx/Tests.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static001.dx; + +import com.android.jack.field.static001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + testOneValue(0); + testOneValue(17); + testOneValue(0); + testOneValue(-1); + testOneValue(Integer.MAX_VALUE); + testOneValue(Integer.MIN_VALUE); + } + + private void testOneValue(int value) { + Data.set(value); + Assert.assertEquals(value, Data.field); + Assert.assertEquals(value, Data.get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/field/static001/jack/Data.java b/jack-tests/tests/com/android/jack/field/static001/jack/Data.java new file mode 100644 index 00000000..4c53dcdd --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static001/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static001.jack; + +public class Data { + + public static int field; + + public static void set(int value) { + field = value; + } + + public static int get() { + return field; + } +} diff --git a/jack-tests/tests/com/android/jack/field/static002/dx/Tests.java b/jack-tests/tests/com/android/jack/field/static002/dx/Tests.java new file mode 100644 index 00000000..f66d0102 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static002/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static002.dx; + +import com.android.jack.field.static002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1 , Data.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/field/static002/jack/Data.java b/jack-tests/tests/com/android/jack/field/static002/jack/Data.java new file mode 100644 index 00000000..743b9501 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static002/jack/Data.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static002.jack; + +public class Data { + public static int m() { + A a = null; + return a.f; + } +} + +class A { + static final int f = 1; + static { + int i = 5/0; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/field/static003/jack/StaticField.java b/jack-tests/tests/com/android/jack/field/static003/jack/StaticField.java new file mode 100644 index 00000000..8d8158cb --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static003/jack/StaticField.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static003.jack; + +public class StaticField { + public static int f1; + public static final int f2; + public static final int f3 = 4; + + + static { + f2=3; + } +} diff --git a/jack-tests/tests/com/android/jack/field/static004/dx/Tests.java b/jack-tests/tests/com/android/jack/field/static004/dx/Tests.java new file mode 100644 index 00000000..4c9df88d --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/dx/Tests.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.dx; + +import com.android.jack.field.static004.jack.Data1; +import com.android.jack.field.static004.jack.Data2; +import com.android.jack.field.static004.jack.Data3; +import com.android.jack.field.static004.jack.Data4; +import com.android.jack.field.static004.jack.Data5; +import com.android.jack.field.static004.jack.Data6; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Data1.I1); + Assert.assertEquals(2, Data1.I2); + Assert.assertEquals(3, Data1.getI3()); + Assert.assertEquals(4, Data1.getI4()); + Assert.assertEquals(4 + 9, Data1.getI5()); + Assert.assertEquals(6, Data1.I6); + Assert.assertEquals(7, Data1.I7, 0.0); + Assert.assertEquals(8.8, Data1.I8, 0.0); + Assert.assertEquals(null, Data1.I9); + } + + @Test + public void test2() { + Assert.assertEquals("I", Data2.I1); + } + + @Test + public void test3() { + Assert.assertEquals(1, Data3.I1); + } + + @Test + public void test4() { + Assert.assertEquals(1, Data4.I1); + Assert.assertEquals(2, Data4.I2); + Assert.assertEquals('r', Data4.getI4()); + Assert.assertEquals(4 + 9, Data4.I5); + Assert.assertEquals(6l, Data1.I6); + Assert.assertEquals(7f, Data1.I7, 0.0); + Assert.assertEquals(8.8, Data1.I8, 0.0); + Assert.assertEquals(null, Data1.I9); + } + + @Test + public void test5() { + Assert.assertEquals(Integer.valueOf(1), Data5.I1); + Assert.assertEquals(Byte.valueOf((byte) 127), Data5.B1); + Assert.assertEquals(Short.valueOf((short) 256), Data5.S1); + Assert.assertEquals(Character.valueOf('c'), Data5.C1); + Assert.assertEquals(Float.valueOf(1.0f), Data5.F1); + Assert.assertEquals(Double.valueOf(2.0), Data5.D1); + Assert.assertEquals(Long.valueOf(1), Data5.L1); + } + + @Test + public void test6() { + Assert.assertEquals(Data6.class, Data6.I1); + } +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data1.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data1.java new file mode 100644 index 00000000..376beb9b --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data1.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data1 { + + public static final int I1 = 1; + public static final int I2 = 2; + static final byte I3 = 3; + protected static final char I4 = 4; + private static final short I5 = 4 + 9; + public static final long I6 = 6; + public static final float I7 = 7; + public static final double I8 = 8.8; + public static final Object I9 = null; + + + public static byte getI3() { + return I3; + } + + public static char getI4() { + return I4; + } + + public static short getI5() { + return I5; + } +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data2.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data2.java new file mode 100644 index 00000000..f7818a75 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data2.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data2 { + + public static final String I1 = "I"; + +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data3.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data3.java new file mode 100644 index 00000000..99cb332f --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data3.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data3 { + + public static final int I1; + + static { + I1 = 1; + } + +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data4.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data4.java new file mode 100644 index 00000000..9dbb347a --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data4.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data4 { + + public static final int I1 = 1; + public static final int I2 = 2; + protected static final char I4 = 'r'; + public static final int I5 = 4 + 9; + public static final long I6 = 6l; + public static final float I7 = 7f; + public static final double I8 = 8.8; + public static final Object I9 = null; + + public static char getI4() { + return I4; + } +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data5.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data5.java new file mode 100644 index 00000000..7e32372c --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data5.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data5 { + + @SuppressWarnings("boxing") + public static final Integer I1 = 1; + + @SuppressWarnings("boxing") + public static final Byte B1 = 127; + + @SuppressWarnings("boxing") + public static final Short S1 = 256; + + @SuppressWarnings("boxing") + public static final Character C1 = 'c'; + + @SuppressWarnings("boxing") + public static final Float F1 = 1.0f; + + @SuppressWarnings("boxing") + public static final Double D1 = 2.0; + + @SuppressWarnings("boxing") + public static final Long L1 = 1l; +} diff --git a/jack-tests/tests/com/android/jack/field/static004/jack/Data6.java b/jack-tests/tests/com/android/jack/field/static004/jack/Data6.java new file mode 100644 index 00000000..ede92ea0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static004/jack/Data6.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static004.jack; + +public class Data6 { + + public static final Class I1 = Data6.class; +} diff --git a/jack-tests/tests/com/android/jack/field/static005/dx/Tests.java b/jack-tests/tests/com/android/jack/field/static005/dx/Tests.java new file mode 100644 index 00000000..5dcd3b40 --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static005/dx/Tests.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static005.dx; + +import com.android.jack.field.static005.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + private static final String EXPECTED_1 = "foo1"; + private static final String EXPECTED_2 = "foo2"; + + @Test + public void test1() { + Assert.assertEquals(EXPECTED_1 , Data.getF1()); + Assert.assertEquals(EXPECTED_2 , Data.getF2()); + } +} diff --git a/jack-tests/tests/com/android/jack/field/static005/jack/Data.java b/jack-tests/tests/com/android/jack/field/static005/jack/Data.java new file mode 100644 index 00000000..5dacad2d --- /dev/null +++ b/jack-tests/tests/com/android/jack/field/static005/jack/Data.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.field.static005.jack; + +public class Data { + + static final Object F1 = "foo1"; + static final CharSequence F2 = "foo2"; + + public static String getF1() { + return (String) F1; + } + + public static String getF2() { + return (String) F2; + } + +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/flow/cfg001/dx/Tests.java b/jack-tests/tests/com/android/jack/flow/cfg001/dx/Tests.java new file mode 100644 index 00000000..cc4a60d1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/cfg001/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.cfg001.dx; + +import com.android.jack.flow.cfg001.jack.LinkIterator; + +import org.junit.Test; + +public class Tests { + + @Test + public void test_001() { + new LinkIterator(10, 0); + } + + @Test + public void test_002() { + new LinkIterator(10, 0, 3); + } + + @Test + public void test_003() { + new LinkIterator(10, 0, (byte) 3); + } +} diff --git a/jack-tests/tests/com/android/jack/flow/cfg001/jack/LinkIterator.java b/jack-tests/tests/com/android/jack/flow/cfg001/jack/LinkIterator.java new file mode 100644 index 00000000..9ff3c033 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/cfg001/jack/LinkIterator.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.cfg001.jack; + + +public class LinkIterator { + int pos; + int link; + + public LinkIterator(int size, int location) { + if (location >= 0) { + } else { + throw new IndexOutOfBoundsException(); + } + } + + public LinkIterator(int size, int location, int unused) { + if (location >= 0 && location <= size) { + if(size == 0) { + location = 3; + } else { + location = 5; + } + } else { + throw new IndexOutOfBoundsException(); + } +} + + public LinkIterator(int size, int location, byte unused) { + if (location >= 0) { + if (location < size / 2) { + link = 0; + for (pos = -1; pos + 1 < location; pos++) { + link ++; + } + } else { + for (pos = size; pos >= location; pos--) { + link --; + } + } + } else { + throw new IndexOutOfBoundsException(); + } +} + +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/dx/Tests.java b/jack-tests/tests/com/android/jack/flow/loop/dx/Tests.java new file mode 100644 index 00000000..0ffc613a --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/dx/Tests.java @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.dx; + +import com.android.jack.flow.loop.jack.InfiniteLoop; +import com.android.jack.flow.loop.jack.LoopDoWhileBreak; +import com.android.jack.flow.loop.jack.LoopDoWhileContinue; +import com.android.jack.flow.loop.jack.LoopDoWhileLiteral; +import com.android.jack.flow.loop.jack.LoopForBreak; +import com.android.jack.flow.loop.jack.LoopForContinue; +import com.android.jack.flow.loop.jack.LoopWhileBreak; +import com.android.jack.flow.loop.jack.LoopWhileContinue; +import com.android.jack.flow.loop.jack.NoMoreStatementBug; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void loopForBreak() { + LoopForBreak l = new LoopForBreak(); + Assert.assertEquals(5, l.loop()); + } + @Test + public void loopForBreakWithLabel() { + LoopForBreak l = new LoopForBreak(); + Assert.assertEquals(5, l.loopWithLabel()); + } + @Test + public void loopForBreakWithUnusedLabel() { + LoopForBreak l = new LoopForBreak(); + Assert.assertEquals(10, l.loopWithUnusedLabel()); + } + @Test + public void loopDoWhileBreak() { + LoopDoWhileBreak l = new LoopDoWhileBreak(); + Assert.assertEquals(5, l.loop()); + } + @Test + public void loopDoWhileBreakWithLabel() { + LoopDoWhileBreak l = new LoopDoWhileBreak(); + Assert.assertEquals(5, l.loopWithLabel()); + } + @Test + public void loopDoWhileFalse() { + LoopDoWhileLiteral l = new LoopDoWhileLiteral(); + Assert.assertEquals(2, l.doWhileFalse()); + } + @Test + public void loopDoWhileTrue() { + LoopDoWhileLiteral l = new LoopDoWhileLiteral(); + Assert.assertEquals(128, l.doWhileTrue()); + } + @Test + public void loopDoWhileBreakWithUnusedLabel() { + LoopDoWhileBreak l = new LoopDoWhileBreak(); + Assert.assertEquals(10, l.loopWithUnusedLabel()); + } + @Test + public void loopWhileBreak() { + LoopWhileBreak l = new LoopWhileBreak(); + Assert.assertEquals(5, l.loop()); + } + @Test + public void loopWhileBreakWithLabel() { + LoopWhileBreak l = new LoopWhileBreak(); + Assert.assertEquals(5, l.loopWithLabel()); + } + @Test + public void loopWhileBreakWithUnusedLabel() { + LoopWhileBreak l = new LoopWhileBreak(); + Assert.assertEquals(10, l.loopWithUnusedLabel()); + } + @Test + public void loopWhileContinue() { + LoopWhileContinue l = new LoopWhileContinue(); + Assert.assertEquals(40, l.loop()); + } + @Test + public void loopWhileContinueWithLabel() { + LoopWhileContinue l = new LoopWhileContinue(); + Assert.assertEquals(40, l.loopWithLabel()); + } + @Test + public void loopWhileContinueWithUnusedLabel() { + LoopWhileContinue l = new LoopWhileContinue(); + Assert.assertEquals(45, l.loopWithUnusedLabel()); + } + @Test + public void loopForContinue() { + LoopForContinue l = new LoopForContinue(); + Assert.assertEquals(40, l.loop()); + } + @Test + public void loopForContinueWithLabel() { + LoopForContinue l = new LoopForContinue(); + Assert.assertEquals(40, l.loopWithLabel()); + } + + @Test + public void loopForContinueWithUnusedLabel() { + LoopForContinue l = new LoopForContinue(); + Assert.assertEquals(45, l.loopWithUnusedLabel()); + } + @Test + public void loopDoWhileContinue() { + LoopDoWhileContinue l = new LoopDoWhileContinue(); + Assert.assertEquals(40, l.loop()); + } + @Test + public void loopDoWhileContinueWithLabel() { + LoopDoWhileContinue l = new LoopDoWhileContinue(); + Assert.assertEquals(40, l.loopWithLabel()); + } + @Test + public void loopDoWhileContinueWithUnusedLabel() { + LoopDoWhileContinue l = new LoopDoWhileContinue(); + Assert.assertEquals(45, l.loopWithUnusedLabel()); + } + @Test + public void noMoreStatementBug() { + NoMoreStatementBug l = new NoMoreStatementBug(); + Assert.assertEquals(40, l.loop()); + } + + @Test + public void infiniteLoop001() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop001()); + } + + @Test + public void infiniteLoop002() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop002()); + } + + @Test + public void infiniteLoop003() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop003()); + } + + @Test + public void infiniteLoop004() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop004()); + } + + @Test + public void infiniteLoop005() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop005()); + } + + @Test + public void infiniteLoop006() { + Assert.assertEquals(5, InfiniteLoop.infiniteLoop006()); + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/InfiniteLoop.java b/jack-tests/tests/com/android/jack/flow/loop/jack/InfiniteLoop.java new file mode 100644 index 00000000..282b3731 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/InfiniteLoop.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class InfiniteLoop { + + public static final boolean TRUE = true; + + public static int infiniteLoop001() { + for (int i = 0;; i++) { + if (i == 5) { + return i; + } + } + } + + public static int infiniteLoop002() { + for (int i = 0; false || TRUE; i++) { + if (i == 5) { + return i; + } + } + } + + public static int infiniteLoop003() { + int i = 0; + while(false || TRUE) { + if (i == 5) { + return i; + } + i++; + } + } + + public static int infiniteLoop004() { + int i = 0; + while(true) { + if (i == 5) { + return i; + } + i++; + } + } + + public static int infiniteLoop005() { + int i = 0; + do { + if (i == 5) { + return i; + } + i++; + } while(true); + } + + public static int infiniteLoop006() { + int i = 0; + do { + if (i == 5) { + return i; + } + i++; + } while(false || TRUE); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileBreak.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileBreak.java new file mode 100644 index 00000000..5cf0097b --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileBreak.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopDoWhileBreak { + + public int loop() { + int a = 0; + int i = 0; + do { + a = a + 1; + if (a == 5) + break; + i = i + 1; + } while ( i < 10 ); + return a; + } + + public int loopWithLabel() { + int a = 0; + int i = 0; + label: + do { + a = a + 1; + do { + if (a == 5) + break label; + } while (a < 0); + i = i + 1; + } while ( i < 10 ); + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + int i = 0; + label: + do { + a = a + 1; + do { + if (a == 5) + break; + } while (a < 0); + i = i + 1; + } while ( i < 10 ); + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileContinue.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileContinue.java new file mode 100644 index 00000000..75313187 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileContinue.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopDoWhileContinue { + + public int loop() { + int a = 0; + int i = 0; + do { + i = i + 1; + if (i == 5) + continue; + a = a + i; + } while ( i < 9 ); + return a; + } + + public int loopWithLabel() { + int a = 0; + int i = 0; + label: + do { + i = i + 1; + do { + if (i == 5) + continue label; + } + while (i<0); + a = a + i; + } while ( i < 9 ); + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + int i = 0; + label: + do { + i = i + 1; + do { + if (i == 5) + continue; + } + while (i<0); + a = a + i; + } while ( i < 9 ); + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileLiteral.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileLiteral.java new file mode 100644 index 00000000..0b3524c3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopDoWhileLiteral.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopDoWhileLiteral { + + public int doWhileFalse() { + int a = 1; + do { + a = a * 2; + } while (false); + return a; + } + + public int doWhileTrue() { + int a = 1; + do { + a = a * 2; + if (a >= 128) { + return a; + } + } while (true); + } + +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForBreak.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForBreak.java new file mode 100644 index 00000000..da368fdf --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForBreak.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopForBreak { + + public int loop() { + int a = 0; + for (int i = 0; i < 10; i = i + 1) { + a = a + 1; + if (a == 5) + break; + } + return a; + } + + public int loopWithLabel() { + int a = 0; + label: + for (int i = 0; i < 10; i = i + 1) { + a = a + 1; + for (int j = 0; j < 1; j = j + 1) { + if (a == 5) + break label; + } + } + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + label: + for (int i = 0; i < 10; i = i + 1) { + a = a + 1; + for (int j = 0; j < 1; j = j + 1) { + if (a == 5) + break; + } + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForContinue.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForContinue.java new file mode 100644 index 00000000..57d5e569 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopForContinue.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopForContinue { + + public int loop() { + int a = 0; + for (int i = 0; i < 10; i = i + 1) { + if (i == 5) + continue; + a = a + i; + } + return a; + } + + public int loopWithLabel() { + int a = 0; + label: + for (int i = 0; i < 10; i = i + 1) { + for (int j = 0; j<1; j = j + 1) { + if (i == 5) + continue label; + } + a = a + i; + } + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + label: + for (int i = 0; i < 10; i = i + 1) { + for (int j = 0; j<1; j = j + 1) { + if (i == 5) + continue; + } + a = a + i; + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopInInit.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopInInit.java new file mode 100644 index 00000000..08d311cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopInInit.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopInInit { + { + for (int i = 1; i < 1; ); + do {} while (false); + int i = 5; + while(i == 5) { + break; + } + + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileBreak.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileBreak.java new file mode 100644 index 00000000..421952e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileBreak.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopWhileBreak { + + public int loop() { + int a = 0; + int i = 0; + while ( i < 10 ) { + a = a + 1; + if (a == 5) + break; + i = i + 1; + } + return a; + } + + public int loopWithLabel() { + int a = 0; + int i = 0; + label: + while ( i < 10 ) { + a = a + 1; + boolean bool = true; + while (bool) { + if (a == 5) + break label; + bool = false; + } + i = i + 1; + } + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + int i = 0; + label: + while ( i < 10 ) { + a = a + 1; + boolean bool = true; + while (bool) { + bool = false; + if (a == 5) + break; + } + i = i + 1; + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileContinue.java b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileContinue.java new file mode 100644 index 00000000..743f403b --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/LoopWhileContinue.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class LoopWhileContinue { + + public int loop() { + int a = 0; + int i = 0; + while ( i < 9 ) { + i = i + 1; + if (i == 5) + continue; + a = a + i; + } + return a; + } + + public int loopWithLabel() { + int a = 0; + int i = 0; + label: + while ( i < 9 ) { + i = i + 1; + boolean bool = true; + while(bool) { + if (i == 5) + continue label; + bool = false; + } + a = a + i; + } + return a; + } + + public int loopWithUnusedLabel() { + int a = 0; + int i = 0; + label: + while ( i < 9 ) { + i = i + 1; + boolean bool = true; + while(bool) { + bool = false; + if (i == 5) + continue; + } + a = a + i; + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/flow/loop/jack/NoMoreStatementBug.java b/jack-tests/tests/com/android/jack/flow/loop/jack/NoMoreStatementBug.java new file mode 100644 index 00000000..d103875e --- /dev/null +++ b/jack-tests/tests/com/android/jack/flow/loop/jack/NoMoreStatementBug.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.flow.loop.jack; + +public class NoMoreStatementBug { + + public int loop() { + int a = 0; + label: { + for (int i = 0; i < 10; i = i + 1) { + if (i == 5) + continue; + a = a + i; + } + return a; + } + } +} diff --git a/jack-tests/tests/com/android/jack/generic/basic/jack/Generic.java b/jack-tests/tests/com/android/jack/generic/basic/jack/Generic.java new file mode 100644 index 00000000..440010d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/generic/basic/jack/Generic.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.generic.basic.jack; + +import java.util.Iterator; + +public class Generic { + + private Iterator values; + + + public Generic(T arg) { + } + + public Generic getT(T arg) { + return new Generic(arg); + } + + public Generic getObject(Object arg) { + return new Generic(arg); + } + + public Generic next() { + return new Generic(values.next()); + } + +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/advancedTest/dx/Tests.java b/jack-tests/tests/com/android/jack/ifstatement/advancedTest/dx/Tests.java new file mode 100644 index 00000000..effbfc64 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/advancedTest/dx/Tests.java @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.advancedTest.dx; + +import com.android.jack.ifstatement.advancedTest.jack.IfAdvanced; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about advanced if statement. + */ +public class Tests { + + @Test + public void testOr() { + Assert.assertEquals(1, IfAdvanced.testOr(true, true)); + Assert.assertEquals(1, IfAdvanced.testOr(true, false)); + Assert.assertEquals(1, IfAdvanced.testOr(false, true)); + Assert.assertEquals(0, IfAdvanced.testOr(false, false)); + } + + @Test + public void testAnd() { + Assert.assertEquals(1, IfAdvanced.testAnd(true, true)); + Assert.assertEquals(0, IfAdvanced.testAnd(true, false)); + Assert.assertEquals(0, IfAdvanced.testAnd(false, true)); + Assert.assertEquals(0, IfAdvanced.testOr(false, false)); + } + + @Test + public void testConditional() { + Assert.assertEquals(0, IfAdvanced.testConditional(false)); + Assert.assertEquals(1, IfAdvanced.testConditional(true)); + } + + @Test + public void testElseIf() { + Assert.assertEquals(0, IfAdvanced.testElseIf(0)); + Assert.assertEquals(1, IfAdvanced.testElseIf(1)); + Assert.assertEquals(-1, IfAdvanced.testElseIf(3)); + } + + @Test + public void testMix() { + Assert.assertEquals(0, IfAdvanced.testMix(0, 8)); + Assert.assertEquals(1, IfAdvanced.testMix(2, 6)); + Assert.assertEquals(1, IfAdvanced.testMix(2, 5)); + } + + @Test + public void testBraces() { + Assert.assertFalse(IfAdvanced.testBraces()); + } + + @Test + public void testNoReturnInBranch() { + Assert.assertEquals(IfAdvanced.testNoReturnInBranch(5), 5); + Assert.assertEquals(IfAdvanced.testNoReturnInBranch(-7), 7); + } + + @Test + public void testIfFalse1() { + Assert.assertEquals(2, new IfAdvanced().testIfFalse1()); + } + + @Test + public void testIfFalse2() { + Assert.assertEquals(2, new IfAdvanced().testIfFalse2()); + } + + @Test + public void testIfFalse3() { + Assert.assertEquals(2, new IfAdvanced().testIfFalse3()); + } + + @Test + public void testIfTrue1() { + Assert.assertEquals(1, new IfAdvanced().testIfTrue1()); + } + + @Test + public void testIfTrue2() { + Assert.assertEquals(1, new IfAdvanced().testIfTrue2()); + } + + @Test + public void testIfTrue3() { + Assert.assertEquals(1, new IfAdvanced().testIfTrue3()); + } + + @Test + public void testEmptyIfThen() { + Assert.assertEquals(1, new IfAdvanced().emptyIfThen(true)); + Assert.assertEquals(2, new IfAdvanced().emptyIfThen(false)); + } + + @Test + public void testEmptyIfElse() { + Assert.assertEquals(2, new IfAdvanced().emptyIfElse(true)); + Assert.assertEquals(1, new IfAdvanced().emptyIfElse(false)); + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/advancedTest/jack/IfAdvanced.java b/jack-tests/tests/com/android/jack/ifstatement/advancedTest/jack/IfAdvanced.java new file mode 100644 index 00000000..dc347703 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/advancedTest/jack/IfAdvanced.java @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.advancedTest.jack; + +public class IfAdvanced { + + public static int testOr(boolean a, boolean b) { + if (a || b) { + return 1; + } else { + return 0; + } + } + + public static int testAnd(boolean a, boolean b) { + if (a && b) { + return 1; + } else { + return 0; + } + } + + public static int testMix(int a, int b) { + if (a == 2 || b == 5) { + return 1; + } else { + return 0; + } + } + + public static int testConditional(boolean a) { + if (a ? true : false) { + return 1; + } else { + return 0; + } + } + + public static int testElseIf(int a) { + if (a == 0) { + return 0; + } else if (a == 1) { + return 1; + } else { + return -1; + } + } + + @SuppressWarnings("unused") + public static boolean testBraces() { + if (7 == 9) + return true; + else + return false; + } + + public static int testNoReturnInBranch(int a) { + int b; + if (a > 0) { + b = a; + } else { + b = -a; + } + return b; + } + + private static final boolean DEBUG = false; + private static final boolean NOT_DEBUG = true; + private boolean value = true; + + public boolean getMethod() { + return false; + } + + @SuppressWarnings("unused") + public int testIfFalse1() { + if (DEBUG && value) { + return 1; + } + return 2; + } + + @SuppressWarnings("unused") + public int testIfFalse3() { + if (DEBUG && getMethod()) { + return 1; + } + return 2; + } + + @SuppressWarnings("unused") + public int testIfFalse2() { + if (DEBUG && value) { + return 1; + } else { + return 2; + } + } + + @SuppressWarnings("unused") + public int testIfTrue1() { + if (true || value) { + return 1; + } else { + return 2; + } + } + + @SuppressWarnings("unused") + public int testIfTrue2() { + if (NOT_DEBUG || value) { + return 1; + } else { + return 2; + } + } + + @SuppressWarnings("unused") + public int testIfTrue3() { + if (NOT_DEBUG || value) { + return 1; + } + return 2; + } + + public int emptyIfThen(boolean val) { + if (val); + else { + return 2; + } + return 1; + } + + public int emptyIfElse(boolean val) { + if (val) { + return 2; + } else ; + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/cfgTest/dx/Tests.java b/jack-tests/tests/com/android/jack/ifstatement/cfgTest/dx/Tests.java new file mode 100644 index 00000000..9032147d --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/cfgTest/dx/Tests.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.cfgTest.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.ifstatement.cfgTest.jack.IfCfg; + +/** + * Tests about if statement and cfg builder. + */ +public class Tests { + + @Test + public void ifWithEndedThen() { + Assert.assertEquals(1, IfCfg.ifWithEndedThen(true)); + Assert.assertEquals(2, IfCfg.ifWithEndedThen(false)); + } + + @Test + public void ifWithEndedThenElse() { + Assert.assertEquals(1, IfCfg.ifWithEndedThenElse(true)); + Assert.assertEquals(2, IfCfg.ifWithEndedThenElse(false)); + } + + @Test + public void ifWithThen() { + Assert.assertEquals(2, IfCfg.ifWithThen(true)); + Assert.assertEquals(0, IfCfg.ifWithThen(false)); + } + + @Test + public void ifWithThenElse() { + Assert.assertEquals(2, IfCfg.ifWithThenElse(true)); + Assert.assertEquals(3, IfCfg.ifWithThenElse(false)); + } + + @Test + public void ifThenNested() { + Assert.assertEquals(4, IfCfg.ifThenNested(1)); + Assert.assertEquals(2, IfCfg.ifThenNested(2)); + } + + @Test + public void ifElseNested() { + Assert.assertEquals(4, IfCfg.ifElseNested(1)); + Assert.assertEquals(4, IfCfg.ifElseNested(2)); + Assert.assertEquals(2, IfCfg.ifElseNested(3)); + } + + @Test + public void ifEmptyThen() { + Assert.assertEquals(2, IfCfg.ifEmptyThen(1)); + Assert.assertEquals(2, IfCfg.ifEmptyThen(2)); + } + + @Test + public void ifEmptyElse() { + Assert.assertEquals(4, IfCfg.ifEmptyElse(1)); + Assert.assertEquals(2, IfCfg.ifEmptyElse(2)); + } + + @Test + public void ifThenElseNested() { + Assert.assertEquals(1, IfCfg.ifThenElseNested(1)); + Assert.assertEquals(2, IfCfg.ifThenElseNested(2)); + Assert.assertEquals(3, IfCfg.ifThenElseNested(3)); + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/cfgTest/jack/IfCfg.java b/jack-tests/tests/com/android/jack/ifstatement/cfgTest/jack/IfCfg.java new file mode 100644 index 00000000..8c611f04 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/cfgTest/jack/IfCfg.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.cfgTest.jack; + +/** + * Tests about if statement and cfg builder. + */ +public class IfCfg { + + public static int ifWithEndedThen(boolean val) { + if (val) { + return 1; + } + return 2; + } + + public static int ifWithEndedThenElse(boolean val) { + if (val) { + return 1; + } else { + return 2; + } + } + + public static int ifWithThen(boolean val) { + int result = 0; + if (val) { + result = result + 2; + } + return result; + } + + public static int ifWithThenElse(boolean val) { + int result = 0; + if (val) { + result = result + 2; + } else { + result = result + 3; + } + return result; + } + + public static int ifThenNested(int val) { + int result = 0; + if (val == 1) { + result = result + 2; + if (val != 1) { + result = result + 2; + } + } + result = result + 2; + return result; + } + + public static int ifElseNested(int val) { + int result = 0; + if (val == 1) { + result = result + 2; + } else { + if (val == 2) { + result = result + 2; + } + } + result = result + 2; + return result; + } + + public static int ifEmptyThen(int val) { + int result = 2; + if (val == 1) { + } + return result; + } + + public static int ifEmptyElse(int val) { + int result = 2; + if (val == 1) { + result = 4; + } else { + } + return result; + } + + public static int ifThenElseNested(int val) { + int result = 0; + if (val == 1) { + result = 3; + if (val == 2) { + result = 2; + } + result = 1; + } else { + if (val == 2) { + result = 2; + } else { + result = 3; + } + } + return result; + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/fastpath/dx/Tests.java b/jack-tests/tests/com/android/jack/ifstatement/fastpath/dx/Tests.java new file mode 100644 index 00000000..f07d42a5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/fastpath/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.fastpath.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.ifstatement.fastpath.jack.Data; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void testIfFastPath() { + Assert.assertEquals(1, Data.test1(false, true)); + Assert.assertEquals(2, Data.test1(false, false)); + Assert.assertEquals(2, Data.test1(true, false)); + Assert.assertEquals(2, Data.test1(true, true)); + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/fastpath/jack/Data.java b/jack-tests/tests/com/android/jack/ifstatement/fastpath/jack/Data.java new file mode 100644 index 00000000..91c9d020 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/fastpath/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.fastpath.jack; + +public class Data { + + public static int test1 (boolean a, boolean b) { + if (!a && b) { + return 1; + } else { + return 2; + } + } + + public static int test2 (Object o, boolean b) { + if (o == null || b) { + return 1; + } else { + return 2; + } + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/simpleTest/dx/Tests.java b/jack-tests/tests/com/android/jack/ifstatement/simpleTest/dx/Tests.java new file mode 100644 index 00000000..550219dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/simpleTest/dx/Tests.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.simpleTest.dx; + +import com.android.jack.ifstatement.simpleTest.jack.If; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about arithmetic. + */ +public class Tests { + + @Test + public void testTrue() { + Assert.assertEquals(1, If.testTrue()); + } + + @Test + public void testTrue2() { + Assert.assertEquals(-1, If.testTrue2()); + } + + @Test + public void testFalse() { + Assert.assertEquals(2, If.testFalse()); + } + + @Test + public void testFalse2() { + Assert.assertEquals(-1, If.testFalse2()); + } + + @Test + public void testFalseEmpty() { + Assert.assertEquals(3, If.testFalseEmpty()); + } + + @Test + public void testParam() { + Assert.assertEquals(3, If.testParam(true)); + Assert.assertEquals(4, If.testParam(false)); + } + + @Test + public void testLt() { + Assert.assertEquals(1, If.testLt(1, 2)); + Assert.assertEquals(0, If.testLt(4, 3)); + Assert.assertEquals(0, If.testLt(5, 5)); + } + + @Test + public void testGt() { + Assert.assertEquals(0, If.testGt(1, 2)); + Assert.assertEquals(1, If.testGt(4, 3)); + Assert.assertEquals(0, If.testGt(5, 5)); + } + + @Test + public void testLte() { + Assert.assertEquals(1, If.testLte(1, 2)); + Assert.assertEquals(0, If.testLte(4, 3)); + Assert.assertEquals(1, If.testLte(5, 5)); + } + + @Test + public void testGte() { + Assert.assertEquals(0, If.testGte(1, 2)); + Assert.assertEquals(1, If.testGte(4, 3)); + Assert.assertEquals(1, If.testGte(5, 5)); + } + + @Test + public void testEq() { + Assert.assertEquals(0, If.testEq(1, 2)); + Assert.assertEquals(0, If.testEq(4, 3)); + Assert.assertEquals(1, If.testEq(5, 5)); + } + + @Test + public void testNeq() { + Assert.assertEquals(1, If.testNeq(1, 2)); + Assert.assertEquals(1, If.testNeq(4, 3)); + Assert.assertEquals(0, If.testNeq(5, 5)); + } + + @Test + public void testCst() { + Assert.assertTrue(If.testCst(5)); + Assert.assertFalse(If.testCst(7)); + } + + @Test + public void testNested() { + Assert.assertTrue(If.testNested()); + } +} diff --git a/jack-tests/tests/com/android/jack/ifstatement/simpleTest/jack/If.java b/jack-tests/tests/com/android/jack/ifstatement/simpleTest/jack/If.java new file mode 100644 index 00000000..ad2dbf63 --- /dev/null +++ b/jack-tests/tests/com/android/jack/ifstatement/simpleTest/jack/If.java @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.ifstatement.simpleTest.jack; + +/** + * Tests about if statement. + */ +public class If { + @SuppressWarnings("unused") + public static int testTrue() { + if (true) { + return 1; + } else { + return 2; + } + } + + public static int testTrue2() { + if (true); + return -1; + } + + @SuppressWarnings("unused") + public static int testFalse() { + if (false) { + return 1; + } else { + return 2; + } + } + + @SuppressWarnings("unused") + public static int testFalse2() { + if (false); + return -1; + } + + @SuppressWarnings("unused") + public static int testFalseEmpty() { + if (false) { + } + return 3; + } + + public static int testParam(boolean b) { + if (b) { + return 3; + } else { + return 4; + } + } + + public static int testLt(int a, int b) { + if (a < b) { + return 1; + } else { + return 0; + } + } + + public static int testGt(int a, int b) { + if (a > b) { + return 1; + } else { + return 0; + } + } + + public static int testLte(int a, int b) { + if (a <= b) { + return 1; + } else { + return 0; + } + } + + public static int testGte(int a, int b) { + if (a >= b) { + return 1; + } else { + return 0; + } + } + + public static int testEq(int a, int b) { + if (a == b) { + return 1; + } else { + return 0; + } + } + + public static int testNeq(int a, int b) { + if (a != b) { + return 1; + } else { + return 0; + } + } + + public static boolean testCst(int a) { + if (a == 5) { + return true; + } else { + return false; + } + } + + public static boolean testNested() { + if (true) { + if (false) { + return false; + } + else { + return true; + } + } + return false; + } +} diff --git a/jack-tests/tests/com/android/jack/init/test001/jack/EmptyConstructor.java b/jack-tests/tests/com/android/jack/init/test001/jack/EmptyConstructor.java new file mode 100644 index 00000000..241e1103 --- /dev/null +++ b/jack-tests/tests/com/android/jack/init/test001/jack/EmptyConstructor.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.init.test001.jack; + +public class EmptyConstructor { + +} diff --git a/jack-tests/tests/com/android/jack/init/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/init/test002/dx/Tests.java new file mode 100644 index 00000000..82a65c4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/init/test002/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.init.test002.dx; + +import com.android.jack.init.test002.jack.EmptyClass; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test0001() { + // check that method "$init" was correctly removed before dex generation + Assert.assertEquals(0, EmptyClass.class.getDeclaredMethods().length); + } +} diff --git a/jack-tests/tests/com/android/jack/init/test002/jack/EmptyClass.java b/jack-tests/tests/com/android/jack/init/test002/jack/EmptyClass.java new file mode 100644 index 00000000..28f6ab30 --- /dev/null +++ b/jack-tests/tests/com/android/jack/init/test002/jack/EmptyClass.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.init.test002.jack; + +public class EmptyClass { + +} diff --git a/jack-tests/tests/com/android/jack/inner/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test001/dx/Tests.java new file mode 100644 index 00000000..46e50a1a --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test001/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test001.dx; + + +import com.android.jack.inner.test001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Data.A a = d.getA(); + a.m(); + a.n(); + Assert.assertEquals(6, d.getI()); + Assert.assertEquals(12, d.getJ()); + Assert.assertTrue(d.getB()); + Assert.assertFalse(d.getC()); + Assert.assertTrue(d.getD()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test001/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test001/jack/Data.java new file mode 100644 index 00000000..bd91201a --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test001/jack/Data.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test001.jack; + +public class Data { + private int i = 5; + private int j = 7; + private boolean b = false; + private boolean c = true; + private boolean d = false; + + public A getA() { + return new A(); + } + + public int getI() { + return i; + } + + public int getJ() { + return j; + } + + public boolean getB() { + return b; + } + + public boolean getC() { + return c; + } + + public boolean getD() { + return d; + } + + public class A { + public void m() { + i++; + } + + public void n() { + j = i + 6; + b = i < j; + c = j <= i; + d = !c; + } + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test002/dx/Tests.java new file mode 100644 index 00000000..bf655941 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test002/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test002.dx; + +import com.android.jack.inner.test002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(6, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test002/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test002/jack/Data.java new file mode 100644 index 00000000..8b5dcf06 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test002/jack/Data.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test002.jack; + +public class Data { + private int f = 6; + + public int m() { + A a = new A() { + + int value() { + return f; + } + }; + return a.value(); + } +} + +class A { + int value() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test003/dx/Tests.java new file mode 100644 index 00000000..47a65a3e --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test003/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test003.dx; + +import com.android.jack.inner.test003.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(7, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test003/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test003/jack/Data.java new file mode 100644 index 00000000..2dca28be --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test003/jack/Data.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test003.jack; + +public class Data { + + public int m() { + final int i = 7; + A a = new A() { + + int value() { + return i; + } + }; + return a.value(); + } +} + +class A { + int value() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test004/dx/Tests.java new file mode 100644 index 00000000..8e7fee7e --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test004/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test004.dx; + + +import com.android.jack.inner.test004.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + d.a.b.n(); + + Assert.assertEquals(8, d.getI()); + Assert.assertEquals(9, Data.si); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test004/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test004/jack/Data.java new file mode 100644 index 00000000..b0862d25 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test004/jack/Data.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test004.jack; + +public class Data { + private int i = 5; + public static int si = 8; + public A a = new A(); + + private void m() { + i++; + } + + private static void staticm() { + si++; + } + + public int getI() { + return i; + } + + public class A { + public B b = new B(); + + public class B { + public void n() { + i = 7; + m(); + staticm(); + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test005/dx/Tests.java new file mode 100644 index 00000000..cfdf874f --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test005/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test005.dx; + + +import com.android.jack.inner.test005.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + d.getA().b.n(); + + Assert.assertEquals(7, d.getI()); + Assert.assertEquals(9, Data.si); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test005/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test005/jack/Data.java new file mode 100644 index 00000000..9aa47de9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test005/jack/Data.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test005.jack; + +public class Data { + private static int i = 5; + public static int si = 8; + + private static void staticm() { + si++; + } + + public int getI() { + return i; + } + + public A getA() { + return new A() { + + }; + } + + public interface A { + public B b = new B(); + + public class B { + public void n() { + i = 7; + staticm(); + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test006/dx/Tests.java new file mode 100644 index 00000000..dfbc3278 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test006/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test006.dx; + + +import com.android.jack.inner.test006.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + d.a.b.n(); + + Assert.assertEquals(11, d.getI()); + Assert.assertEquals(9, Data.si); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test006/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test006/jack/Data.java new file mode 100644 index 00000000..e63ef6fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test006/jack/Data.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test006.jack; + +public class Data { + private int i = 5; + public static int si = 8; + public A a = new A(); + + private void m() { + i++; + } + + private static void staticm() { + si++; + } + + public int getI() { + return i; + } + + public class A { + public B b = new B(); + + public class B { + int a = 6; + + public void n() { + i = a = 7; + a = i = 10; + m(); + staticm(); + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test007/dx/Tests.java new file mode 100644 index 00000000..a7ca2e21 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test007/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test007.dx; + + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.inner.test007.jack.Data; + + +public class Tests { + + @Test + public void callPrivateConstructor() { + Assert.assertEquals(5, Data.INSTANCE.get().getField()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test007/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test007/jack/Data.java new file mode 100644 index 00000000..2723ffa9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test007/jack/Data.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test007.jack; + +public final class Data { + private int field; + + public static final ThreadLocal INSTANCE = new ThreadLocal() { + @Override protected Data initialValue() { + return new Data(); + } + }; + + private Data() { + field = 5; + } + + public int getField() { + return field; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test008/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test008/dx/Tests.java new file mode 100644 index 00000000..373915de --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test008/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test008.dx; + +import com.android.jack.inner.test008.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + d.getA().m(); + Assert.assertEquals(11, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test008/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test008/jack/Data.java new file mode 100644 index 00000000..f4b034b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test008/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test008.jack; + +import com.android.jack.inner.test008.lib.Data2; + +public class Data extends Data2 { + + public int m() { + return f; + } + + public A getA() { + return new A(); + } + + public class A { + public void m() { + f++; + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test008/lib/Data2.java b/jack-tests/tests/com/android/jack/inner/test008/lib/Data2.java new file mode 100644 index 00000000..943da205 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test008/lib/Data2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test008.lib; + +public class Data2 { + protected int f = 10; +} diff --git a/jack-tests/tests/com/android/jack/inner/test009/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test009/dx/Tests.java new file mode 100644 index 00000000..9973bbb4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test009/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test009.dx; + +import com.android.jack.inner.test009.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(9, Data.A.m().value); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test009/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test009/jack/Data.java new file mode 100644 index 00000000..2e41b8b3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test009/jack/Data.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test009.jack; + +public class Data { + public int value = 8; + + private Data() { + value ++; + } + + public static class A { + public static Data m() { + return new Data(); + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test010/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test010/dx/Tests.java new file mode 100644 index 00000000..997f442b --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test010/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test010.dx; + + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.inner.test010.jack.Data; + + +public class Tests { + + @Test + public void callPrivateMethodWithParameter() { + Assert.assertEquals("abc", Data.INSTANCE.get().getField()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test010/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test010/jack/Data.java new file mode 100644 index 00000000..d15931e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test010/jack/Data.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test010.jack; + +public final class Data { + private String str; + + public static final ThreadLocal INSTANCE = new ThreadLocal() { + @Override + protected Data initialValue() { + Data d = new Data(); + d.setField("abc"); + return d; + } + }; + + private Data() { + } + + private void setField(String str) { + this.str = str; + } + + public String getField() { + return str; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test011/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test011/dx/Tests.java new file mode 100644 index 00000000..4c059593 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test011/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test011.dx; + +import com.android.jack.inner.test011.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + d.getA().m(); + Assert.assertEquals(11, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test011/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test011/jack/Data.java new file mode 100644 index 00000000..d9d054c8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test011/jack/Data.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test011.jack; + +public class Data extends Data2 { + + public int m() { + return f; + } + + public A getA() { + return new A(); + } + + public class A { + public void m() { + f++; + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test011/jack/Data2.java b/jack-tests/tests/com/android/jack/inner/test011/jack/Data2.java new file mode 100644 index 00000000..5bab67ac --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test011/jack/Data2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test011.jack; + +public class Data2 { + protected int f = 10; +} diff --git a/jack-tests/tests/com/android/jack/inner/test012/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test012/dx/Tests.java new file mode 100644 index 00000000..10f41d98 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test012/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test012.dx; + +import com.android.jack.inner.test012.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(13, d.getB().getA().setf(5, (byte) -1)); + Assert.assertEquals(10, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test012/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test012/jack/Data.java new file mode 100644 index 00000000..50348f90 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test012/jack/Data.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test012.jack; + +import com.android.jack.inner.test012.lib.Data2; + +public class Data extends Data2 { + B b = new B(); + + public int m() { + return f; + } + + public B getB() { + return b; + } + + public class B extends Data2 { + A a = new A(); + + public A getA() { + return a; + } + + public class A { + public int setf(int value, byte increment) { + return b.setf(value, increment); + } + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test012/lib/Data2.java b/jack-tests/tests/com/android/jack/inner/test012/lib/Data2.java new file mode 100644 index 00000000..f49456b6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test012/lib/Data2.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test012.lib; + +public class Data2 { + protected int f = 10; + + private interface Data3 { + int base = 9; + } + + protected int setf(int value, byte increment) { + f = value + increment + Data3.base; + return f; + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test013/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test013/dx/Tests.java new file mode 100644 index 00000000..df5a690c --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test013/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test013.dx; + +import com.android.jack.inner.test013.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(48, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test013/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test013/jack/Data.java new file mode 100644 index 00000000..706efff6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test013/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test013.jack; + + +public class Data { + private Inner inner = new Inner(); + + public int m() { + return inner.value; + } + + private class Inner { + int value = 48; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test014/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test014/dx/Tests.java new file mode 100644 index 00000000..9d21fabf --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test014/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test014.dx; + +import com.android.jack.inner.test014.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(48, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test014/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test014/jack/Data.java new file mode 100644 index 00000000..55ee1a88 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test014/jack/Data.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test014.jack; + + +public class Data { + private Inner inner = new Inner(); + + public int m() { + return inner.value; + } + + private class Inner { + private int value = 48; + } + + private class Inner2 { + private int value = inner.value; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test015/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test015/dx/Tests.java new file mode 100644 index 00000000..a5d015b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test015/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test015.dx; + +import com.android.jack.inner.test015.jack.B; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + B b = new B(); + Assert.assertEquals("B", b.getf()); + Assert.assertEquals("C", b.c.getf()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test015/jack/B.java b/jack-tests/tests/com/android/jack/inner/test015/jack/B.java new file mode 100644 index 00000000..a1d474a5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test015/jack/B.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test015.jack; + +import com.android.jack.inner.test015.lib.A; + +public class B extends A { + public C c = new C(); + + public B() { + f = "B"; + } + + public String getf() { + return this.f; + } + + public class C extends A { + public C() { + f = "C"; + } + + public String getf() { + return this.f; + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test015/lib/A.java b/jack-tests/tests/com/android/jack/inner/test015/lib/A.java new file mode 100644 index 00000000..a8afd9fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test015/lib/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test015.lib; + +public class A { + protected String f = "A"; +} diff --git a/jack-tests/tests/com/android/jack/inner/test016/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test016/dx/Tests.java new file mode 100644 index 00000000..3a6839da --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test016/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test016.dx; + +import com.android.jack.inner.test016.jack.A; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + A a = new A(); + Assert.assertEquals("A", a.getC().m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test016/jack/A.java b/jack-tests/tests/com/android/jack/inner/test016/jack/A.java new file mode 100644 index 00000000..f270dd71 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test016/jack/A.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test016.jack; + +import com.android.jack.inner.test016.jack.bis.B; + +public class A { + protected String f = "A"; + public C getC(){ + return new C(); + } + + public class C extends B { + public String m() { + return f; + } + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test016/jack/bis/B.java b/jack-tests/tests/com/android/jack/inner/test016/jack/bis/B.java new file mode 100644 index 00000000..ebe12c1f --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test016/jack/bis/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test016.jack.bis; + +import com.android.jack.inner.test016.jack.A; + +public class B extends A { + +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test017/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test017/dx/Tests.java new file mode 100644 index 00000000..af2d5ee0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test017/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test017.dx; + +import com.android.jack.inner.test017.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(48, d.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test017/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test017/jack/Data.java new file mode 100644 index 00000000..4e52bd60 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test017/jack/Data.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test017.jack; + + +public class Data { + private Inner inner = new Inner(); + + public int m() { + return inner.value; + } + + private class Inner { + private int value = 48; + } + + private class Inner2 extends Inner { + private int value = inner.value; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test018/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test018/dx/Tests.java new file mode 100644 index 00000000..c44f66b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test018/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test018.dx; + +import com.android.jack.inner.test018.jack.A; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + A a = new A(); + Assert.assertEquals("ABC", a.b.getC().m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test018/jack/A.java b/jack-tests/tests/com/android/jack/inner/test018/jack/A.java new file mode 100644 index 00000000..4a37067d --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test018/jack/A.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test018.jack; + + +public class A { + public B b = new B(); + public class B { + protected String f = "ABC"; + + public C getC() { + return new C(); + } + public class C extends B { + public String m() { + return b.f; + } + } + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test019/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test019/dx/Tests.java new file mode 100644 index 00000000..17435ba1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test019/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test019.dx; + +import com.android.jack.inner.test019.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = new Data(); + Assert.assertEquals(42, d.get()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test019/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test019/jack/Data.java new file mode 100644 index 00000000..0c4d6ea3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test019/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test019.jack; + + +public class Data { + + private static abstract class Inner { + public abstract int get(); + } + private Inner instance = new Inner() { + + @Override + public int get() { + return 42; + } + }; + + public int get() { + return instance.get(); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test020/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test020/dx/Tests.java new file mode 100644 index 00000000..fc7a34c8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test020/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test020.dx; + +import com.android.jack.inner.test020.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + Data d = Data.getData(); + Assert.assertNotNull(d); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test020/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test020/jack/Data.java new file mode 100644 index 00000000..99c2055f --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test020/jack/Data.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test020.jack; + + +public class Data { + + public static Data getData() { + return new Data().new Inner().d; + } + + private Data() { + + } + + private Data(Data d) { + + } + + private Data(Data d, Data e) { + + } + + private Data(Inner i) { + + } + + private Data(Data d, Inner i) { + + } + + private Data(Inner i, Data d) { + + } + + private class Inner { + Data d = new Data(); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test021/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test021/dx/Tests.java new file mode 100644 index 00000000..7c1432f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test021/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test021.dx; + +import com.android.jack.inner.test021.jack.Outer; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void testOuterThisFromSuperCall() { + Assert.assertEquals(1, new Outer().testOuterThisFromSuperCall()); + } + + @Test + public void testOuterThisFromThisCall() { + Assert.assertEquals(2, new Outer().testOuterThisFromThisCall()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test021/jack/Outer.java b/jack-tests/tests/com/android/jack/inner/test021/jack/Outer.java new file mode 100644 index 00000000..c9ab959c --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test021/jack/Outer.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test021.jack; + +public class Outer { + + static class OuterRefFromSuperCtorBase { + OuterRefFromSuperCtorBase(Object o) { + o.toString(); + } + } + + class OuterRefFromSuperCtorCall extends OuterRefFromSuperCtorBase { + OuterRefFromSuperCtorCall() { + super(new Object() { + @Override + public String toString() { + value = 1; + return ""; + } + }); + } + } + + class OuterRefFromThisCtorCall extends OuterRefFromSuperCtorBase { + public OuterRefFromThisCtorCall(Object object) { + super(object); + } + + public OuterRefFromThisCtorCall() { + this(new Object() { + @Override + public String toString() { + value = 2; + return ""; + } + }); + } + } + + private int value = 0; + + public int testOuterThisFromSuperCall() { + new OuterRefFromSuperCtorCall(); + return value; + } + + public int testOuterThisFromThisCall() { + new OuterRefFromThisCtorCall(); + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test022/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test022/dx/Tests.java new file mode 100644 index 00000000..b09068d4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test022/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test022.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.inner.test022.jack.Data; + +public class Tests { + + @Test + public void testIncludingFinalLv() { + Assert.assertEquals(40, new Data().value(10)); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test022/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test022/jack/Data.java new file mode 100644 index 00000000..d14d0732 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test022/jack/Data.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test022.jack; + +public class Data { + + public int value(int val) { + final int a = val; + final int b = val; + final int c = val; + final int d = val; + + Sum s = new Sum() { + @Override + public int values() { + return a + b + c + d; + } + }; + + int result = s.values(); + return result; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test022/jack/Sum.java b/jack-tests/tests/com/android/jack/inner/test022/jack/Sum.java new file mode 100644 index 00000000..40007df9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test022/jack/Sum.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test022.jack; + +public class Sum { + + public int values() { + return 0; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/inner/test023/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test023/dx/Tests.java new file mode 100644 index 00000000..a36b6e4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test023/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test023.dx; + +import com.android.jack.inner.test023.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(42, Data.I.f); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test023/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test023/jack/Data.java new file mode 100644 index 00000000..2923e0ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test023/jack/Data.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test023.jack; + +public class Data { + public static int m() { return 42; } + public interface I { public int f = m(); } +} diff --git a/jack-tests/tests/com/android/jack/inner/test024/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test024/dx/Tests.java new file mode 100644 index 00000000..4d30b3c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test024/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test024.dx; + +import com.android.jack.inner.test024.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(2, Data.i.m()); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test024/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test024/jack/Data.java new file mode 100644 index 00000000..b84f31e2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test024/jack/Data.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test024.jack; + +public class Data { + + public interface I { + int m(); + } + + public static I i = new I() { + class C { + static final int value = 2; + } + @Override + public int m() { + return C.value; + } + }; +} diff --git a/jack-tests/tests/com/android/jack/inner/test025/jack/Data.java b/jack-tests/tests/com/android/jack/inner/test025/jack/Data.java new file mode 100644 index 00000000..de8fff0a --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test025/jack/Data.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test025.jack; + +public class Data { + { + class A {} + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test026/dx/Tests.java b/jack-tests/tests/com/android/jack/inner/test026/dx/Tests.java new file mode 100644 index 00000000..d11c3c6b --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test026/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test026.dx; + +import com.android.jack.inner.test026.jack.D; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + D d = new D(); + Assert.assertEquals(1, d.Dvalue); + Assert.assertEquals(1, d.Evalue); + Assert.assertEquals(1, d.Fvalue); + Assert.assertEquals(2, d.Gvalue); + Assert.assertEquals(1, d.G2value); + Assert.assertEquals(2, d.G3value); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test026/jack/D.java b/jack-tests/tests/com/android/jack/inner/test026/jack/D.java new file mode 100644 index 00000000..5edfc735 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test026/jack/D.java @@ -0,0 +1,48 @@ +package com.android.jack.inner.test026.jack; + +import com.android.jack.inner.test026.jack.pkg.C; + +public class D extends C { + public static int Dvalue = new D().f(); + public int Evalue = getE(); + public int Fvalue = getF(); + public static int Gvalue = new G().f(); + public static int G2value = new G().getE(); + public static int G3value = new G().getF(); + + int f() { + return m(); + } + + class E { + int f() { + return D.super.m(); + } + } + + class F { + int f() { + return m(); + } + } + + public int getE() { + return new E().f(); + } + + public int getF() { + return new F().f(); + } +} + +class G extends D { + @Override + protected int m() { + return 2; + } + + @Override + int f() { + return m(); + } +} diff --git a/jack-tests/tests/com/android/jack/inner/test026/jack/pkg/C.java b/jack-tests/tests/com/android/jack/inner/test026/jack/pkg/C.java new file mode 100644 index 00000000..c6013bf2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/inner/test026/jack/pkg/C.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.inner.test026.jack.pkg; + +public class C { + protected int m() { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/instance/test001/jack/Instance.java b/jack-tests/tests/com/android/jack/instance/test001/jack/Instance.java new file mode 100644 index 00000000..5304df3a --- /dev/null +++ b/jack-tests/tests/com/android/jack/instance/test001/jack/Instance.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.instance.test001.jack; + +public class Instance { + + public Object returnThis() { + return this; + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test001/dx/Tests.java new file mode 100644 index 00000000..80e30411 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/dx/Tests.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.dx; + +import com.android.jack.invoke.test001.jack.InvokeClone; +import com.android.jack.invoke.test001.jack.InvokeDirect; +import com.android.jack.invoke.test001.jack.InvokeInterface; +import com.android.jack.invoke.test001.jack.InvokeInterfaceComputationImpl; +import com.android.jack.invoke.test001.jack.InvokeStatic; +import com.android.jack.invoke.test001.jack.InvokeSuper; +import com.android.jack.invoke.test001.jack.InvokeVirtual; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about invoke static. + */ +public class Tests { + + @Test + public void testInvokeStatic() { + Assert.assertEquals(1 + 2, InvokeStatic.invoke001(1, 2)); + Assert.assertEquals(123456789 + 9876543210L, InvokeStatic.invoke002(123456789, 9876543210L)); + } + + @Test + public void testInvokeDirect() { + Assert.assertEquals(1 + 2, new InvokeDirect().invoke001(1, 2)); + Assert.assertEquals(123456789 + 9876543210L, + new InvokeDirect().invoke002(123456789, 9876543210L)); + } + + @Test + public void testInvokeVirtual() { + Assert.assertEquals(1 + 2, new InvokeVirtual().invoke001(1, 2)); + Assert.assertEquals(123456789 + 9876543210L, + new InvokeVirtual().invoke002(123456789, 9876543210L)); + } + + @Test + public void testInvokeInterfaces() { + Assert.assertEquals(1 + 2, + new InvokeInterface().invoke001(new InvokeInterfaceComputationImpl(), 1, 2)); + Assert.assertEquals(123456789 + 9876543210L, new InvokeInterface().invoke002( + new InvokeInterfaceComputationImpl(), 123456789, 9876543210L)); + } + + @Test + public void testInvokeSuper() { + InvokeSuper invokeSuper = new InvokeSuper(); + Assert.assertEquals(111, invokeSuper.get1()); + Assert.assertEquals(112, invokeSuper.get2()); + Assert.assertEquals(123, invokeSuper.get3()); + Assert.assertEquals(24, invokeSuper.get4()); + Assert.assertEquals(124, invokeSuper.get5()); + } + + @Test + public void testInvokeClone() { + Assert.assertEquals(3, InvokeClone.getArray()[2]); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeClone.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeClone.java new file mode 100644 index 00000000..8d1296f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeClone.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +public class InvokeClone { + + public static int[] getArray() { + int []a = new int[] {1,2,3}; + return (a.clone()); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeDirect.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeDirect.java new file mode 100644 index 00000000..1c27f826 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeDirect.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke direct. + */ +public class InvokeDirect { + + private int addInt(int a, int b) { + return (a + b); + } + + private long addLong(long a, long b) { + return (a + b); + } + + public int invoke001(int a, int b) { + return addInt(a, b); + } + + public long invoke002(long a, long b) { + return addLong(a, b); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterface.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterface.java new file mode 100644 index 00000000..7e6d0f17 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterface.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke interface. + */ +public class InvokeInterface { + + public int invoke001(InvokeInterfaceComputation compute, int a, int b) { + return compute.addInt(a, b); + } + + public long invoke002(InvokeInterfaceComputation compute, long a, long b) { + return compute.addLong(a, b); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputation.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputation.java new file mode 100644 index 00000000..b5c626d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputation.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +public interface InvokeInterfaceComputation { + int addInt(int a, int b); + + long addLong(long a, long b); +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputationImpl.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputationImpl.java new file mode 100644 index 00000000..737c523b --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeInterfaceComputationImpl.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +public class InvokeInterfaceComputationImpl implements InvokeInterfaceComputation { + @Override + public int addInt(int a, int b) { + return (a + b); + } + + @Override + public long addLong(long a, long b) { + return (a + b); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeStatic.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeStatic.java new file mode 100644 index 00000000..0f56c827 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeStatic.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke static. + */ +public class InvokeStatic { + + public static int addInt(int a, int b) { + return (a + b); + } + + public static long addLong(long a, long b) { + return (a + b); + } + + public static int invoke001(int a, int b) { + return addInt(a, b); + } + + public static long invoke002(long a, long b) { + return addLong(a, b); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuper.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuper.java new file mode 100644 index 00000000..d7c51540 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuper.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke interface. + */ +public class InvokeSuper extends InvokeSuperSuperClass1 { + + @Override + public int get1() { + return 100 + super.get1(); + } + @Override + public int get2() { + return 100 + super.get2(); + } + + @Override + public int get3() { + return 100 + super.get3(); + } + + public int get5() { + return 100 + super.get4(); + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass1.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass1.java new file mode 100644 index 00000000..3ad24af7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass1.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke interface. + */ +public class InvokeSuperSuperClass1 extends InvokeSuperSuperClass2 { + + public int get1() { + return 11; + } + + public int get2() { + return 12; + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass2.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass2.java new file mode 100644 index 00000000..bf8045ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeSuperSuperClass2.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke interface. + */ +public class InvokeSuperSuperClass2 { + + public int get1() { + return 21; + } + + public int get3() { + return 23; + } + + public int get4() { + return 24; + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeVirtual.java b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeVirtual.java new file mode 100644 index 00000000..ed551d41 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test001/jack/InvokeVirtual.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test001.jack; + +/** + * Invoke virtual. + */ +public class InvokeVirtual { + + public int addInt(int a, int b) { + return (a + b); + } + + public long addLong(long a, long b) { + return (a + b); + } + + public int invoke001(int a, int b) { + return addInt(a, b); + } + + public long invoke002(long a, long b) { + return addLong(a, b); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test002/dx/Tests.java new file mode 100644 index 00000000..ee16482d --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test002/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test002.dx; + +import com.android.jack.invoke.test002.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.util.Collection; +import java.util.LinkedList; + +public class Tests { + + @Test + public void test001() { + Collection collection = new LinkedList(); + collection.add("toto"); + collection.add("titi"); + Assert.assertEquals(6, Data.max(collection)); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test002/jack/Data.java b/jack-tests/tests/com/android/jack/invoke/test002/jack/Data.java new file mode 100644 index 00000000..d7902856 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test002/jack/Data.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test002.jack; + +import java.util.Collection; +import java.util.Iterator; + +public class Data { + + public static > int max( + Collection collection) { + Iterator iterator = collection.iterator(); + return iterator.next().compareTo(iterator.next()); + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test003/dx/Tests.java new file mode 100644 index 00000000..436ef680 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test003/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test003.dx; + +import com.android.jack.invoke.test003.jack.C; +import com.android.jack.invoke.test003.jack.Data; +import com.android.jack.invoke.test003.jack.sub.B; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + B b = new B(); + Assert.assertEquals(1, Data.get(b)); + C c = new C(); + Assert.assertEquals(42, c.get()); + Assert.assertEquals(1, c.getSuper()); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test003/jack/C.java b/jack-tests/tests/com/android/jack/invoke/test003/jack/C.java new file mode 100644 index 00000000..98291c38 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test003/jack/C.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test003.jack; + +import com.android.jack.invoke.test003.jack.sub.B; + +public class C extends B { + + @Override + public int get() { + return 42; + } + + public int getSuper() { + return super.get(); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test003/jack/Data.java b/jack-tests/tests/com/android/jack/invoke/test003/jack/Data.java new file mode 100644 index 00000000..a5705782 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test003/jack/Data.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test003.jack; + +import com.android.jack.invoke.test003.jack.sub.B; + +public class Data { + + public static int get(B b) { + return b.get(); + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/A.java b/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/A.java new file mode 100644 index 00000000..3bb8088a --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/A.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test003.jack.sub; + +class A { + + public int get() { + return 1; + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/B.java b/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/B.java new file mode 100644 index 00000000..d04199b3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test003/jack/sub/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test003.jack.sub; + +public class B extends A { + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test004/dx/Tests.java new file mode 100644 index 00000000..1fecb054 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test004/dx/Tests.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test004.dx; + +import com.android.jack.invoke.test004.jack.A; +import com.android.jack.invoke.test004.jack.B; +import com.android.jack.invoke.test004.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(17, Data.get(new A(), new B(), true)); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test004/jack/A.java b/jack-tests/tests/com/android/jack/invoke/test004/jack/A.java new file mode 100644 index 00000000..76cba62e --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test004/jack/A.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test004.jack; + +public class A implements I { + + @Override + public int get() { + return 17; + } + + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test004/jack/B.java b/jack-tests/tests/com/android/jack/invoke/test004/jack/B.java new file mode 100644 index 00000000..3edc8d37 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test004/jack/B.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test004.jack; + +public class B implements I { + + @Override + public int get() { + return 19; + } + + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test004/jack/Data.java b/jack-tests/tests/com/android/jack/invoke/test004/jack/Data.java new file mode 100644 index 00000000..03cee053 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test004/jack/Data.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test004.jack; + +public class Data { + + public static int get(T t, E e, boolean condition) { + return (condition ? t : e).get(); + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test004/jack/I.java b/jack-tests/tests/com/android/jack/invoke/test004/jack/I.java new file mode 100644 index 00000000..875cc64a --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test004/jack/I.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test004.jack; + +interface I { + + int get(); +} diff --git a/jack-tests/tests/com/android/jack/invoke/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test005/dx/Tests.java new file mode 100644 index 00000000..81abf262 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test005/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test005.dx; + +import com.android.jack.invoke.test005.jack.Caller; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(3, Caller.getValue()); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test005/jack/Caller.java b/jack-tests/tests/com/android/jack/invoke/test005/jack/Caller.java new file mode 100644 index 00000000..96474387 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test005/jack/Caller.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test005.jack; + +import com.android.jack.invoke.test005.lib.SubClass; + +public class Caller { + private static SubClass s = new SubClass(); + + public static int getValue() { + return s.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test005/lib/SubClass.java b/jack-tests/tests/com/android/jack/invoke/test005/lib/SubClass.java new file mode 100644 index 00000000..61d36a8d --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test005/lib/SubClass.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test005.lib; + +public class SubClass extends SuperClass { + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test005/lib/SuperClass.java b/jack-tests/tests/com/android/jack/invoke/test005/lib/SuperClass.java new file mode 100644 index 00000000..fb9a4659 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test005/lib/SuperClass.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test005.lib; + +class SuperClass { + public int m() { + return 3; + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/invoke/test006/dx/Tests.java new file mode 100644 index 00000000..c576f105 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test006/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test006.dx; + +import com.android.jack.invoke.test006.jack.B; +import com.android.jack.invoke.test006.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(10, Data.getValue(new B())); + } +} diff --git a/jack-tests/tests/com/android/jack/invoke/test006/jack/A.java b/jack-tests/tests/com/android/jack/invoke/test006/jack/A.java new file mode 100644 index 00000000..15ccf0ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test006/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test006.jack; + +public abstract class A implements I { + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test006/jack/B.java b/jack-tests/tests/com/android/jack/invoke/test006/jack/B.java new file mode 100644 index 00000000..30b2efd1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test006/jack/B.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test006.jack; + +public class B extends A { + + @Override + public int getInt() { + return 10; + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test006/jack/Data.java b/jack-tests/tests/com/android/jack/invoke/test006/jack/Data.java new file mode 100644 index 00000000..691322d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test006/jack/Data.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test006.jack; + +public class Data { + + public static int getValue(A a) { + return a.getInt(); + } + +} diff --git a/jack-tests/tests/com/android/jack/invoke/test006/jack/I.java b/jack-tests/tests/com/android/jack/invoke/test006/jack/I.java new file mode 100644 index 00000000..54b2af79 --- /dev/null +++ b/jack-tests/tests/com/android/jack/invoke/test006/jack/I.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.invoke.test006.jack; + +public interface I { + + public int getInt(); +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/jarjar/test001/dx/Tests.java new file mode 100644 index 00000000..e4ec1da6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/dx/Tests.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.dx; + +import com.android.jack.jarjar.test001.jack.A; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals("com.android.jack.jarjar.test001.jack.relocated.B", new A().getClassNameOfB()); + + Assert.assertEquals("com.android.jack.jarjar.test001.jack.star.relocated.B", new A().starGetClassNameOfB()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.star.relocated.C", new A().starGetClassNameOfC()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.star.untouched.B", new A().starGetClassNameOfUntouchedB()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.star.untouched.C", new A().starGetClassNameOfUntouchedC()); + + Assert.assertEquals("com.android.jack.jarjar.test001.jack.dstar.relocated.B", new A().dStarGetClassNameOfB()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.dstar.relocated.C", new A().dStarGetClassNameOfC()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.dstar.relocated.sub.B", new A().dStarGetClassNameOfUntouchedB()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.dstar.relocated.sub.C", new A().dStarGetClassNameOfUntouchedC()); + + Assert.assertEquals("com.android.jack.jarjar.test001.jack.complex.two.sep.one.B", new A().complexGetClassNameOfB()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.complex.one.sep.sub.two.B", new A().complexGetClassNameOfUntouchedB()); + + Assert.assertEquals("com.android.jack.jarjar.test001.jack.complex.two.sep.one.B", new A().testFieldRef()); + Assert.assertEquals("com.android.jack.jarjar.test001.jack.relocated.B", new A().testCtsString()); + + Assert.assertEquals("com.android.jack.jarjar.test001.jack.relocated.B", new A().testAnnot()); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/A.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/A.java new file mode 100644 index 00000000..5d522cbb --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/A.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack; + +public class A { + + public String getClassNameOfB() { + return new B().getClassName(); + } + + public String starGetClassNameOfB() { + return new com.android.jack.jarjar.test001.jack.star.B().getClassName(); + } + + public String starGetClassNameOfC() { + return new com.android.jack.jarjar.test001.jack.star.C().getClassName(); + } + + public String starGetClassNameOfUntouchedB() { + return new com.android.jack.jarjar.test001.jack.star.untouched.B().getClassName(); + } + + public String starGetClassNameOfUntouchedC() { + return new com.android.jack.jarjar.test001.jack.star.untouched.C().getClassName(); + } + + public String dStarGetClassNameOfB() { + return new com.android.jack.jarjar.test001.jack.dstar.B().getClassName(); + } + + public String dStarGetClassNameOfC() { + return new com.android.jack.jarjar.test001.jack.dstar.C().getClassName(); + } + + public String dStarGetClassNameOfUntouchedB() { + return new com.android.jack.jarjar.test001.jack.dstar.sub.B().getClassName(); + } + + public String dStarGetClassNameOfUntouchedC() { + return new com.android.jack.jarjar.test001.jack.dstar.sub.C().getClassName(); + } + + public String complexGetClassNameOfB() { + return new com.android.jack.jarjar.test001.jack.complex.one.sep.two.B().getClassName(); + } + + public String complexGetClassNameOfUntouchedB() { + return new com.android.jack.jarjar.test001.jack.complex.one.sep.sub.two.B().getClassName(); + } + + public String testFieldRef() { + return new B().f.getClass().getName(); + } + + public String testCtsString() { + return "com.android.jack.jarjar.test001.jack.B"; + } + + public String testAnnot() { + return B.class.getAnnotation(DummyAnnot.class).value(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/B.java new file mode 100644 index 00000000..3b4d8d15 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/B.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack; + +@DummyAnnot("com.android.jack.jarjar.test001.jack.B") +public class B { + + public com.android.jack.jarjar.test001.jack.complex.one.sep.two.B f + = new com.android.jack.jarjar.test001.jack.complex.one.sep.two.B(); + + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/DummyAnnot.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/DummyAnnot.java new file mode 100644 index 00000000..bbf80170 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/DummyAnnot.java @@ -0,0 +1,9 @@ +package com.android.jack.jarjar.test001.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface DummyAnnot { + String value() default ""; +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/sub/two/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/sub/two/B.java new file mode 100644 index 00000000..24bb60b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/sub/two/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.complex.one.sep.sub.two; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/two/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/two/B.java new file mode 100644 index 00000000..c5086201 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/complex/one/sep/two/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.complex.one.sep.two; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/B.java new file mode 100644 index 00000000..7e743552 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.dstar; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/C.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/C.java new file mode 100644 index 00000000..8d68e8ff --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/C.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.dstar; + +public class C extends B { +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/B.java new file mode 100644 index 00000000..19387651 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.dstar.sub; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/C.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/C.java new file mode 100644 index 00000000..020137ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/dstar/sub/C.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.dstar.sub; + +public class C extends B { +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/B.java new file mode 100644 index 00000000..62a30bbc --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.star; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/C.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/C.java new file mode 100644 index 00000000..4ff7385c --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/C.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.star; + +public class C extends B { +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/B.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/B.java new file mode 100644 index 00000000..8eed6cd5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.star.untouched; + +public class B { + public String getClassName() { + return this.getClass().getName(); + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/C.java b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/C.java new file mode 100644 index 00000000..4c2480c7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jack/star/untouched/C.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test001.jack.star.untouched; + +public class C extends B { +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/jarjar-rules.txt b/jack-tests/tests/com/android/jack/jarjar/test001/jarjar-rules.txt new file mode 100644 index 00000000..4f7c5597 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/jarjar-rules.txt @@ -0,0 +1,5 @@ +rule com.android.jack.jarjar.test001.jack.B com.android.jack.jarjar.test001.jack.relocated.B +rule com.android.jack.jarjar.test001.jack.star.* com.android.jack.jarjar.test001.jack.star.relocated.@1 +rule com.android.jack.jarjar.test001.jack.dstar.** com.android.jack.jarjar.test001.jack.dstar.relocated.@1 +rule com.android.jack.jarjar.test001.jack.complex.*.sep.*.* com.android.jack.jarjar.test001.jack.complex.@2.sep.@1.@3 +rule com.android.jack.jarjar.test002.jack.org.commons.apache.codec.binary.* com.android.jack.jarjar.test002.jack.org.commons.apache.codec.binary.elsewhere.@1 \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/jarjar/test001/test.mk b/jack-tests/tests/com/android/jack/jarjar/test001/test.mk new file mode 100644 index 00000000..906960e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test001/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := jarjar/test001 +JACKTEST_ARGS := --jarjar-rules $(private_path)/jarjar-rules.txt +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(call all-java-files-under, $(abspath $(private_path)/dx/)) +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/jarjar/test003/dx/Tests.java new file mode 100644 index 00000000..925bb414 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/dx/Tests.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test003.dx; + +import com.android.jack.jarjar.test003.jack.A; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("[Lcom.android.jack.jarjar.test003.jack.relocated.B;", + A.getArray().getClass().getName()); + } + +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/jack/A.java b/jack-tests/tests/com/android/jack/jarjar/test003/jack/A.java new file mode 100644 index 00000000..1410fc81 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/jack/A.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test003.jack; + +public class A { + public static Object getArray() { + return B.getArray(); + } + +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/jack/B.java b/jack-tests/tests/com/android/jack/jarjar/test003/jack/B.java new file mode 100644 index 00000000..780bf7fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/jack/B.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test003.jack; + +public class B { + public B(String arg) { + + } + + public static B[] getArray() { + @C + String local = "com.android.jack.jarjar.test003.jack.B"; + return new B[] {new B(local)}; + } +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/jack/C.java b/jack-tests/tests/com/android/jack/jarjar/test003/jack/C.java new file mode 100644 index 00000000..60855a41 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/jack/C.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test003.jack; + +import java.lang.annotation.Annotation; + +public @interface C { + + D value() default @D; + +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/jack/D.java b/jack-tests/tests/com/android/jack/jarjar/test003/jack/D.java new file mode 100644 index 00000000..380b9bc2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/jack/D.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.jarjar.test003.jack; + +public @interface D { + +} diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/jarjar-rules.txt b/jack-tests/tests/com/android/jack/jarjar/test003/jarjar-rules.txt new file mode 100644 index 00000000..ce52aa1b --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/jarjar-rules.txt @@ -0,0 +1,2 @@ +rule com.android.jack.jarjar.test003.jack.B com.android.jack.jarjar.test003.jack.relocated.B +rule com.android.jack.jarjar.test003.jack.C com.android.jack.jarjar.test003.jack.relocated.C \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/jarjar/test003/test.mk b/jack-tests/tests/com/android/jack/jarjar/test003/test.mk new file mode 100644 index 00000000..756cea37 --- /dev/null +++ b/jack-tests/tests/com/android/jack/jarjar/test003/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := jarjar/test003 +JACKTEST_ARGS := --jarjar-rules $(private_path)/jarjar-rules.txt +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(call all-java-files-under, $(abspath $(private_path)/dx/)) +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/exceptions/test001/dx/Tests.java new file mode 100644 index 00000000..7da491d5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test001/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.exceptions.test001.jack.ExceptionTest; + +/** + * Test multi-catch. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("Except1", new ExceptionTest().except001(1)); + Assert.assertEquals("Except2", new ExceptionTest().except001(2)); + Assert.assertEquals("No except", new ExceptionTest().except001(3)); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test001/jack/ExceptionTest.java b/jack-tests/tests/com/android/jack/java7/exceptions/test001/jack/ExceptionTest.java new file mode 100644 index 00000000..aee46fcf --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test001/jack/ExceptionTest.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test001.jack; + +/** + * Test multi-catch. + */ +public class ExceptionTest { + + public class Except1 extends Exception { + private static final long serialVersionUID = 1L; + + public Except1() { + super("Except1"); + } + + public void m1() {} + } + + public class Except2 extends Exception { + private static final long serialVersionUID = 1L; + + public Except2() { + super("Except2"); + } + + public void m2() {} + } + + public String except001(int choose) { + try { + switch (choose) { + case 1: { + throw new Except1(); + } + case 2: { + throw new Except2(); + } + default: { + return "No except"; + } + } + } catch (Except1 | Except2 e) { + return e.getMessage(); + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/exceptions/test002/dx/Tests.java new file mode 100644 index 00000000..8cc36a2f --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test002/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.exceptions.test002.jack.ExceptionTest; + +/** + * Test multi-catch. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("Except1", new ExceptionTest().except001(1)); + Assert.assertEquals("Except2", new ExceptionTest().except001(2)); + Assert.assertEquals("Except3", new ExceptionTest().except001(3)); + Assert.assertEquals("No except", new ExceptionTest().except001(4)); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test002/jack/ExceptionTest.java b/jack-tests/tests/com/android/jack/java7/exceptions/test002/jack/ExceptionTest.java new file mode 100644 index 00000000..077c95a6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test002/jack/ExceptionTest.java @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test002.jack; + +/** + * Test multi-catch. + */ +public class ExceptionTest { + + public class Except0 extends Exception { + private static final long serialVersionUID = 1L; + + public Except0(String message) { + super(message); + } + } + + public class Except1 extends Except0 { + private static final long serialVersionUID = 1L; + + public Except1() { + super("Except1"); + } + } + + public class Except2 extends Except0 { + private static final long serialVersionUID = 1L; + + public Except2() { + super("Except2"); + } + } + + + public class Except3 extends Except0 { + private static final long serialVersionUID = 1L; + + public Except3() { + super("Error"); + } + } + + public String except001(int choose) { + try { + switch (choose) { + case 1: { + throw new Except1(); + } + case 2: { + throw new Except2(); + } + case 3: { + throw new Except3(); + } + default: { + return "No except"; + } + } + } catch (Except1 | Except2 e) { + return e.getMessage(); + } catch (Except3 e) { + return "Except3"; + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/exceptions/test003/dx/Tests.java new file mode 100644 index 00000000..7d081b50 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test003/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test003.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.exceptions.test003.jack.ExceptionTest; + +/** + * Test multi-catch. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("Except1", new ExceptionTest().except001(1)); + Assert.assertEquals("Except2", new ExceptionTest().except001(2)); + Assert.assertEquals("Except3", new ExceptionTest().except001(3)); + Assert.assertEquals("No except", new ExceptionTest().except001(4)); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test003/jack/ExceptionTest.java b/jack-tests/tests/com/android/jack/java7/exceptions/test003/jack/ExceptionTest.java new file mode 100644 index 00000000..21245ad9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test003/jack/ExceptionTest.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test003.jack; + +/** + * Test multi-catch. + */ +public class ExceptionTest { + + public interface I { + String getValue(); + } + + public class Except0 extends Exception { + private static final long serialVersionUID = 1L; + + public Except0(String message) { + super(message); + } + } + + public class Except1 extends Except0 implements I { + private static final long serialVersionUID = 1L; + + public Except1() { + super("Except1"); + } + + @Override + public String getValue() { + return "Except1"; + } + } + + public class Except2 extends Except0 implements I { + private static final long serialVersionUID = 1L; + + public Except2() { + super("Except2"); + } + + @Override + public String getValue() { + return "Except2"; + } + } + + public class Except3 extends Except0 { + private static final long serialVersionUID = 1L; + + public Except3() { + super("Error"); + } + } + + public String except001(int choose) { + try { + switch (choose) { + case 1: { + throw new Except1(); + } + case 2: { + throw new Except2(); + } + case 3: { + throw new Except3(); + } + default: { + return "No except"; + } + } + } catch (Except1 | Except2 e) { + return e.getValue(); + } catch (Except3 e) { + return "Except3"; + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/exceptions/test004/dx/Tests.java new file mode 100644 index 00000000..83a03a94 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test004/dx/Tests.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test004.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.exceptions.test004.jack.ExceptionTest; + +/** + * Test multi-catch. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("Except1", new ExceptionTest().except001(1)); + Assert.assertEquals("2", new ExceptionTest().except001(2)); + Assert.assertEquals("Except3", new ExceptionTest().except001(3)); + Assert.assertEquals("No except", new ExceptionTest().except001(4)); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test004/jack/ExceptionTest.java b/jack-tests/tests/com/android/jack/java7/exceptions/test004/jack/ExceptionTest.java new file mode 100644 index 00000000..d254bc8c --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test004/jack/ExceptionTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test004.jack; + +/** + * Test multi-catch. + */ +public class ExceptionTest { + + public interface I { + T getValue(); + } + + + public class Except1 extends Exception implements I { + private static final long serialVersionUID = 1L; + + public Except1() { + super("Except1"); + } + + @Override + public String getValue() { + return "Except1"; + } + } + + public class Except2 extends Error implements I { + private static final long serialVersionUID = 1L; + + public Except2() { + super("Except2"); + } + + @Override + public Integer getValue() { + return (new Integer(2)); + } + } + + public class Except3 extends Exception { + private static final long serialVersionUID = 1L; + + public Except3() { + super("Error"); + } + } + + public String except001(int choose) { + try { + switch (choose) { + case 1: { + throw new Except1(); + } + case 2: { + throw new Except2(); + } + case 3: { + throw new Except3(); + } + default: { + return "No except"; + } + } + } catch (Except1 | Except2 e) { + return e.getValue().toString(); + } catch (Except3 e) { + return "Except3"; + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/exceptions/test005/dx/Tests.java new file mode 100644 index 00000000..6a053b4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test005/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test005.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.exceptions.test005.jack.ExceptionTest; + +/** + * Test multi-catch. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals("Except1", new ExceptionTest().except001(1)); + Assert.assertEquals("First try", new ExceptionTest().except001(3)); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/exceptions/test005/jack/ExceptionTest.java b/jack-tests/tests/com/android/jack/java7/exceptions/test005/jack/ExceptionTest.java new file mode 100644 index 00000000..c2a9d380 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/exceptions/test005/jack/ExceptionTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.exceptions.test005.jack; + +/** + * Test multi-catch. + */ +public class ExceptionTest { + + public interface I { + T getValue(); + } + + + public class Except1 extends Exception implements I { + private static final long serialVersionUID = 1L; + + public Except1() { + super("Except1"); + } + + @Override + public String getValue() { + return "Except1"; + } + } + + public class Except2 extends Error implements I { + private static final long serialVersionUID = 1L; + + public Except2() { + super("Except2"); + } + + @Override + public Integer getValue() { + return (new Integer(2)); + } + } + + public class Except3 extends Exception { + private static final long serialVersionUID = 1L; + + public Except3() { + super("Error"); + } + } + + public String except001(int choose) { + try { + try { + if (choose == 1) { + throw new Except1(); + } else if (choose == 2) { + throw new Except3(); + } + } catch (Except1 | Except2 e) { + return e.getValue().toString(); + } catch (Except3 e) { + return "Except3"; + } + throw new Except1(); + } catch (Except1 e) { + return "First try"; + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/parser/literals/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/parser/literals/test001/dx/Tests.java new file mode 100644 index 00000000..4ec75ed7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/parser/literals/test001/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.parser.literals.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.parser.literals.test001.jack.BinaryNotationTest; + +/** + * Test binary notation. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(25, new BinaryNotationTest().getValue1()); + Assert.assertEquals(-25, new BinaryNotationTest().getValue2(), 0); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/parser/literals/test001/jack/BinaryNotationTest.java b/jack-tests/tests/com/android/jack/java7/parser/literals/test001/jack/BinaryNotationTest.java new file mode 100644 index 00000000..b2f03a24 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/parser/literals/test001/jack/BinaryNotationTest.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.parser.literals.test001.jack; + +/** + * Test binary notation. + */ +public class BinaryNotationTest { + + public byte getValue1() { + return 0b11001; + } + + public float getValue2() { + return -0b11001; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/parser/literals/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/parser/literals/test002/dx/Tests.java new file mode 100644 index 00000000..d3286337 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/parser/literals/test002/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.parser.literals.test002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.parser.literals.test002.jack.UnderscoreNotationTest; + +/** + * Test underscore notation. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(25, new UnderscoreNotationTest().getValue1()); + Assert.assertEquals(-25, new UnderscoreNotationTest().getValue2(), 0); + Assert.assertEquals(11001, new UnderscoreNotationTest().getValue3()); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/parser/literals/test002/jack/UnderscoreNotationTest.java b/jack-tests/tests/com/android/jack/java7/parser/literals/test002/jack/UnderscoreNotationTest.java new file mode 100644 index 00000000..a1264f2f --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/parser/literals/test002/jack/UnderscoreNotationTest.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.parser.literals.test002.jack; + +/** + * Test underscore notation. + */ +public class UnderscoreNotationTest { + + public byte getValue1() { + return 0b1_1001; + } + + public float getValue2() { + return -0b1_1001; + } + + public int getValue3() { + return 1_1_0_0_1; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/switches/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/switches/test001/dx/Tests.java new file mode 100644 index 00000000..277d76dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test001/dx/Tests.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.switches.test001.jack.SwitchTest; + +/** + * Test switches with strings. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(1, SwitchTest.switch001("a")); + Assert.assertEquals(2, SwitchTest.switch001("b")); + Assert.assertEquals(3, SwitchTest.switch001("c")); + } + + @Test + public void test002() { + Assert.assertEquals(2, SwitchTest.switch002("a")); + Assert.assertEquals(2, SwitchTest.switch002("b")); + Assert.assertEquals(3, SwitchTest.switch002("c")); + } + + @Test + public void test003() { + Assert.assertEquals(2, SwitchTest.switch003("a")); + Assert.assertEquals(2, SwitchTest.switch003("b")); + Assert.assertEquals(3, SwitchTest.switch003("c")); + } + + @Test + public void test004() { + Assert.assertEquals(1, SwitchTest.switch004("ac")); + Assert.assertEquals(2, SwitchTest.switch004("ab")); + Assert.assertEquals(3, SwitchTest.switch004("c")); + } + + @Test + public void test005() { + Assert.assertEquals(1, SwitchTest.switch005("Aa")); + Assert.assertEquals(2, SwitchTest.switch005("BB")); + Assert.assertEquals(3, SwitchTest.switch005("AaBB")); + Assert.assertEquals(4, SwitchTest.switch005("BBAa")); + Assert.assertEquals(5, SwitchTest.switch005("BBAaC")); + } + + @Test + public void test006() { + Assert.assertEquals(1, SwitchTest.switch006("ac")); + Assert.assertEquals(2, SwitchTest.switch006("ab")); + Assert.assertEquals(3, SwitchTest.switch006("c")); + } + + @Test + public void test007() { + try { + Assert.assertEquals(1, SwitchTest.switch004(null)); + Assert.fail(); + } catch (NullPointerException e) { + // test Ok + } + } + + @Test + public void test008() { + Assert.assertEquals(1, SwitchTest.switch007("a", "b")); + Assert.assertEquals(2, SwitchTest.switch007("a", "c")); + Assert.assertEquals(3, SwitchTest.switch007("b", "a")); + Assert.assertEquals(4, SwitchTest.switch007("b", "b")); + Assert.assertEquals(4, SwitchTest.switch007("b", "c")); + Assert.assertEquals(5, SwitchTest.switch007("c", "c")); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/java7/switches/test001/jack/SwitchTest.java b/jack-tests/tests/com/android/jack/java7/switches/test001/jack/SwitchTest.java new file mode 100644 index 00000000..e0e61771 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test001/jack/SwitchTest.java @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test001.jack; + +/** + * Switch with strings. + */ +public class SwitchTest { + + public static int switch001(String a) { + switch (a) { + case "a": + return 1; + case "b": + return 2; + default: + return 3; + } + } + + public static int switch002(String a) { + switch (a) { + case "a": + case "b": + return 2; + default: + return 3; + } + } + + public static int switch003(String a) { + switch (a) { + case "a": + case "b": + return 2; + } + return 3; + } + + public static int switch004(String a) { + switch (a) { + case "a" + "c": + return 1; + case "a" + "b": + return 2; + } + return 3; + } + + public static int switch005(String a) { + switch (a) { + case "Aa": + return 1; + case "BB": + return 2; + case "AaBB": + return 3; + case "BBAa": + return 4; + } + return 5; + } + + private static final String STR_C = "c"; + private static final String STR_B = "b"; + + public static int switch006(String a) { + switch (a) { + case "a" + STR_C: + return 1; + case "a" + STR_B: + return 2; + } + return 3; + } + + public static int switch007(String a, String b) { + switch (a) { + case "a": { + switch (b) { + case "b": + return 1; + default: + return 2; + } + } + case "b": + switch (b) { + case "a": + return 3; + default: + return 4; + } + } + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/switches/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/switches/test002/dx/Tests.java new file mode 100644 index 00000000..56d61948 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test002/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.switches.test002.jack.SwitchTest; + + +/** + * Test switches with strings. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(2, SwitchTest.switch001("b")); + Assert.assertEquals(1, SwitchTest.count); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/java7/switches/test002/jack/SwitchTest.java b/jack-tests/tests/com/android/jack/java7/switches/test002/jack/SwitchTest.java new file mode 100644 index 00000000..0989c683 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test002/jack/SwitchTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test002.jack; + +/** + * Switch with strings. + */ +public class SwitchTest { + + public static int count = 0; + + private static String getValue(String a) { + count++; + return a; + } + + public static int switch001(String a) { + switch (getValue(a)) { + case "a": + return 1; + case "b": + return 2; + default: + return 3; + } + } +} diff --git a/jack-tests/tests/com/android/jack/java7/switches/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/switches/test003/dx/Tests.java new file mode 100644 index 00000000..10c85b07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test003/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test003.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.java7.switches.test003.jack.SwitchTest; + + +/** + * Test switches with strings. + */ +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(1, SwitchTest.switch001("Aa")); + Assert.assertEquals(3, SwitchTest.switch001("BB")); + Assert.assertEquals(5, SwitchTest.switch001("d")); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/java7/switches/test003/jack/SwitchTest.java b/jack-tests/tests/com/android/jack/java7/switches/test003/jack/SwitchTest.java new file mode 100644 index 00000000..3573bd4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/switches/test003/jack/SwitchTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.switches.test003.jack; + +/** + * Switch with strings. + */ +public class SwitchTest { + + public static int switch001(String a) { + int value = -1; + switch (a) { + case "Aa": + return 1; + case "BB": + value = 2; + case "c": + value++; + break; + case "d": + return 5; + default: + value = 6; + } + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/dx/Tests.java new file mode 100644 index 00000000..7f67ae0d --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/dx/Tests.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test001.dx; + +import com.android.jack.java7.trywithresources.test001.jack.TryWithResourcesTest001; + +import org.junit.Assert; +import org.junit.Test; + + /** + * Test try-with-resources. + */ + public class Tests { + + @Test + public void test001() { + try { + Assert.assertTrue(TryWithResourcesTest001.m()); + } catch (Exception e) { + Assert.fail(); + } + } + + @Test + public void test002() { + try { + TryWithResourcesTest001.m2(); + Assert.fail(); + } catch (Exception e) { + } + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/Observer.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/Observer.java new file mode 100644 index 00000000..3a42a943 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/Observer.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test001.jack; + +public class Observer { + + public boolean isClosed = false; + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/TryWithResourcesTest001.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/TryWithResourcesTest001.java new file mode 100644 index 00000000..4556d65d --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/TryWithResourcesTest001.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test001.jack; + +import com.android.jack.java7.trywithresources.test001.jack.autocloseable.AutoCloseable001; +import com.android.jack.java7.trywithresources.test001.jack.autocloseable.AutoCloseable002; + +public class TryWithResourcesTest001 { + + public static boolean m() throws Exception { + int result = 0; + Observer o = new Observer(); + try (AutoCloseable001 ac1 = new AutoCloseable001(o)) { + } + return o.isClosed; + } + + public static boolean m2() throws Exception { + int result = 0; + Observer o = new Observer(); + try (AutoCloseable002 ac2 = new AutoCloseable002()) { + + } + return o.isClosed; + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable001.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable001.java new file mode 100644 index 00000000..69208239 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable001.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test001.jack.autocloseable; + +import com.android.jack.java7.trywithresources.test001.jack.Observer; + +public class AutoCloseable001 implements AutoCloseable { + + private Observer o; + + public AutoCloseable001(Observer o) { + this.o = o; + } + + @Override + public void close() throws Exception { + o.isClosed = true; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable002.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable002.java new file mode 100644 index 00000000..5efe6237 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test001/jack/autocloseable/AutoCloseable002.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test001.jack.autocloseable; + +public class AutoCloseable002 implements AutoCloseable { + + @Override + public void close() throws Exception { + throw new Exception(); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/dx/Tests.java new file mode 100644 index 00000000..aa473200 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/dx/Tests.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.dx; + + +import com.android.jack.java7.trywithresources.test002.jack.TryWithResourcesTest002; + +import org.junit.Assert; +import org.junit.Test; + + /** + * Test try-with-resources. + */ + public class Tests { + + @Test + public void test001() { + Assert.assertTrue(TryWithResourcesTest002.m()); + } + + @Test + public void test002() { + Assert.assertTrue(TryWithResourcesTest002.m2()); + } + + @Test + public void test003() { + Assert.assertTrue(TryWithResourcesTest002.m3()); + } + + @Test + public void test004() { + Assert.assertTrue(TryWithResourcesTest002.m4()); + } + + @Test + public void test005() { + Assert.assertTrue(TryWithResourcesTest002.m5()); + } + + @Test + public void test006() { + Assert.assertTrue(TryWithResourcesTest002.m6()); + } + + @Test + public void test007() { + Assert.assertTrue(TryWithResourcesTest002.m7()); + } + + @Test + public void test008() { + Assert.assertTrue(TryWithResourcesTest002.m8()); + } + + @Test + public void test009() { + Assert.assertTrue(TryWithResourcesTest002.m9()); + } + + @Test + public void test010() { + Assert.assertTrue(TryWithResourcesTest002.m10()); + } + + @Test + public void test011() { + Assert.assertTrue(TryWithResourcesTest002.m11()); + } + + @Test + public void test012() { + Assert.assertTrue(TryWithResourcesTest002.m12()); + } + + @Test + public void test013() { + Assert.assertTrue(TryWithResourcesTest002.m13()); + } +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/Observer.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/Observer.java new file mode 100644 index 00000000..80f224e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/Observer.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack; + +public class Observer { + + public boolean isClosed = false; + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/TryWithResourcesTest002.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/TryWithResourcesTest002.java new file mode 100644 index 00000000..5b9ea0ed --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/TryWithResourcesTest002.java @@ -0,0 +1,273 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack; + +import com.android.jack.java7.trywithresources.test002.jack.autocloseable.AutoCloseable001; +import com.android.jack.java7.trywithresources.test002.jack.autocloseable.AutoCloseable002; +import com.android.jack.java7.trywithresources.test002.jack.autocloseable.AutoCloseable002b; +import com.android.jack.java7.trywithresources.test002.jack.autocloseable.AutoCloseable003; +import com.android.jack.java7.trywithresources.test002.jack.exception.E1; +import com.android.jack.java7.trywithresources.test002.jack.exception.E2; +import com.android.jack.java7.trywithresources.test002.jack.exception.E3; + +public class TryWithResourcesTest002 { + + public static boolean m() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable002 ac2 = new AutoCloseable002(o)) { + } + } catch (Exception e) { + result = !o.isClosed + && e instanceof E2 + && e.getSuppressed().length == 0; + } + return result; + } + + public static boolean m2() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable001 ac1 = new AutoCloseable001(o)) { + throw new E1(); + } + } catch (Exception e) { + result = o.isClosed + && e instanceof E1 + && e.getSuppressed().length == 0; + } + return result; + } + + public static boolean m3() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable002 ac2 = new AutoCloseable002(o)) { + throw new E1(); + } + } catch (Exception e) { + result = !o.isClosed + && e instanceof E1 + && e.getSuppressed().length == 1 + && e.getSuppressed()[0] instanceof E2; + } + return result; + } + + public static boolean m4() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + try { + try ( + AutoCloseable001 ac1 = new AutoCloseable001(o1); + AutoCloseable002 ac2 = new AutoCloseable002(o2); + ) { + throw new E1(); + } + } catch (Exception e) { + result = o1.isClosed + && !o2.isClosed + && e instanceof E1 + && e.getSuppressed().length == 1 + && e.getSuppressed()[0] instanceof E2; + } + return result; + } + + public static boolean m5() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable001 ac1 = new AutoCloseable001(o)) { + throw new E1(); + } catch (E1 e) { + result = o.isClosed + && e.getSuppressed().length == 0; + } + } catch (Exception e) { + result = false; + } + return result; + } + + public static boolean m6() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable002 ac2 = new AutoCloseable002(o)) { + + } catch (E1 e) { + result = false; + } + } catch (Exception e) { + result = !o.isClosed + && e instanceof E2 + && e.getSuppressed().length == 0; + } + return result; + } + + public static boolean m7() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable003 ac3 = new AutoCloseable003(o)) { + throw new E1(); + } catch (E1 e) { + result = false; + } + } catch (Exception e) { + result = !o.isClosed + && e instanceof E3 + && e.getSuppressed().length == 0; + } + return result; + } + + + public static boolean m8() { + boolean result = false; + Observer o = new Observer(); + try { + try (AutoCloseable003 ac3 = new AutoCloseable003(o)) { + throw new E1(); + } catch (E1 e) { + result = false; + } + } catch (Exception e) { + result = !o.isClosed + && e instanceof E3 + && e.getSuppressed().length == 0; + } + return result; + } + + public static boolean m9() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + try (AutoCloseable001 ac1 = new AutoCloseable001(o1)) { + try { + try (AutoCloseable003 ac3 = new AutoCloseable003(o2)) { + throw new E1(); + } catch (E1 e) { + result = false; + } + } catch (Exception e) { + result = !o2.isClosed + && e instanceof E3 + && e.getSuppressed().length == 0; + } + } catch (Exception e) { + result = false; + } + result &= o1.isClosed; + return result; + } + + public static boolean m10() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + try { + try ( + AutoCloseable001 ac1 = new AutoCloseable001(o1); + AutoCloseable003 ac3 = new AutoCloseable003(o2); + ) { + throw new E1(); + } + } catch (Exception e) { + result = o1.isClosed + && !o2.isClosed + && e instanceof E3 + && e.getSuppressed().length == 0; + } + return result; + } + + public static boolean m11() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + try { + try ( + AutoCloseable002 ac2 = new AutoCloseable002(o1); + AutoCloseable003 ac3 = new AutoCloseable003(o2); + ) { + throw new E1(); + } + } catch (Exception e) { + result = !o1.isClosed + && !o2.isClosed + && e instanceof E3 + && e.getSuppressed().length == 1 + && e.getSuppressed()[0] instanceof E2; + } + return result; + } + + public static boolean m12() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + try { + try ( + AutoCloseable002 ac2 = new AutoCloseable002(o1); + AutoCloseable002 ac3 = new AutoCloseable002(o2); + ) { + throw new E1(); + } + } catch (Exception e) { + result = !o1.isClosed + && !o2.isClosed + && e instanceof E1 + && e.getSuppressed().length == 2 + && e.getSuppressed()[0] instanceof E2 + && e.getSuppressed()[1] instanceof E2; + } + return result; + } + + public static boolean m13() { + boolean result = false; + Observer o1 = new Observer(); + Observer o2 = new Observer(); + Observer o3 = new Observer(); + try { + try ( + AutoCloseable001 ac1 = new AutoCloseable001(o1); + AutoCloseable002 ac2 = new AutoCloseable002(o2); + AutoCloseable002b ac2b = new AutoCloseable002b(o3); + ) { + // No exception + } + } catch (Exception e) { + result = o1.isClosed + && !o2.isClosed + && !o3.isClosed + && e instanceof E3 + && e.getSuppressed().length == 1 + && e.getSuppressed()[0] instanceof E2; + } + return result; + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable001.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable001.java new file mode 100644 index 00000000..1bb61a44 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable001.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.autocloseable; + +import com.android.jack.java7.trywithresources.test002.jack.Observer; + +public class AutoCloseable001 implements AutoCloseable { + + private Observer o; + + public AutoCloseable001(Observer o) { + this.o = o; + } + + @Override + public void close() throws Exception { + o.isClosed = true; + } +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002.java new file mode 100644 index 00000000..93a3e0cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.autocloseable; + +import com.android.jack.java7.trywithresources.test002.jack.Observer; +import com.android.jack.java7.trywithresources.test002.jack.exception.E2; + +public class AutoCloseable002 extends AutoCloseable001 { + + public AutoCloseable002(Observer o) { + super(o); + } + + @Override + public void close() throws Exception { + throw new E2(); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002b.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002b.java new file mode 100644 index 00000000..ced8cdbc --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable002b.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.autocloseable; + +import com.android.jack.java7.trywithresources.test002.jack.Observer; +import com.android.jack.java7.trywithresources.test002.jack.exception.E3; + +public class AutoCloseable002b extends AutoCloseable001 { + + public AutoCloseable002b(Observer o) { + super(o); + } + + @Override + public void close() throws Exception { + throw new E3(); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable003.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable003.java new file mode 100644 index 00000000..2107fe3f --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/autocloseable/AutoCloseable003.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.autocloseable; + +import com.android.jack.java7.trywithresources.test002.jack.Observer; +import com.android.jack.java7.trywithresources.test002.jack.exception.E2; +import com.android.jack.java7.trywithresources.test002.jack.exception.E3; + +public class AutoCloseable003 extends AutoCloseable001 { + + public AutoCloseable003(Observer o) throws E3 { + super(o); + throw new E3(); + } + + @Override + public void close() throws Exception { + throw new E2(); + } + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E1.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E1.java new file mode 100644 index 00000000..8b1aa62d --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.exception; + +public class E1 extends Exception { + + private static final long serialVersionUID = 1L; + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E2.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E2.java new file mode 100644 index 00000000..18f2fcb1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E2.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.exception; + +public class E2 extends Exception { + + private static final long serialVersionUID = 1L; + +} diff --git a/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E3.java b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E3.java new file mode 100644 index 00000000..845489ba --- /dev/null +++ b/jack-tests/tests/com/android/jack/java7/trywithresources/test002/jack/exception/E3.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.java7.trywithresources.test002.jack.exception; + +public class E3 extends Exception { + + private static final long serialVersionUID = 1L; + +} diff --git a/jack-tests/tests/com/android/jack/label/test001/jack/Label.java b/jack-tests/tests/com/android/jack/label/test001/jack/Label.java new file mode 100644 index 00000000..e54af453 --- /dev/null +++ b/jack-tests/tests/com/android/jack/label/test001/jack/Label.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.label.test001.jack; + +public class Label { + + @SuppressWarnings("unused") + public static void labelBreakingTree() { + toto: { + } + toto: { + } + } + + @SuppressWarnings("unused") + public static void labelBreakingTree2() { + toto: { + break toto; + } + toto: { + } + } +} diff --git a/jack-tests/tests/com/android/jack/liboflib/lib/jack/Lib.java b/jack-tests/tests/com/android/jack/liboflib/lib/jack/Lib.java new file mode 100644 index 00000000..22b05022 --- /dev/null +++ b/jack-tests/tests/com/android/jack/liboflib/lib/jack/Lib.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.liboflib.lib.jack; + +import com.android.jack.liboflib.lib2.jack.LibOfLib; + +public class Lib { + + private LibOfLib libOfLib; + + @Override + public String toString() { + return "lib: " + libOfLib; + } +} diff --git a/jack-tests/tests/com/android/jack/liboflib/lib2/jack/LibOfLib.java b/jack-tests/tests/com/android/jack/liboflib/lib2/jack/LibOfLib.java new file mode 100644 index 00000000..fa4d0368 --- /dev/null +++ b/jack-tests/tests/com/android/jack/liboflib/lib2/jack/LibOfLib.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.liboflib.lib2.jack; + +public class LibOfLib { + +} diff --git a/jack-tests/tests/com/android/jack/liboflib/main/jack/Main.java b/jack-tests/tests/com/android/jack/liboflib/main/jack/Main.java new file mode 100644 index 00000000..6ced3696 --- /dev/null +++ b/jack-tests/tests/com/android/jack/liboflib/main/jack/Main.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.liboflib.main.jack; + +import com.android.jack.liboflib.lib.jack.Lib; + +public class Main { + + @Override + public String toString() { + Lib lib = new Lib(); + return "main: " + lib; + } +} diff --git a/jack-tests/tests/com/android/jack/modifier/jack/FieldEnumModifier.java b/jack-tests/tests/com/android/jack/modifier/jack/FieldEnumModifier.java new file mode 100644 index 00000000..b0c6d4e3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/modifier/jack/FieldEnumModifier.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.modifier.jack; + +public class FieldEnumModifier { + + enum Select { + ONE, + TWO + } +} diff --git a/jack-tests/tests/com/android/jack/modifier/jack/FieldInnerModifier.java b/jack-tests/tests/com/android/jack/modifier/jack/FieldInnerModifier.java new file mode 100644 index 00000000..9ce2bf00 --- /dev/null +++ b/jack-tests/tests/com/android/jack/modifier/jack/FieldInnerModifier.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.modifier.jack; + +public class FieldInnerModifier { + + public class Inner { + } +} diff --git a/jack-tests/tests/com/android/jack/modifier/jack/FieldModifier.java b/jack-tests/tests/com/android/jack/modifier/jack/FieldModifier.java new file mode 100644 index 00000000..a06d7175 --- /dev/null +++ b/jack-tests/tests/com/android/jack/modifier/jack/FieldModifier.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.modifier.jack; + +public class FieldModifier { + + public int fieldPublic; + + @SuppressWarnings(value = {"unused"}) + private int fieldPrivate; + + protected int fieldProtected; + + static int fieldStatic; + + final int fieldFinal = 1; + + transient int fieldTransient; + + volatile int fieldVolatile; + + public final int fieldPublicFinal = 2; + + protected static volatile transient int fieldProtectedStaticVolatileTransient; +} diff --git a/jack-tests/tests/com/android/jack/modifier/jack/MethodModifier.java b/jack-tests/tests/com/android/jack/modifier/jack/MethodModifier.java new file mode 100644 index 00000000..955b1bfd --- /dev/null +++ b/jack-tests/tests/com/android/jack/modifier/jack/MethodModifier.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.modifier.jack; + +public abstract class MethodModifier { + + public void methodPublic() { + + } + + private void methodPrivate() { + + } + + protected void methodProtected() { + + } + + static void methodStatic() { + + } + + final void methodFinal() { + + } + + public final void methodPublicFinal() { + + } + + synchronized void methodSynchronized() { + + } + + native void methodNative(); + + void methodVarargs(int... values) { + + } + + private MethodModifier() { + + } + + public MethodModifier(int i) { + + } + + public abstract void methodAbstract(); + + strictfp void methodStrictfp() { + + } +} diff --git a/jack-tests/tests/com/android/jack/modifier/jack/TypeModifier.java b/jack-tests/tests/com/android/jack/modifier/jack/TypeModifier.java new file mode 100644 index 00000000..6cbf7aa8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/modifier/jack/TypeModifier.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.modifier.jack; + +public abstract class TypeModifier { + + public class PublicClass { + + } + + public interface PublicInterface { + + } + + public enum PublicEnum { + + } + + public @interface PublicAnnotation { + + } + + protected class ProtectedClass { + + } + + protected interface ProtectedInterface { + + } + + protected enum ProtectedEnum { + + } + + protected @interface ProtectedAnnotation { + + } + + @SuppressWarnings("unused") + private class PrivateClass { + + } + + @SuppressWarnings("unused") + private interface PrivateInterface { + + } + + @SuppressWarnings("unused") + private enum PrivateEnum { + + } + + @SuppressWarnings("unused") + private @interface PrivateAnnotation { + + } + + class PackageClass { + + } + + interface PackageInterface { + + } + + enum PackageEnum { + + } + + @interface PackageAnnotation { + + } + + static class StaticClass { + + } + + static interface StaticInterface { + + } + + static enum StaticEnum { + + } + + static @interface StaticAnnotation { + + } + + final class FinalClass { + + } + + abstract class AbstractClass { + + } + + strictfp class StrictfpClass { + + } + + strictfp interface StrictfpInterface { + + } + + strictfp enum StrictfpEnum { + + } + + strictfp @interface StrictfpAnnotation { + + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/newarray/test001/dx/Tests.java new file mode 100644 index 00000000..0de5f30c --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test001/dx/Tests.java @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test001.dx; + +import com.android.jack.newarray.test001.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +import java.util.Arrays; + +public class Tests { + @Test + public void testInt1() { + int[] array = Data.getInt1(); + int[] ref = new int[12]; + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testInt1b() { + int[] ref = new int[]{-2, -1, 0, 1, 2, 3}; + int[] array = Data.getInt1b(); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testInt1c() { + int[] ref = new int[15]; + int[] array = Data.getInt1(15); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testInt1d() { + int[] ref = new int[]{-2, -1}; + int[] array = Data.getInt1d(); + Assert.assertTrue(Arrays.equals(array, ref)); + } + @Test + public void testInt1e() { + int[] ref = new int[]{ + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + }; + int[] array = Data.getInt1e(); + Assert.assertTrue(Arrays.equals(array, ref)); + } + @Test + public void testInt1f() { + int v = 157; + int[] ref = new int[]{ + -5, -4, -3, -2, -1, v, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + }; + int[] array = Data.getInt1f(v); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testLong1() { + long[] ref = new long[]{12345678901l, -12345678901l}; + long[] array = Data.getLong1(); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testInt2() { + int[][] ref = new int[3][]; + int[][] array = Data.getInt2(3); + for (int i = 0; i < array.length; i++) { + Assert.assertTrue(Arrays.equals(array[i], ref[i])); + } + } + + @Test + public void testInt2b() { + int[][] ref = new int[][] { + {1, 2, 3}, + {4, 5, 6, 7}, + {}, + {} + }; + int[][] array = Data.getInt2b(); + for (int i = 0; i < array.length; i++) { + Assert.assertTrue(Arrays.equals(array[i], ref[i])); + } + } + + @Test + public void testInt2c() { + int[][] ref = new int[3][5]; + int[][] array = Data.getInt2c(3, 5); + for (int i = 0; i < array.length; i++) { + Assert.assertTrue(Arrays.equals(array[i], ref[i])); + + } + } + + @Test + public void testObject1() { + Object[] ref = new Object[12]; + Object[] array = Data.getObject1(); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testObject1bis() { + Object[] ref = new Object[]{"0", "1", "2", "3"}; + Object[] array = Data.getObject1(ref[0], ref[1], ref[2], ref[3]); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testObject1ter() { + Object[] ref = new Object[13]; + Object[] array = Data.getObject1(13); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testObject1b() { + String a = "a"; + String b = "b"; + String c = "c"; + String d = "d"; + Object[] ref = new Object[]{ + a, b, c, d, a + }; + Object[] array = Data.getObject1b(a, b, c, d); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testObject1c() { + String a = "a"; + String b = "b"; + String c = "c"; + String d = "d"; + Object[] ref = new Object[]{ + a, d, b, c + }; + Object[] array = Data.getObject1c(a, b, c, d); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testObject2() { + Object[][] ref = new Object[5][7]; + Object[][] array = Data.getObject2(5, 7); + for (int i = 0; i < array.length; i++) { + Assert.assertTrue(Arrays.equals(array[i], ref[i])); + } + } + + @Test + public void testObject2b() { + Object[][] ref = new Object[9][]; + Object[][] array = Data.getObject2(9); + Assert.assertTrue(Arrays.equals(array, ref)); + } + + @Test + public void testGetByteArray() { + byte[] array = Data.getByteArray(); + Assert.assertEquals(2, array[2]); + } + + @Test + public void testGetIntArray() { + int[] array = Data.getIntArray(); + Assert.assertEquals(2, array[0]); + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test001/jack/Data.java b/jack-tests/tests/com/android/jack/newarray/test001/jack/Data.java new file mode 100644 index 00000000..496c683f --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test001/jack/Data.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test001.jack; + +public class Data { + + public static int[] getInt1() { + return new int[12]; + } + + public static int[] getInt1b() { + return new int[]{-2, -1, 0, 1, 2, 3}; + } + + public static int[] getInt1(int l1) { + return new int[l1]; + } + + public static int[] getInt1d() { + return new int[]{-2, -1}; + } + public static int[] getInt1e() { + return new int[]{ + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + }; + } + public static int[] getInt1f(int v) { + return new int[]{ + -5, -4, -3, -2, -1, v, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + }; + } + + public static long[] getLong1() { + return new long[]{12345678901l, -12345678901l}; + } + + public static int[][] getInt2(int l1) { + return new int[l1][]; + } + + public static int[][] getInt2b() { + return new int[][] { + {1, 2, 3}, + {4, 5, 6, 7}, + {}, + {} + }; + } + + public static int[][] getInt2c(int l1, int l2) { + return new int[l1][l2]; + } + + public static Object[] getObject1() { + return new Object[12]; + } + + public static Object[] getObject1(Object a, Object b, Object c, Object d) { + return new Object[]{a, b, c , d}; + } + public static Object[] getObject1b(Object a, Object b, Object c, Object d) { + return new Object[]{ + a, b, c, d, a + }; + } + public static Object[] getObject1c(Object a, Object b, Object c, Object d) { + return new Object[]{ + a, d, b, c + }; + } + public static Object[] getObject1(int l1) { + return new Object[l1]; + } + public static Object[][] getObject2(int l1, int l2) { + return new Object[l1][l2]; + } + public static Object[][] getObject2(int l1) { + return new Object[l1][]; + } + + public static byte[] getByteArray() { + byte[] array = new byte[]{0, 1, 2}; + return array; + } + + public static int[] getIntArray() { + int[] array = new int[(short)2]; + array[0] = 2; + return array; + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/newarray/test002/dx/Tests.java new file mode 100644 index 00000000..88f69279 --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test002/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test002.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.newarray.test002.jack.Data; + +public class Tests { + + @Test + public void testGetInt() { + Assert.assertEquals(162, Data.getIntArray()[0]); + Assert.assertEquals(166, Data.getIntArray()[15]); + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test002/jack/Data.java b/jack-tests/tests/com/android/jack/newarray/test002/jack/Data.java new file mode 100644 index 00000000..9f8b8d3e --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test002/jack/Data.java @@ -0,0 +1,257 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test002.jack; + +public class Data { + + public static int[] getIntArray() { + return new int[]{ + 162, 175, 143, 162, 184, 143, 166, 233, 166, 168, 166, 178, 143, 166, 242, 166, + 199, 166, 209, 143, 166, 250, 167, 167, 143, 167, 203, 167, 166, 167, 177, 167, + 187, 167, 212, 167, 223, 167, 233, 167, 215, 143, 167, 251, 161, 190, 161, 200, + 161, 196, 162, 243, 162, 168, 161, 238, 143, 162, 241, 143, 162, 239, 162, 171, + 162, 205, 162, 207, 162, 187, 162, 229, 162, 202, 161, 232, 162, 226, 161, 226, + 162, 227, 162, 190, 162, 221, 162, 222, 168, 161, 168, 163, 168, 177, 168, 178, + 168, 184, 168, 181, 168, 182, 162, 163, 162, 165, 162, 167, 162, 161, 162, 254, + 161, 250, 161, 234, 162, 246, 161, 161, 161, 212, 161, 204, 164, 161, 164, 171, + 164, 181, 164, 191, 164, 201, 164, 211, 164, 221, 164, 231, 164, 241, 161, 171, + 165, 165, 165, 175, 165, 185, 165, 195, 165, 205, 165, 215, 165, 225, 165, 235, + 165, 245, 176, 236, 190, 229, 179, 238, 190, 231, 143, 176, 169, 182, 250, 208, + 167, 143, 176, 178, 143, 176, 179, 143, 176, 181, 143, 176, 183, 198, 253, 180, + 165, 205, 189, 184, 223, 176, 161, 203, 242, 208, 183, 191, 205, 208, 188, 208, + 186, 201, 213, 143, 176, 201, 208, 193, 208, 195, 180, 235, 143, 176, 214, 143, + 176, 217, 143, 176, 221, 191, 173, 143, 176, 231, 143, 176, 235, 143, 176, 238, + 143, 176, 223, 143, 176, 242, 202, 187, 187, 200, 143, 177, 162, 143, 177, 168, + 176, 205, 213, 165, 191, 175, 202, 216, 143, 177, 187, 208, 215, 208, 216, 189, + 164, 202, 240, 143, 177, 203, 143, 177, 207, 143, 177, 211, 143, 177, 216, 208, + 235, 182, 230, 143, 177, 223, 143, 177, 228, 208, 243, 143, 177, 236, 143, 177, + 242, 194, 166, 208, 250, 143, 177, 251, 143, 178, 163, 143, 178, 167, 143, 178, + 172, 208, 253, 183, 185, 209, 161, 143, 178, 185, 143, 178, 189, 193, 206, 143, + 178, 197, 202, 200, 143, 178, 202, 143, 178, 210, 209, 179, 143, 178, 218, 143, + 178, 223, 209, 184, 189, 188, 143, 178, 231, 197, 222, 143, 178, 237, 209, 194, + 197, 181, 209, 196, 209, 198, 209, 204, 180, 167, 209, 209, 186, 227, 143, 178, + 252, 143, 179, 161, 143, 179, 164, 244, 165, 189, 232, 209, 224, 189, 208, 209, + 227, 209, 230, 143, 179, 183, 143, 179, 184, 209, 233, 183, 244, 196, 230, 193, + 176, 143, 179, 193, 143, 179, 199, 143, 179, 201, 143, 179, 203, 143, 179, 206, + 143, 179, 209, 143, 179, 212, 178, 195, 197, 216, 207, 171, 179, 175, 143, 179, + 232, 240, 213, 143, 179, 239, 210, 171, 143, 179, 246, 188, 219, 202, 241, 210, + 183, 186, 252, 210, 186, 143, 180, 175, 210, 190, 143, 180, 182, 143, 180, 183, + 198, 238, 143, 180, 187, 143, 180, 190, 210, 203, 210, 204, 143, 180, 198, 206, + 210, 143, 180, 204, 210, 209, 143, 180, 212, 187, 178, 193, 208, 188, 232, 143, + 180, 224, 194, 254, 143, 180, 227, 210, 222, 177, 165, 143, 180, 230, 200, 221, + 143, 180, 236, 202, 173, 202, 242, 198, 221, 143, 180, 244, 188, 254, 204, 163, + 204, 191, 143, 181, 164, 210, 240, 143, 181, 170, 143, 181, 173, 143, 181, 179, + 143, 181, 183, 143, 181, 185, 211, 166, 211, 175, 143, 181, 191, 143, 181, 193, + 143, 181, 197, 143, 181, 202, 176, 162, 143, 181, 206, 143, 181, 209, 211, 177, + 143, 181, 217, 211, 183, 143, 181, 225, 211, 193, 143, 181, 232, 143, 181, 236, + 180, 238, 183, 246, 143, 181, 244, 143, 181, 245, 143, 181, 249, 143, 182, 161, + 143, 182, 165, 143, 182, 167, 143, 182, 168, 143, 182, 170, 143, 182, 175, 143, + 182, 179, 178, 222, 143, 182, 182, 143, 182, 188, 143, 182, 195, 143, 182, 199, + 143, 182, 200, 180, 239, 143, 182, 210, 211, 230, 211, 231, 211, 233, 143, 182, + 221, 143, 182, 225, 143, 182, 231, 143, 182, 233, 211, 244, 211, 247, 143, 182, + 244, 143, 182, 250, 143, 182, 252, 185, 241, 143, 183, 165, 143, 183, 168, 143, + 183, 171, 143, 183, 177, 143, 183, 182, 212, 173, 143, 183, 188, 212, 175, 212, + 179, 143, 183, 197, 143, 183, 205, 212, 180, 212, 181, 212, 182, 143, 183, 220, + 143, 183, 225, 212, 184, 143, 183, 230, 143, 183, 231, 212, 191, 199, 184, 143, + 183, 239, 143, 183, 243, 180, 240, 143, 183, 251, 194, 196, 143, 184, 165, 180, + 174, 190, 236, 143, 184, 172, 143, 184, 173, 197, 227, 186, 201, 143, 184, 183, + 212, 199, 143, 184, 185, 143, 184, 189, 202, 232, 143, 184, 199, 203, 207, 143, + 184, 206, 143, 184, 208, 195, 197, 212, 219, 212, 224, 143, 184, 221, 143, 184, + 222, 212, 232, 202, 209, 143, 184, 228, 143, 184, 231, 194, 231, 188, 186, 212, + 243, 198, 224, 143, 184, 244, 143, 184, 248, 212, 252, 143, 185, 162, 143, 185, + 167, 199, 165, 143, 185, 172, 143, 185, 174, 197, 202, 143, 185, 182, 143, 185, + 185, 187, 207, 213, 172, 143, 185, 195, 143, 185, 198, 176, 249, 213, 178, 143, + 185, 210, 143, 185, 211, 143, 185, 215, 213, 183, 213, 180, 143, 185, 223, 186, + 167, 143, 185, 228, 143, 185, 231, 143, 185, 235, 143, 185, 238, 143, 185, 243, + 143, 185, 246, 143, 185, 251, 213, 191, 183, 249, 213, 197, 143, 186, 167, 143, + 186, 169, 143, 186, 171, 143, 186, 174, 213, 201, 213, 202, 143, 186, 182, 196, + 220, 213, 206, 213, 210, 143, 186, 187, 213, 212, 204, 210, 213, 216, 213, 218, + 143, 186, 196, 177, 167, 143, 186, 205, 176, 184, 205, 168, 143, 186, 213, 205, + 198, 213, 227, 143, 186, 221, 143, 186, 224, 178, 201, 213, 237, 195, 254, 188, + 247, 176, 211, 213, 245, 143, 186, 235, 213, 248, 143, 186, 244, 198, 244, 213, + 252, 214, 161, 143, 186, 248, 193, 216, 214, 165, 214, 168, 143, 187, 169, 214, + 170, 143, 187, 174, 193, 187, 143, 187, 181, 214, 176, 214, 180, 143, 187, 187, + 143, 187, 188, 178, 229, 143, 187, 192, 214, 183, 191, 242, 214, 194, 214, 193, + 143, 187, 201, 143, 187, 203, 143, 187, 206, 143, 187, 211, 214, 201, 214, 191, + 191, 243, 214, 205, 143, 187, 226, 143, 187, 230, 143, 187, 232, 214, 211, 143, + 187, 240, 143, 230, 244, 214, 217, 143, 187, 247, 214, 221, 192, 238, 185, 170, + 184, 202, 180, 172, 200, 193, 214, 230, 214, 231, 191, 227, 194, 211, 203, 185, + 214, 243, 143, 188, 181, 143, 188, 184, 143, 188, 187, 180, 179, 205, 196, 200, + 223, 196, 236, 214, 249, 143, 188, 201, 176, 195, 143, 188, 207, 206, 247, 179, + 199, 215, 163, 215, 168, 215, 172, 215, 176, 143, 188, 223, 181, 221, 143, 188, + 227, 184, 204, 188, 229, 143, 188, 239, 143, 188, 244, 143, 188, 247, 143, 188, + 250, 201, 167, 190, 180, 143, 189, 166, 183, 194, 143, 189, 171, 215, 208, 143, + 189, 178, 200, 249, 143, 189, 183, 191, 180, 199, 166, 187, 214, 143, 189, 195, + 178, 247, 199, 176, 215, 221, 143, 189, 210, 143, 189, 213, 143, 189, 217, 215, + 226, 143, 189, 220, 143, 189, 222, 215, 240, 143, 189, 228, 215, 239, 178, 184, + 183, 195, 143, 189, 236, 188, 189, 143, 189, 243, 143, 189, 246, 216, 166, 143, + 189, 253, 143, 190, 161, 190, 240, 143, 190, 170, 143, 190, 173, 193, 218, 194, + 198, 216, 185, 216, 180, 143, 190, 188, 182, 242, 216, 195, 143, 190, 202, 216, + 198, 143, 190, 209, 216, 216, 216, 215, 183, 197, 216, 213, 143, 190, 216, 216, + 220, 216, 225, 143, 190, 229, 198, 180, 183, 251, 143, 190, 239, 216, 234, 178, + 251, 143, 190, 246, 216, 239, 196, 168, 216, 246, 143, 191, 167, 178, 230, 216, + 254, 192, 239, 217, 165, 204, 225, 143, 191, 182, 143, 191, 184, 143, 191, 189, + 143, 191, 191, 202, 177, 200, 227, 217, 183, 143, 191, 197, 185, 179, 143, 191, + 201, 202, 250, 217, 187, 195, 180, 217, 188, 192, 219, 143, 191, 214, 143, 191, + 216, 189, 166, 217, 205, 143, 191, 225, 182, 180, 143, 191, 228, 143, 191, 231, + 193, 222, 194, 170, 143, 191, 244, 143, 191, 248, 143, 191, 252, 199, 177, 143, + 192, 167, 199, 211, 143, 192, 174, 191, 228, 183, 199, 143, 192, 180, 143, 192, + 183, 217, 231, 143, 192, 189, 217, 226, 143, 192, 195, 217, 236, 143, 192, 201, + 217, 211, 217, 238, 143, 192, 213, 183, 200, 143, 192, 217, 197, 166, 143, 192, + 230, 143, 192, 231, 204, 206, 183, 226, 143, 192, 238, 143, 192, 242, 143, 192, + 247, 199, 197, 179, 201, 143, 193, 161, 143, 193, 166, 218, 166, 197, 167, 181, + 188, 218, 177, 218, 181, 143, 193, 185, 143, 193, 188, 143, 193, 192, 143, 193, + 196, 218, 189, 202, 252, 218, 195, 143, 193, 206, 218, 201, 143, 193, 210, 218, + 202, 143, 193, 213, 202, 184, 200, 195, 218, 207, 192, 205, 187, 219, 202, 253, + 218, 211, 143, 193, 232, 143, 193, 236, 180, 251, 189, 220, 143, 193, 242, 218, + 224, 143, 193, 249, 218, 230, 143, 194, 166, 143, 194, 172, 195, 235, 143, 194, + 179, 143, 194, 182, 143, 194, 187, 179, 162, 218, 242, 195, 210, 218, 247, 218, + 245, 218, 248, 196, 170, 143, 194, 217, 219, 162, 143, 194, 224, 143, 194, 227, + 219, 163, 219, 165, 143, 194, 234, 219, 170, 194, 216, 205, 173, 143, 194, 241, + 196, 171, 219, 176, 188, 235, 181, 224, 143, 194, 249, 194, 188, 197, 206, 143, + 195, 161, 219, 191, 143, 195, 166, 219, 199, 143, 195, 170, 143, 195, 175, 219, + 197, 143, 195, 177, 143, 195, 181, 143, 195, 188, 199, 240, 143, 195, 193, 219, + 207, 219, 211, 143, 195, 184, 198, 202, 192, 242, 143, 195, 204, 143, 195, 207, + 143, 195, 212, 143, 195, 214, 143, 195, 217, 182, 205, 143, 195, 223, 201, 176, + 143, 195, 228, 143, 195, 233, 199, 223, 219, 231, 143, 195, 241, 143, 195, 245, + 196, 244, 219, 238, 180, 254, 143, 195, 254, 143, 196, 165, 220, 168, 143, 196, + 173, 220, 170, 220, 166, 196, 199, 191, 250, 220, 176, 220, 191, 143, 196, 193, + 143, 196, 195, 201, 246, 220, 194, 143, 196, 204, 143, 196, 209, 207, 176, 186, + 231, 207, 177, 220, 213, 143, 196, 222, 143, 196, 225, 220, 201, 185, 189, 143, + 196, 232, 143, 196, 234, 220, 229, 220, 223, 143, 196, 244, 143, 196, 245, 201, + 184, 220, 235, 220, 211, 220, 247, 220, 237, 143, 197, 170, 181, 204, 220, 243, + 143, 197, 180, 143, 197, 182, 143, 197, 187, 221, 161, 220, 253, 221, 168, 221, + 166, 221, 165, 143, 197, 206, 143, 197, 210, 143, 197, 213, 143, 197, 216, 221, + 178, 205, 243, 143, 197, 226, 143, 197, 230, 178, 164, 205, 223, 182, 214, 221, + 188, 143, 197, 244, 143, 197, 247, 143, 197, 249, 186, 208, 143, 197, 254, 189, + 222, 221, 205, 143, 198, 166, 143, 198, 171, 221, 213, 143, 198, 178, 143, 198, + 182, 221, 218, 221, 219, 221, 221, 143, 198, 192, 143, 198, 195, 143, 198, 199, + 181, 164, 221, 230, 143, 198, 209, 177, 202, 181, 225, 143, 198, 218, 180, 192, + 221, 233, 143, 198, 226, 143, 198, 230, 221, 235, 198, 217, 178, 173, 203, 215, + 203, 247, 202, 168, 143, 198, 246, 200, 231, 143, 198, 254, 143, 199, 163, 222, + 165, 143, 199, 170, 143, 199, 171, 143, 199, 174, 222, 172, 196, 197, 143, 199, + 184, 143, 199, 186, 190, 244, 143, 199, 189, 143, 199, 192, 179, 189, 179, 164, + 143, 199, 198, 205, 176, 143, 199, 203, 143, 199, 206, 143, 199, 208, 143, 199, + 212, 143, 199, 215, 222, 204, 143, 199, 221, 143, 199, 225, 189, 223, 143, 199, + 231, 222, 189, 222, 188, 222, 219, 178, 185, 143, 199, 237, 222, 220, 222, 218, + 143, 199, 251, 143, 200, 161, 222, 208, 143, 200, 165, 200, 174, 189, 224, 143, + 200, 170, 222, 228, 205, 207, 143, 200, 178, 143, 200, 183, 222, 237, 194, 218, + 143, 200, 187, 223, 163, 181, 249, 143, 200, 196, 143, 200, 198, 199, 249, 143, + 200, 204, 143, 200, 208, 222, 243, 143, 200, 212, 143, 200, 217, 189, 225, 196, + 172, 223, 166, 223, 173, 143, 200, 231, 143, 200, 237, 143, 200, 240, 223, 186, + 143, 200, 248, 183, 227, 143, 200, 254, 223, 190, 143, 201, 162, 143, 201, 163, + 223, 171, 143, 201, 169, 143, 201, 173, 223, 198, 223, 202, 195, 245, 223, 208, + 143, 201, 182, 143, 201, 185, 143, 201, 189, 143, 201, 192, 178, 208, 143, 201, + 198, 143, 201, 201, 177, 234, 143, 201, 208, 143, 201, 210, 223, 220, 223, 218, + 206, 245, 143, 201, 218, 223, 223, 223, 216, 223, 226, 143, 201, 230, 177, 235, + 143, 201, 234, 143, 201, 236, 193, 179, 143, 201, 242, 143, 201, 247, 223, 230, + 143, 201, 254, 223, 236, 143, 202, 162, 223, 239, 223, 237, 244, 166, 223, 241, + 143, 202, 174, 223, 245, 197, 245, 223, 246, 143, 202, 187, 187, 184, 223, 253, + 224, 162, 143, 202, 193, 143, 202, 194, 143, 202, 197, 224, 166, 224, 170, 224, + 172, 224, 175, 143, 202, 211, 143, 202, 215, 203, 210, 143, 202, 224, 143, 202, + 227, 224, 182, 224, 183, 181, 190, 184, 164, 190, 245, 143, 202, 242, 143, 202, + 245, 143, 202, 247, 224, 195, 198, 200, 224, 198, 143, 203, 162, 143, 203, 167, + 224, 200, 143, 203, 173, 143, 203, 177, 205, 177, 143, 203, 184, 143, 203, 185, + 224, 213, 189, 195, 143, 203, 199, 224, 217, 143, 203, 207, 143, 203, 210, 143, + 203, 215, 143, 203, 220, 143, 203, 225, 143, 203, 227, 178, 209, 143, 203, 236, + 143, 203, 240, 188, 238, 183, 190, 143, 203, 248, 184, 189, 206, 176, 143, 204, + 168, 143, 204, 170, 143, 204, 178, 143, 204, 182, 143, 204, 184, 143, 204, 189, + 143, 204, 192, 143, 204, 194, 143, 204, 199, 224, 247, 143, 204, 208, 143, 204, + 213, 224, 229, 143, 204, 226, 143, 204, 231, 143, 204, 234, 143, 204, 238, 143, + 204, 242, 143, 204, 245, 225, 166, 143, 204, 252, 143, 204, 254, 185, 249, 197, + 188, 225, 180, 197, 196, 196, 174, 225, 183, 143, 205, 180, 206, 177, 225, 191, + 143, 205, 187, 143, 205, 189, 143, 205, 196, 193, 193, 143, 205, 201, 225, 207, + 225, 215, 225, 214, 143, 205, 211, 225, 218, 143, 205, 216, 143, 205, 221, 143, + 205, 225, 225, 224, 143, 205, 231, 143, 205, 236, 143, 205, 242, 143, 205, 247, + 225, 240, 143, 206, 161, 143, 206, 167, 204, 254, 225, 245, 225, 252, 143, 206, + 179, 197, 208, 143, 206, 182, 187, 169, 226, 173, 143, 206, 193, 200, 233, 226, + 176, 226, 179, 143, 206, 205, 226, 181, 143, 206, 209, 226, 187, 196, 190, 189, + 226, 226, 190, 143, 206, 222, 143, 206, 228, 226, 197, 143, 206, 234, 143, 206, + 239, 143, 206, 243, 143, 206, 248, 143, 206, 253, 143, 207, 163, 143, 207, 168, + 226, 208, 226, 211, 143, 207, 176, 143, 207, 179, 143, 207, 182, 143, 207, 186, + 226, 218, 143, 207, 189, 143, 207, 192, 143, 207, 195, 182, 235, 192, 208, 186, + 189, 226, 230, 143, 207, 212, 181, 206, 203, 164, 185, 220, 143, 207, 225, 143, + 207, 228, 143, 207, 234, 200, 163, 226, 239, 226, 238, 200, 234, 143, 207, 244, + 202, 203, 143, 207, 252, 143, 208, 161, 226, 252, 200, 216, 227, 162, 143, 208, + 173, 176, 235, 143, 208, 185, 143, 208, 188, 143, 208, 190, 143, 208, 191, 143, + 208, 196, 143, 208, 200, 143, 208, 203, 143, 208, 207, 143, 208, 211, 227, 175, + 190, 205, 143, 208, 220, 143, 208, 223, 227, 180, 143, 208, 229, 143, 208, 235, + 143, 208, 238, 143, 208, 242, 143, 208, 244, 143, 208, 249, 143, 208, 252, 199, + 233, 190, 206, 176, 220, 143, 209, 172, 143, 209, 176, 143, 209, 178, 143, 209, + 181, 227, 202, 227, 203, 143, 209, 192, 178, 186, 143, 209, 198, 190, 247, 143, + 209, 206, 143, 209, 208, 143, 209, 211, 143, 209, 216, 143, 209, 219, 227, 221, + 143, 209, 223, 227, 227, 143, 209, 229, 227, 234, 227, 237, 143, 209, 234, 143, + 209, 239, 143, 209, 242, 181, 232, 143, 209, 244, 227, 250, 227, 252, 227, 247, + 143, 210, 163, 143, 210, 167, 195, 222, 228, 184, 228, 170, 228, 172, 143, 210, + 180, 143, 210, 182, 228, 176, 143, 210, 189, 143, 210, 191, 143, 210, 196, 200, + 207, 228, 189, 143, 210, 207, 198, 198, 143, 210, 212, 143, 210, 218, 143, 210, + 224, 228, 194, 143, 210, 231, 143, 210, 233, 143, 210, 237, 228, 213, 143, 210, + 244, 228, 216, 143, 210, 254, 143, 211, 164, 202, 198, 143, 211, 171, 143, 211, + 211, 143, 220, 195, 143, 220, 197, 234, 227, 143, 220, 206, 234, 235, 234, 236, + 234, 233, 143, 220, 214, 179, 236, 143, 220, 222, 234, 243, 143, 220, 228, 143, + 220, 233, 234, 247, 143, 220, 240, 143, 220, 243, 235, 162, 143, 220, 250, 143, + 220, 254, 202, 164, 143, 221, 166, 179, 208, 143, 221, 173, 235, 178, 235, 180, + 179, 209, 235, 185, 191, 168, 143, 221, 189, 143, 221, 193, 143, 221, 197, 143, + 221, 199, 235, 194, 235, 196, 143, 221, 210, 191, 199, 143, 221, 217, 186, 190, + 235, 199, 143, 221, 229, 181, 205, 143, 221, 235, 235, 209, 143, 221, 243, 143, + 221, 248, 235, 216, 198, 201, 143, 222, 162, 235, 219, 180, 210, 207, 192, 235, + 227, 235, 221, 143, 222, 180, 143, 222, 183, 143, 222, 191, 235, 226, 143, 222, + 189, 235, 245, 235, 240, 235, 244, 143, 222, 201, 143, 222, 202, 201, 232, 183, + 217, 181, 196, 143, 222, 213, 218, 206, 143, 222, 221, 143, 222, 224, 195, 171, + 236, 175, 143, 222, 233, 236, 181, 190, 221, 208, 174, 143, 222, 250, 236, 186, + 203, 198, 236, 194, 185, 215, 192, 213, 236, 202, 178, 236, 194, 177, 143, 223, + 178, 199, 229, 188, 193, 143, 223, 187, 143, 223, 191, 143, 223, 194, 236, 219, + 192, 214, 143, 223, 201, 143, 223, 202, 177, 219, 143, 223, 209, 143, 223, 211, + 143, 223, 214, 143, 223, 218, 143, 223, 222, 143, 223, 227, 143, 223, 230, 236, + 240, 236, 238, 143, 223, 242, 236, 245, 236, 244, 143, 223, 250, 236, 247, 237, + 169, 236, 253, 143, 224, 171, 236, 254, 143, 224, 177, 143, 224, 181, 143, 224, + 184, 189, 179, 237, 175, 237, 179, 143, 224, 198, 237, 186, 191, 200, 143, 224, + 209, 143, 224, 212, 188, 214, 143, 224, 219, 198, 240, 237, 199, 143, 224, 225, + 143, 224, 230, 237, 210, 143, 224, 235, 143, 224, 239, 206, 216, 143, 224, 248, + 237, 217, 237, 219, 143, 225, 166, 143, 225, 170, 191, 201, 143, 225, 177, 237, + 231, 202, 213, 203, 248, 183, 222, 237, 233, 143, 225, 195, 143, 225, 197, 237, + 254, 143, 225, 203, 143, 225, 206, 237, 248, 194, 164, 143, 225, 212, 143, 225, + 216, 238, 167, 238, 166, 198, 187, 143, 225, 223, 143, 225, 226, 238, 175, 206, + 203, 237, 238, 205, 184, 143, 225, 241, 143, 225, 245, 238, 184, 143, 225, 251, + 143, 226, 163, 143, 226, 173, 143, 226, 169, 201, 244, 143, 226, 178, 143, 226, + 179, 143, 226, 185, 238, 192, 143, 226, 193, 143, 226, 199, 143, 226, 203, 143, + 226, 209, 143, 226, 212, 188, 242, 143, 226, 220, 189, 183, 185, 243, 143, 226, + 228, 238, 204, 143, 226, 237, 143, 226, 240, 238, 208, 238, 211, 143, 226, 254, + 238, 216, 143, 227, 164, 191, 203, 182, 252, 143, 227, 179, 143, 227, 182, 143, + 227, 187, 143, 227, 193, 143, 227, 198, 143, 227, 203, 143, 227, 207, 143, 227, + 213, 197, 180, 143, 227, 223, 143, 227, 226, 200, 173, 143, 227, 236, 143, 227, + 242, 189, 198, 143, 227, 251, 143, 227, 254, 143, 228, 164, 143, 228, 169, 238, + 248, 143, 228, 181, 143, 228, 188, 143, 228, 193, 143, 228, 200, 143, 228, 205, + 181, 248, 143, 228, 212, 143, 228, 214, 191, 238, 239, 162, 207, 163, 143, 228, + 230, 238, 253, 143, 228, 235, 143, 228, 241, 143, 228, 243, 239, 171, 143, 229, + 161, 143, 229, 167, 143, 229, 172, 143, 229, 176, 143, 229, 181, 143, 229, 183, + 143, 229, 188, 143, 229, 195, 239, 178, 182, 192, 143, 229, 207, 143, 229, 212, + 143, 229, 217, 143, 229, 222, 239, 197, 239, 195, 239, 196, 143, 229, 231, 143, + 229, 236, 143, 229, 238, 143, 229, 241, 239, 206, 239, 209, 239, 216, 196, 185, + 239, 217, 143, 230, 164, 239, 221, 239, 224, 143, 230, 173, 143, 230, 176, 239, + 234, 239, 235, 198, 174, 239, 243, 201, 236, 143, 230, 201, 143, 230, 203, 193, + 203, 239, 251, 143, 230, 214, 143, 230, 217, 240, 165, 198, 171, 143, 230, 224, + 231, 161, 240, 168, 143, 230, 233, 143, 230, 237, 143, 230, 240, 191, 253, 143, + 230, 242, 240, 186, 143, 230, 249, 143, 230, 250, 206, 237, 188, 251, 206, 238, + 240, 195, 143, 231, 167, 240, 199, 240, 201, 240, 205, 192, 196, 240, 208, 240, + 211, 240, 215, 143, 231, 191, 240, 217, 240, 223, 143, 231, 199, 240, 228, 202, + 220, 143, 231, 210, 240, 231, 143, 231, 223, 143, 231, 228, 143, 231, 235, 240, + 236, 143, 231, 240, 202, 199, 240, 243, 143, 231, 249, 143, 231, 252, 143, 232, + 161, 143, 232, 167, 143, 232, 170, 179, 220, 180, 234, 143, 232, 180, 143, 232, + 142, 215, 161, 177}; + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/newarray/test003/dx/Tests.java new file mode 100644 index 00000000..9f21d2a7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test003/dx/Tests.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test003.dx; + +import com.android.jack.newarray.test003.jack.ArrayReuse; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + new ArrayReuse().arrayDimReuse(); + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test003/jack/ArrayReuse.java b/jack-tests/tests/com/android/jack/newarray/test003/jack/ArrayReuse.java new file mode 100644 index 00000000..a60af36f --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test003/jack/ArrayReuse.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test003.jack; + +public class ArrayReuse { + + public void arrayDimReuse() { + int[][] a = new int[1][]; + int[][] b = new int[1][]; + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/newarray/test004/dx/Tests.java new file mode 100644 index 00000000..e1bfa3eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test004/dx/Tests.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test004.dx; + +import com.android.jack.newarray.test004.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void testByte() { + Assert.assertEquals(1, Data.getByteArray()[0]); + Assert.assertEquals(-1, Data.getByteArray1()[1]); + } + + @Test + public void testChar() { + Assert.assertEquals(166, Data.getCharArray()[0]); + } + + @Test + public void testShort() { + Assert.assertEquals(11566, Data.getShortArray()[0]); + } + + @Test + public void testInt() { + Assert.assertEquals(11566, Data.getIntArray()[0]); + } + + @Test + public void testFloat() { + Assert.assertEquals(1.2f, Data.getFloatArray()[0], 0.0); + } + + @Test + public void testDouble() { + Assert.assertEquals(1.2f, Data.getDoubleArray()[0], 0.0); + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test004/jack/Data.java b/jack-tests/tests/com/android/jack/newarray/test004/jack/Data.java new file mode 100644 index 00000000..9f59d4ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test004/jack/Data.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test004.jack; + +public class Data { + + public static byte[] getByteArray1() { + byte[] b = new byte[]{1,-1}; + return b; + } + + public static byte[] getByteArray() { + byte[] b = new byte[]{(byte)1,2,3}; + return b; + } + + public static char[] getCharArray() { + char[] c = new char[]{166,21236,36666}; + return c; + } + + public static short[] getShortArray() { + short[] s = new short[]{11566,21236,3666}; + return s; + } + + public static int[] getIntArray() { + int[] i = new int[]{11566,21236,366666}; + return i; + } + + public static float[] getFloatArray() { + float[] f = new float[]{1.2f, 3, 1.9f}; + return f; + } + + public static float[] getFloatArray2() { + float[] f = new float[]{1l, 12345678945678978l, 1.9f}; + return f; + } + + public static double[] getDoubleArray() { + double[] d = new double[]{1.2f,2,3}; + return d; + } + + public static double[] getDoubleArray2() { + double[] d = new double[]{1l,2l,3}; + return d; + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/newarray/test005/dx/Tests.java new file mode 100644 index 00000000..f0a4c8f1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test005/dx/Tests.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test005.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.newarray.test005.jack.Data; + +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(0, Data.getArray1()[0][0]); + } + + @Test + public void test2() { + Assert.assertEquals(1, Data.getArray2()[0]); + Assert.assertEquals(3, Data.getArray2()[2]); + Assert.assertEquals(5, Data.getArray2()[4]); + } + + @Test + public void test3() { + Assert.assertEquals(1, Data.getArray3()[0]); + Assert.assertEquals(3, Data.getArray3()[2]); + Assert.assertEquals(6, Data.getArray3()[5]); + } + + @Test + public void test4() { + Assert.assertEquals(-1, Data.getArray4()[0]); + Assert.assertEquals(2, Data.getArray4()[1]); + } + + @Test + public void test5() { + Assert.assertEquals(10, Data.getArray5()[0][1][2][3]); + } + + @Test + public void test6() { + Assert.assertEquals(null, Data.getArray6()[0]); + } +} diff --git a/jack-tests/tests/com/android/jack/newarray/test005/jack/Data.java b/jack-tests/tests/com/android/jack/newarray/test005/jack/Data.java new file mode 100644 index 00000000..7a5cc486 --- /dev/null +++ b/jack-tests/tests/com/android/jack/newarray/test005/jack/Data.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.newarray.test005.jack; + +/** + * Tests should work with fill-new-array instruction. + */ +public class Data { + + public static int[][] getArray1() { + int[][] a = new int[1][1]; + return a; + } + + public static int[] getArray2() { + int[] a = new int[] {1,2,3,4,5}; + return a; + } + + public static int[] getArray3() { + int[] a = new int[] {1,2,3,4,5,6}; + return a; + } + + public static byte[] getArray4() { + byte[] a = new byte[] {-1,2}; + return a; + } + + public static int[][][][] getArray5() { + int[][][][] a = new int[1][2][3][4]; + a[0][1][2][3] = 10; + return a; + } + + public static Object[] getArray6() { + Object[] a = new Object[] {null, null}; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/nopackage/jack/ClassInDefaultPackage.java b/jack-tests/tests/com/android/jack/nopackage/jack/ClassInDefaultPackage.java new file mode 100644 index 00000000..91e24242 --- /dev/null +++ b/jack-tests/tests/com/android/jack/nopackage/jack/ClassInDefaultPackage.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class ClassInDefaultPackage { + public static ClassInDefaultPackage get() { + return new ClassInDefaultPackage(); + } +} diff --git a/jack-tests/tests/com/android/jack/nopackage/jack/InnerInDefaultPackage.java b/jack-tests/tests/com/android/jack/nopackage/jack/InnerInDefaultPackage.java new file mode 100644 index 00000000..48e7c487 --- /dev/null +++ b/jack-tests/tests/com/android/jack/nopackage/jack/InnerInDefaultPackage.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +public class InnerInDefaultPackage { + private static class Inner { + } + + public static Object getAnonymous() { + return new java.io.Serializable() {}; + } + + public static Object getInner() { + return new Inner(); + } + + public static Object getLocal() { + class Inner2 { + + } + return new Inner2(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_double/Test_add_double.java b/jack-tests/tests/com/android/jack/opcodes/add_double/Test_add_double.java new file mode 100644 index 00000000..3362d0a4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_double/Test_add_double.java @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.add_double.jm.T_add_double_1; +import com.android.jack.opcodes.add_double.jm.T_add_double_3; +import com.android.jack.opcodes.add_double.jm.T_add_double_4; + + +public class Test_add_double extends DxTestCase { + + /** + * @title Arguments = 2.7d, 3.14d + */ + public void testN1() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(5.84d, t.run(2.7d, 3.14d)); + } + + /** + * @title Arguments = 0, -3.14d + */ + public void testN2() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(-3.14d, t.run(0, -3.14d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN3() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(-5.84d, t.run(-3.14d, -2.7d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN4() { + T_add_double_3 t = new T_add_double_3(); + assertEquals(-5.84d, t.run(-3.14d, -2.7d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN5() { + T_add_double_4 t = new T_add_double_4(); + assertEquals(-5.84d, t.run(-3.14d, -2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.NaN + */ + public void testB1() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(Double.NaN, t.run(Double.MAX_VALUE, Double.NaN)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB2() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.POSITIVE_INFINITY + */ + public void testB3() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + Double.POSITIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, -2.7d + */ + public void testB4() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + -2.7d)); + } + + /** + * @title Arguments = +0, -0 + */ + public void testB5() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(+0d, t.run(+0d, -0d)); + } + + /** + * @title Arguments = -0d, -0d + */ + public void testB6() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(-0d, t.run(-0d, -0d)); + } + + /** + * @title Arguments = -2.7d, 2.7d + */ + public void testB7() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(+0d, t.run(-2.7d, 2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.MAX_VALUE + */ + public void testB8() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.MAX_VALUE, + Double.MAX_VALUE)); + } + + /** + * @title Arguments = Double.MIN_VALUE, -4.9E-324 + */ + public void testB9() { + T_add_double_1 t = new T_add_double_1(); + assertEquals(0d, t.run(Double.MIN_VALUE, -4.9E-324)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_1.java b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_1.java new file mode 100644 index 00000000..3074e0df --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_double.jm; + +public class T_add_double_1 { + + public double run(double a, double b) { + return a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_3.java b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_3.java new file mode 100644 index 00000000..8592257f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_double.jm; + +public class T_add_double_3 { + + public double run(double a, double b) { + return a+(double)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_4.java b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_4.java new file mode 100644 index 00000000..d55f4b6a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_double/jm/T_add_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_double.jm; + +public class T_add_double_4 { + + public double run(double a, double b) { + return (double)a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_float/Test_add_float.java b/jack-tests/tests/com/android/jack/opcodes/add_float/Test_add_float.java new file mode 100644 index 00000000..6011775c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_float/Test_add_float.java @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.add_float.jm.T_add_float_1; +import com.android.jack.opcodes.add_float.jm.T_add_float_3; +import com.android.jack.opcodes.add_float.jm.T_add_float_4; + + +public class Test_add_float extends DxTestCase { + + /** + * @title Arguments = 2.7f, 3.14f + */ + public void testN1() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(5.84f, t.run(2.7f, 3.14f)); + } + + /** + * @title Arguments = 0, -3.14f + */ + public void testN2() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(-3.14f, t.run(0, -3.14f)); + } + + /** + * @title Arguments = -3.14f, -2.7f + */ + public void testN3() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(-5.84f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -3.14f, -2.7f + */ + public void testN4() { + T_add_float_3 t = new T_add_float_3(); + assertEquals(-5.84f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -314l, -270f + */ + public void testN5() { + T_add_float_4 t = new T_add_float_4(); + assertEquals(-584f, t.run(-314l, -270f)); + } + + + + /** + * @title Arguments = Float.MAX_VALUE, Float.NaN + */ + public void testB1() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(3.3028235E38f, 0.11E38f)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB2() { + T_add_float_1 t = new T_add_float_1(); + assertTrue(Float.isNaN(t.run(Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY))); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.POSITIVE_INFINITY + */ + public void testB3() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + Float.POSITIVE_INFINITY)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, -2.7f + */ + public void testB4() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + -2.7f)); + } + + /** + * @title Arguments = +0, -0f + */ + public void testB5() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(+0f, t.run(+0f, -0f)); + } + + /** + * @title Arguments = -0f, -0f + */ + public void testB6() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(-0f, t.run(-0f, -0f)); + } + + /** + * @title Arguments = -2.7f, 2.7f + */ + public void testB7() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(+0f, t.run(-2.7f, 2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.MAX_VALUE + */ + public void testB8() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.MAX_VALUE, + Float.MAX_VALUE)); + } + + /** + * @title Arguments = Float.MIN_VALUE, -1.4E-45f + */ + public void testB9() { + T_add_float_1 t = new T_add_float_1(); + assertEquals(0f, t.run(Float.MIN_VALUE, -1.4E-45f)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_1.java b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_1.java new file mode 100644 index 00000000..0e63bcb1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_float.jm; + +public class T_add_float_1 { + + public float run(float a, float b) { + return a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_3.java b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_3.java new file mode 100644 index 00000000..56938f1c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_float.jm; + +public class T_add_float_3 { + + public float run(float a, double b) { + return a+(float)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_4.java b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_4.java new file mode 100644 index 00000000..f2477752 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_float/jm/T_add_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_float.jm; + +public class T_add_float_4 { + + public float run(long a, float b) { + return (float)a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/Test_add_int.java b/jack-tests/tests/com/android/jack/opcodes/add_int/Test_add_int.java new file mode 100644 index 00000000..0969c144 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/Test_add_int.java @@ -0,0 +1,224 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.add_int.jm.T_add_int_1; +import com.android.jack.opcodes.add_int.jm.T_add_int_3; +import com.android.jack.opcodes.add_int.jm.T_add_int_4; +import com.android.jack.opcodes.add_int.jm.T_add_int_5; +import com.android.jack.opcodes.add_int.jm.T_add_int_6; +import com.android.jack.opcodes.add_int.jm.T_add_int_7; +import com.android.jack.opcodes.add_int.jm.T_add_int_8; +import com.android.jack.opcodes.add_int.jm.T_add_int_9; +import com.android.jack.opcodes.add_int.jm.T_add_int_10; + + +public class Test_add_int extends DxTestCase { + + /** + * @title Arguments = 8, 4 + */ + public void testN1() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(12, t.run(8, 4)); + } + + /** + * @title Arguments = 0, 255 + */ + public void testN2() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(255, t.run(0, 255)); + } + + /** + * @title Arguments = 0, -65536 + */ + public void testN3() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(-65536, t.run(0, -65536)); + } + + /** + * @title Arguments = 0, -2147483647 + */ + public void testN4() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(-2147483647, t.run(0, -2147483647)); + } + + /** + * @title Arguments = 0x7ffffffe, 2 + */ + public void testN5() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(-2147483648, t.run(0x7ffffffe, 2)); + } + + /** + * @title Arguments = -1, 1 + */ + public void testN6() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(0, t.run(-1, 1)); + } + + /** + * @title Arguments = -1, 1 + */ + public void testN7() { + T_add_int_3 t = new T_add_int_3(); + assertEquals(0, t.run(-1, 1)); + } + + /** + * @title Arguments = -1, 1 + */ + public void testN8() { + T_add_int_4 t = new T_add_int_4(); + assertEquals(0, t.run(-1, 1)); + } + + /** + * @title Arguments = 0, Integer.MAX_VALUE + */ + public void testB1() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(0, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB2() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(-2, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, 1 + */ + public void testB3() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, 1 + */ + public void testB4() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(-2147483647, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(0, t.run(0, 0)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB6() { + T_add_int_1 t = new T_add_int_1(); + assertEquals(0, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Increment by 1 + */ + public void testN1Inc() { + T_add_int_5 t = new T_add_int_5(); + assertEquals(5, t.run(4)); + } + + /** + * @title Increment by -1 + */ + public void testN2Inc() { + T_add_int_6 t = new T_add_int_6(); + assertEquals(3, t.run(4)); + } + + /** + * @title Increment by 63 + */ + public void testN3Inc() { + T_add_int_7 t = new T_add_int_7(); + assertEquals(67, t.run(4)); + } + + /** + * @title Increment by 0 + */ + public void testB1Inc() { + T_add_int_8 t = new T_add_int_8(); + assertEquals(Integer.MAX_VALUE, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Increment by 0 + */ + public void testB2Inc() { + T_add_int_8 t = new T_add_int_8(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MIN_VALUE)); + } + + /** + * @title Increment by 127 + */ + public void testB3Inc() { + T_add_int_9 t = new T_add_int_9(); + assertEquals(128, t.run(1)); + } + + /** + * @title Increment by 127 + */ + public void testB4Inc() { + T_add_int_9 t = new T_add_int_9(); + assertEquals(126, t.run(-1)); + } + + /** + * @title Increment by 127 + */ + public void testB5Inc() { + T_add_int_9 t = new T_add_int_9(); + assertEquals(-2147483521, t.run(Integer.MIN_VALUE)); + } + + /** + * @title Increment by -128 + */ + public void testB6Inc() { + T_add_int_10 t = new T_add_int_10(); + assertEquals(-127, t.run(1)); + } + + /** + * @title Increment by -128 + */ + public void testB7Inc() { + T_add_int_10 t = new T_add_int_10(); + assertEquals(-128, t.run(0)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_1.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_1.java new file mode 100644 index 00000000..ce53188e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_1 { + + public int run(int a, int b) { + return a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_10.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_10.java new file mode 100644 index 00000000..e0a87846 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_10.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_10 { + + public int run(int a) { + a += -128; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_3.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_3.java new file mode 100644 index 00000000..5d73f0d2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_3 { + + public int run(int a, double b) { + return a+(int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_4.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_4.java new file mode 100644 index 00000000..3b8e09cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_4 { + + public int run(long a, int b) { + return (int)a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_5.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_5.java new file mode 100644 index 00000000..8797a9fa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_5 { + + public int run(int a) { + return ++a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_6.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_6.java new file mode 100644 index 00000000..9387bcc9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_6 { + + public int run(int a) { + return --a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_7.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_7.java new file mode 100644 index 00000000..e9d721bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_7.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_7 { + + public int run(int a) { + a += 63; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_8.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_8.java new file mode 100644 index 00000000..e183d67c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_8.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_8 { + + public int run(int a) { + a += 0; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_9.java b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_9.java new file mode 100644 index 00000000..85225d86 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_int/jm/T_add_int_9.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_int.jm; + +public class T_add_int_9 { + + public int run(int a) { + a += 127; + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_long/Test_add_long.java b/jack-tests/tests/com/android/jack/opcodes/add_long/Test_add_long.java new file mode 100644 index 00000000..b9a603a3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_long/Test_add_long.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.add_long.jm.T_add_long_1; +import com.android.jack.opcodes.add_long.jm.T_add_long_3; +import com.android.jack.opcodes.add_long.jm.T_add_long_4; +import com.android.jack.opcodes.add_long.jm.T_add_long_5; + + +public class Test_add_long extends DxTestCase { + + /** + * @title Arguments = 12345678l, 87654321l + */ + public void testN1() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(99999999l, t.run(12345678l, 87654321l)); + } + + /** + * @title Arguments = 0l, 87654321l + */ + public void testN2() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(87654321l, t.run(0l, 87654321l)); + } + + /** + * @title Arguments = -12345678l, 0l + */ + public void testN3() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-12345678l, t.run(-12345678l, 0l)); + } + + /** + * @title Arguments: 0 + Long.MAX_VALUE + */ + public void testB1() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(9223372036854775807L, t.run(0l, Long.MAX_VALUE)); + } + + /** + * @title Arguments: 0 + Long.MIN_VALUE + */ + public void testB2() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-9223372036854775808L, t.run(0l, Long.MIN_VALUE)); + } + + /** + * @title Arguments: 0 + 0 + */ + public void testB3() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(0l, t.run(0l, 0l)); + } + + /** + * @title Arguments: Long.MAX_VALUE + Long.MAX_VALUE + */ + public void testB4() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-2, t.run(Long.MAX_VALUE, Long.MAX_VALUE)); + } + + /** + * @title Arguments: Long.MAX_VALUE + Long.MIN_VALUE + */ + public void testB5() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-1l, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); + } + + /** + * @title Arguments: Long.MIN_VALUE + Long.MIN_VALUE + */ + public void testB6() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(0l, t.run(Long.MIN_VALUE, Long.MIN_VALUE)); + } + + /** + * @title Arguments: Long.MIN_VALUE + 1 + */ + public void testB7() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-9223372036854775807l, t.run(Long.MIN_VALUE, 1l)); + } + + /** + * @title Arguments: Long.MAX_VALUE + 1 + */ + public void testB8() { + T_add_long_1 t = new T_add_long_1(); + assertEquals(-9223372036854775808l, t.run(Long.MAX_VALUE, 1l)); + } + + /** + * @title Arguments: Long.MAX_VALUE + 1 + */ + public void testB9() { + T_add_long_3 t = new T_add_long_3(); + assertEquals(9223372036854775807l, t.run(Long.MAX_VALUE, 1l)); + } + + + /** + * @title Arguments: Long.MAX_VALUE + 1 + */ + public void testB10() { + T_add_long_4 t = new T_add_long_4(); + assertEquals(-9223372036854775808l, t.run(Long.MAX_VALUE, 1)); + } + + + /** + * @title Arguments: Long.MAX_VALUE + 1 + */ + public void testB11() { + T_add_long_5 t = new T_add_long_5(); + assertEquals(9223372036854775807l, t.run(Long.MAX_VALUE, 1l)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_1.java b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_1.java new file mode 100644 index 00000000..7f323394 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_long.jm; + +public class T_add_long_1 { + + public long run(long a, long b) { + return a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_3.java b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_3.java new file mode 100644 index 00000000..32717aa8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_long.jm; + +public class T_add_long_3 { + + public long run(long a, double b) { + return (long)(a+b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_4.java b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_4.java new file mode 100644 index 00000000..25a8f9fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_long.jm; + +public class T_add_long_4 { + + public long run(long a, int b) { + return a+b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_5.java b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_5.java new file mode 100644 index 00000000..cfbfcbcb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/add_long/jm/T_add_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.add_long.jm; + +public class T_add_long_5 { + + public long run(long a, float b) { + return (long)(a+b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/Test_aget.java b/jack-tests/tests/com/android/jack/opcodes/aget/Test_aget.java new file mode 100644 index 00000000..4d58b771 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/Test_aget.java @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget.jm.T_aget_1; +import com.android.jack.opcodes.aget.jm.T_aget_2; +import com.android.jack.opcodes.aget.jm.T_aget_3; +import com.android.jack.opcodes.aget.jm.T_aget_4; +import com.android.jack.opcodes.aget.jm.T_aget_5; +import com.android.jack.opcodes.aget.jm.T_aget_6; + + +public class Test_aget extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aget_1 t = new T_aget_1(); + float[] arr = new float[2]; + arr[1] = 3.1415f; + assertEquals(3.1415f, t.run(arr, 1)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aget_1 t = new T_aget_1(); + float[] arr = new float[2]; + arr[0] = 3.1415f; + assertEquals(3.1415f, t.run(arr, 0)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN3() { + T_aget_2 t = new T_aget_2(); + float[] arr = new float[2]; + arr[0] = 3.1415f; + assertEquals(3.1415f, t.run(arr, 0)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN4() { + T_aget_3 t = new T_aget_3(); + float[] arr = new float[2]; + arr[0] = 3.1415f; + assertEquals(3.1415f, t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aget_1 t = new T_aget_1(); + float[] arr = new float[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aget_1 t = new T_aget_1(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aget_1 t = new T_aget_1(); + float[] arr = new float[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN1Int() { + T_aget_4 t = new T_aget_4(); + int[] arr = new int[2]; + arr[1] = 100000000; + assertEquals(100000000, t.run(arr, 1)); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN2Int() { + T_aget_4 t = new T_aget_4(); + int[] arr = new int[2]; + arr[0] = 100000000; + assertEquals(100000000, t.run(arr, 0)); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN3Int() { + T_aget_5 t = new T_aget_5(); + int[] arr = new int[2]; + arr[0] = 100000000; + assertEquals(100000000, t.run(arr, 0)); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN4Int() { + T_aget_6 t = new T_aget_6(); + int[] arr = new int[2]; + arr[0] = 100000000; + assertEquals(100000000, t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1Int() { + T_aget_4 t = new T_aget_4(); + int[] arr = new int[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2Int() { + T_aget_4 t = new T_aget_4(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3Int() { + T_aget_4 t = new T_aget_4(); + int[] arr = new int[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_1.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_1.java new file mode 100644 index 00000000..b928a6fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_1 { + public float run(float[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_2.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_2.java new file mode 100644 index 00000000..757d32cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_2.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_2 { + + public float run(float[] arr, double idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_3.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_3.java new file mode 100644 index 00000000..57859d2f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_3.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_3 { + + public float run(float[] arr, long idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_4.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_4.java new file mode 100644 index 00000000..bfbed18f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_4.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_4 { + public int run(int[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_5.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_5.java new file mode 100644 index 00000000..ab5a1c07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_5.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_5 { + + public int run(int[] arr, double idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_6.java b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_6.java new file mode 100644 index 00000000..1327e2e8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget/jm/T_aget_6.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget.jm; + +public class T_aget_6 { + + public int run(int[] arr, long idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_byte/Test_aget_byte.java b/jack-tests/tests/com/android/jack/opcodes/aget_byte/Test_aget_byte.java new file mode 100644 index 00000000..ea254c75 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_byte/Test_aget_byte.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_byte; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget_byte.jm.T_aget_byte_1; + + +public class Test_aget_byte extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aget_byte_1 t = new T_aget_byte_1(); + byte[] arr = new byte[2]; + arr[1] = 100; + assertEquals(100, t.run(arr, 1)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aget_byte_1 t = new T_aget_byte_1(); + byte[] arr = new byte[2]; + arr[0] = 100; + assertEquals(100, t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aget_byte_1 t = new T_aget_byte_1(); + byte[] arr = new byte[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aget_byte_1 t = new T_aget_byte_1(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aget_byte_1 t = new T_aget_byte_1(); + byte[] arr = new byte[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_byte/jm/T_aget_byte_1.java b/jack-tests/tests/com/android/jack/opcodes/aget_byte/jm/T_aget_byte_1.java new file mode 100644 index 00000000..d586717e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_byte/jm/T_aget_byte_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_byte.jm; + +public class T_aget_byte_1 { + public byte run(byte[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_char/Test_aget_char.java b/jack-tests/tests/com/android/jack/opcodes/aget_char/Test_aget_char.java new file mode 100644 index 00000000..1f7e1b33 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_char/Test_aget_char.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_char; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget_char.jm.T_aget_char_1; + + +public class Test_aget_char extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aget_char_1 t = new T_aget_char_1(); + char[] arr = new char[2]; + arr[1] = 'g'; + assertEquals('g', t.run(arr, 1)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aget_char_1 t = new T_aget_char_1(); + char[] arr = new char[2]; + arr[0] = 'g'; + assertEquals('g', t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aget_char_1 t = new T_aget_char_1(); + char[] arr = new char[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aget_char_1 t = new T_aget_char_1(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aget_char_1 t = new T_aget_char_1(); + char[] arr = new char[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_char/jm/T_aget_char_1.java b/jack-tests/tests/com/android/jack/opcodes/aget_char/jm/T_aget_char_1.java new file mode 100644 index 00000000..3ab27fd1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_char/jm/T_aget_char_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_char.jm; + +public class T_aget_char_1 { + public char run(char[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/Test_aget_object.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/Test_aget_object.java new file mode 100644 index 00000000..97838f08 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/Test_aget_object.java @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_1; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_4; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_5; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_6; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_7; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_8; +import com.android.jack.opcodes.aget_object.jm.T_aget_object_9; + + +public class Test_aget_object extends DxTestCase { + + /** + * @title Normal test. Trying different indexes + */ + public void testN1() { + T_aget_object_1 t = new T_aget_object_1(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(arr, 0)); + } + + /** + * @title Normal test. Trying different indexes + */ + public void testN2() { + T_aget_object_1 t = new T_aget_object_1(); + String[] arr = new String[] {"a", "b"}; + assertEquals("b", t.run(arr, 1)); + } + + /** + * @title ArrayIndexOutOfBoundsException expected + */ + public void testE1() { + T_aget_object_1 t = new T_aget_object_1(); + String[] arr = new String[] {"a", "b"}; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aioobe) { + // expected + } + } + + /** + * @title Negative index. ArrayIndexOutOfBoundsException expected + */ + public void testE2() { + T_aget_object_1 t = new T_aget_object_1(); + String[] arr = new String[] {"a", "b"}; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aioobe) { + // expected + } + } + + /** + * @title NullPointerException expected + */ + public void testE3() { + T_aget_object_1 t = new T_aget_object_1(); + String[] arr = null; + try { + t.run(arr, 0); + fail("expected NullPointerException"); + } catch (NullPointerException npe) { + // expected + } + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - array, double + */ + public void testN3() { + T_aget_object_4 t = new T_aget_object_4(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(arr, 0)); + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - array, long + */ + public void testN4() { + T_aget_object_5 t = new T_aget_object_5(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(arr, 0)); + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - Object, int + */ + public void testN5() { + T_aget_object_6 t = new T_aget_object_6(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(null, arr, 0)); + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - float[], int + */ + public void testN6() { + T_aget_object_7 t = new T_aget_object_7(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(null, arr, 0)); + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - long[], int + */ + public void testN7() { + T_aget_object_8 t = new T_aget_object_8(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(null, arr, 0)); + } + + /** + * @constraint 4.8.2.1 + * @title types of arguments - array, reference + */ + public void testN8() { + T_aget_object_9 t = new T_aget_object_9(); + String[] arr = new String[] {"a", "b"}; + assertEquals("a", t.run(arr, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_1.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_1.java new file mode 100644 index 00000000..e6427fb8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_1 { + + public String run(String [] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_4.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_4.java new file mode 100644 index 00000000..ac6f1604 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_4 { + + public String run(String [] arr, double idx) { + return arr[(int)idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_5.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_5.java new file mode 100644 index 00000000..d5f1a1de --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_5 { + + public String run(String [] arr, long idx) { + return arr[(int)idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_6.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_6.java new file mode 100644 index 00000000..fd3c8281 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_6 { + + public String run(Object a, String[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_7.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_7.java new file mode 100644 index 00000000..67fc3456 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_7.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_7 { + + public String run(float[] a, String[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_8.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_8.java new file mode 100644 index 00000000..d93fa85a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_8.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_8 { + + public String run(long[] a, String[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_9.java b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_9.java new file mode 100644 index 00000000..caa1e712 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_9.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_object.jm; + +public class T_aget_object_9 { + + public String run(String [] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_short/Test_aget_short.java b/jack-tests/tests/com/android/jack/opcodes/aget_short/Test_aget_short.java new file mode 100644 index 00000000..f65533ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_short/Test_aget_short.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_short; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget_short.jm.T_aget_short_1; +import com.android.jack.opcodes.aget_short.jm.T_aget_short_4; +import com.android.jack.opcodes.aget_short.jm.T_aget_short_5; + + +public class Test_aget_short extends DxTestCase { + + /** + * @title normal test. trying different indexes + */ + public void testN1() { + T_aget_short_1 t = new T_aget_short_1(); + short[] arr = new short[2]; + arr[1] = 10000; + assertEquals(10000, t.run(arr, 1)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN2() { + T_aget_short_1 t = new T_aget_short_1(); + short[] arr = new short[2]; + arr[0] = 10000; + assertEquals(10000, t.run(arr, 0)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN3() { + T_aget_short_4 t = new T_aget_short_4(); + short[] arr = new short[2]; + arr[0] = 10000; + assertEquals(10000, t.run(arr, 0)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN4() { + T_aget_short_5 t = new T_aget_short_5(); + short[] arr = new short[2]; + arr[0] = 10000; + assertEquals(10000, t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aget_short_1 t = new T_aget_short_1(); + short[] arr = new short[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aget_short_1 t = new T_aget_short_1(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aget_short_1 t = new T_aget_short_1(); + short[] arr = new short[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_1.java b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_1.java new file mode 100644 index 00000000..e63e17ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_short.jm; + +public class T_aget_short_1 { + public short run(short[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_4.java b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_4.java new file mode 100644 index 00000000..f2d91487 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_short.jm; + +public class T_aget_short_4 { + + public short run(short[] arr, double idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_5.java b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_5.java new file mode 100644 index 00000000..3e6d48df --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_5.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_short.jm; + +public class T_aget_short_5 { + + public short run(short[] arr, long idx) { + return arr[(int)idx]; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/Test_aget_wide.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/Test_aget_wide.java new file mode 100644 index 00000000..1a8f89b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/Test_aget_wide.java @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aget_wide.jm.T_aget_wide_1; +import com.android.jack.opcodes.aget_wide.jm.T_aget_wide_2; +import com.android.jack.opcodes.aget_wide.jm.T_aget_wide_3; +import com.android.jack.opcodes.aget_wide.jm.T_aget_wide_4; +import com.android.jack.opcodes.aget_wide.jm.T_aget_wide_5; + + +public class Test_aget_wide extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aget_wide_1 t = new T_aget_wide_1(); + double[] arr = new double[2]; + arr[1] = 3.1415d; + assertEquals(3.1415d, t.run(arr, 1)); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aget_wide_1 t = new T_aget_wide_1(); + double[] arr = new double[2]; + arr[0] = 3.1415d; + assertEquals(3.1415d, t.run(arr, 0)); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aget_wide_1 t = new T_aget_wide_1(); + double[] arr = new double[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aget_wide_1 t = new T_aget_wide_1(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aget_wide_1 t = new T_aget_wide_1(); + double[] arr = new double[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title normal test. trying different indexes + */ + public void testN1Long() { + T_aget_wide_2 t = new T_aget_wide_2(); + long[] arr = new long[2]; + arr[1] = 1000000000000000000l; + assertEquals(1000000000000000000l, t.run(arr, 1)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN2Long() { + T_aget_wide_2 t = new T_aget_wide_2(); + long[] arr = new long[2]; + arr[0] = 1000000000000000000l; + assertEquals(1000000000000000000l, t.run(arr, 0)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN3Long() { + T_aget_wide_3 t = new T_aget_wide_3(); + long[] arr = new long[2]; + arr[0] = 1000000000000000000l; + assertEquals(1000000000000000000l, t.run(arr, 0)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN4Long() { + T_aget_wide_4 t = new T_aget_wide_4(); + long[] arr = new long[2]; + arr[0] = 1000000000000000000l; + assertEquals(1000000000000000000l, t.run(arr, 0)); + } + + /** + * @title normal test. trying different indexes + */ + public void testN5Long() { + T_aget_wide_5 t = new T_aget_wide_5(); + long[] arr = new long[2]; + arr[0] = 1000000000000000000l; + assertEquals(1000000000000000000l, t.run(arr, 0)); + } + + /** + * @title Exception - ArrayIndexOutOfBoundsException + */ + public void testE1Long() { + T_aget_wide_2 t = new T_aget_wide_2(); + long[] arr = new long[2]; + try { + t.run(arr, 2); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title Exception - NullPointerException + */ + public void testE2Long() { + T_aget_wide_2 t = new T_aget_wide_2(); + try { + t.run(null, 2); + fail("expected NullPointerException"); + } catch (NullPointerException np) { + // expected + } + } + + /** + * @title Exception - ArrayIndexOutOfBoundsException + */ + public void testE3Long() { + T_aget_wide_2 t = new T_aget_wide_2(); + long[] arr = new long[2]; + try { + t.run(arr, -1); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_1.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_1.java new file mode 100644 index 00000000..2dc1b73a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide.jm; + +public class T_aget_wide_1 { + public double run(double[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_2.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_2.java new file mode 100644 index 00000000..251cfe22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide.jm; + +public class T_aget_wide_2 { + + public long run(long[] arr, int idx) { + return arr[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_3.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_3.java new file mode 100644 index 00000000..acd8aa64 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide.jm; + +public class T_aget_wide_3 { + + public long run(long[] arr, double idx) { + return arr[(int)idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_4.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_4.java new file mode 100644 index 00000000..db9344a2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide.jm; + +public class T_aget_wide_4 { + + public long run(long[] arr, float idx) { + return arr[(int)idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_5.java b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_5.java new file mode 100644 index 00000000..357ee2a7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aget_wide.jm; + +public class T_aget_wide_5 { + + public long run(long[] arr, long idx) { + return arr[(int)idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_int/Test_and_int.java b/jack-tests/tests/com/android/jack/opcodes/and_int/Test_and_int.java new file mode 100644 index 00000000..eaeb238d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_int/Test_and_int.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.and_int.jm.T_and_int_1; +import com.android.jack.opcodes.and_int.jm.T_and_int_3; +import com.android.jack.opcodes.and_int.jm.T_and_int_4; + + +public class Test_and_int extends DxTestCase { + + /** + * @title Arguments = 15, 8 + */ + public void testN1() { + T_and_int_1 t = new T_and_int_1(); + assertEquals(8, t.run(15, 8)); + } + + /** + * @title Arguments = 0xfffffff8, 0xfffffff1 + */ + public void testN2() { + T_and_int_1 t = new T_and_int_1(); + assertEquals(0xfffffff0, t.run(0xfffffff8, 0xfffffff1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN3() { + T_and_int_1 t = new T_and_int_1(); + assertEquals(0xcafe, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN4() { + T_and_int_3 t = new T_and_int_3(); + assertEquals(0xcafe, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN5() { + T_and_int_4 t = new T_and_int_4(); + assertEquals(0xcafe, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_and_int_1 t = new T_and_int_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & Integer.MIN_VALUE + */ + public void testB2() { + T_and_int_1 t = new T_and_int_1(); + assertEquals(0, t.run(Integer.MAX_VALUE, Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_1.java b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_1.java new file mode 100644 index 00000000..5dc5bf04 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_int.jm; + +public class T_and_int_1 { + + public int run(int a, int b) { + return a & b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_3.java b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_3.java new file mode 100644 index 00000000..63ca6327 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_int.jm; + +public class T_and_int_3 { + + public int run(double a, int b) { + return (int)a & b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_4.java b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_4.java new file mode 100644 index 00000000..b487ae07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_int/jm/T_and_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_int.jm; + +public class T_and_int_4 { + + public int run(int a, long b) { + return a & (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_long/Test_and_long.java b/jack-tests/tests/com/android/jack/opcodes/and_long/Test_and_long.java new file mode 100644 index 00000000..a5df9b18 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_long/Test_and_long.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.and_long.jm.T_and_long_1; +import com.android.jack.opcodes.and_long.jm.T_and_long_3; +import com.android.jack.opcodes.and_long.jm.T_and_long_4; + + +public class Test_and_long extends DxTestCase { + + /** + * @title Arguments = 0xfffffff8aal, 0xfffffff1aal + */ + public void testN1() { + T_and_long_1 t = new T_and_long_1(); + assertEquals(0xfffffff0aal, t.run(0xfffffff8aal, 0xfffffff1aal)); + } + + /** + * @title Arguments = 987654321, 123456789 + */ + public void testN2() { + T_and_long_1 t = new T_and_long_1(); + assertEquals(39471121, t.run(987654321, 123456789)); + } + + /** + * @title Arguments = 0xABCDEF & -1 + */ + public void testN3() { + T_and_long_1 t = new T_and_long_1(); + assertEquals(0xABCDEF, t.run(0xABCDEF, -1)); + } + + /** + * @title Arguments = 0xABCDEF & -1 + */ + public void testN4() { + T_and_long_3 t = new T_and_long_3(); + assertEquals(0xABCDEF, t.run(0xABCDEF, -1)); + } + + /** + * @title Arguments = 0xABCDEF & -1 + */ + public void testN5() { + T_and_long_4 t = new T_and_long_4(); + assertEquals(0xABCDEF, t.run(0xABCDEF, -1)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_and_long_1 t = new T_and_long_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = Long.MAX_VALUE & Long.MIN_VALUE + */ + public void testB2() { + T_and_long_1 t = new T_and_long_1(); + assertEquals(0, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_1.java b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_1.java new file mode 100644 index 00000000..14ed9be7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_long.jm; + +public class T_and_long_1 { + + public long run(long a, long b) { + return a & b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_3.java b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_3.java new file mode 100644 index 00000000..7ddbce4d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_long.jm; + +public class T_and_long_3 { + + public long run(float a, long b) { + return (long)a & b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_4.java b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_4.java new file mode 100644 index 00000000..207d7faa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/and_long/jm/T_and_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.and_long.jm; + +public class T_and_long_4 { + + public long run(int a, long b) { + return a & b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/Test_aput.java b/jack-tests/tests/com/android/jack/opcodes/aput/Test_aput.java new file mode 100644 index 00000000..cbe76408 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/Test_aput.java @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput.jm.T_aput_1; +import com.android.jack.opcodes.aput.jm.T_aput_2; +import com.android.jack.opcodes.aput.jm.T_aput_3; +import com.android.jack.opcodes.aput.jm.T_aput_4; +import com.android.jack.opcodes.aput.jm.T_aput_5; +import com.android.jack.opcodes.aput.jm.T_aput_6; + + +public class Test_aput extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aput_1 t = new T_aput_1(); + float[] arr = new float[2]; + t.run(arr, 1, 2.7f); + assertEquals(2.7f, arr[1]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aput_1 t = new T_aput_1(); + float[] arr = new float[2]; + t.run(arr, 0, 2.7f); + assertEquals(2.7f, arr[0]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN3() { + T_aput_2 t = new T_aput_2(); + float[] arr = new float[2]; + t.run(arr, 0, 2.7f); + assertEquals(2.7f, arr[0]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN4() { + T_aput_3 t = new T_aput_3(); + float[] arr = new float[2]; + t.run(arr, 0, 2.7f); + assertEquals(2.7f, arr[0]); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aput_1 t = new T_aput_1(); + float[] arr = new float[2]; + try { + t.run(arr, 2, 2.7f); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aput_1 t = new T_aput_1(); + try { + t.run(null, 2, 2.7f); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aput_1 t = new T_aput_1(); + float[] arr = new float[2]; + try { + t.run(arr, -1, 2.7f); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN1Int() { + T_aput_4 t = new T_aput_4(); + int[] arr = new int[2]; + t.run(arr, 1, 100000000); + assertEquals(100000000, arr[1]); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN2Int() { + T_aput_4 t = new T_aput_4(); + int[] arr = new int[2]; + t.run(arr, 0, 100000000); + assertEquals(100000000, arr[0]); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN3Int() { + T_aput_5 t = new T_aput_5(); + int[] arr = new int[2]; + t.run(arr, 0, 100000000); + assertEquals(100000000, arr[0]); + } + + /** + * @title Normal test/. Trying different indexes + */ + public void testN4Int() { + T_aput_6 t = new T_aput_6(); + int[] arr = new int[2]; + t.run(arr, 0, 100000000); + assertEquals(100000000, arr[0]); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1Int() { + T_aput_4 t = new T_aput_4(); + int[] arr = new int[2]; + try { + t.run(arr, 2, 100000000); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2Int() { + T_aput_4 t = new T_aput_4(); + try { + t.run(null, 2, 100000000); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3Int() { + T_aput_4 t = new T_aput_4(); + int[] arr = new int[2]; + try { + t.run(arr, -1, 100000000); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_1.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_1.java new file mode 100644 index 00000000..ee5e5075 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_1 { + public void run(float[] arr, int idx, float value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_2.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_2.java new file mode 100644 index 00000000..86f01266 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_2 { + + public void run(float[] arr, double idx, float value) { + arr[(int)idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_3.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_3.java new file mode 100644 index 00000000..009ef92f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_3 { + + public void run(float[] arr, int idx, float value) { + arr[idx] = (float)value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_4.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_4.java new file mode 100644 index 00000000..9b10d936 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_4.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_4 { + public void run(int[] arr, int idx, int value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_5.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_5.java new file mode 100644 index 00000000..0d24828a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_5 { + + public void run(int[] arr, double idx, int value) { + arr[(int)idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_6.java b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_6.java new file mode 100644 index 00000000..9e2276f1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput/jm/T_aput_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput.jm; + +public class T_aput_6 { + + public void run(int[] arr, int idx, long value) { + arr[idx] = (int)value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_byte/Test_aput_byte.java b/jack-tests/tests/com/android/jack/opcodes/aput_byte/Test_aput_byte.java new file mode 100644 index 00000000..5cd64e10 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_byte/Test_aput_byte.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_byte; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput_byte.jm.T_aput_byte_1; + + +public class Test_aput_byte extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aput_byte_1 t = new T_aput_byte_1(); + byte[] arr = new byte[2]; + t.run(arr, 1, (byte) 100); + assertEquals(100, arr[1]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aput_byte_1 t = new T_aput_byte_1(); + byte[] arr = new byte[2]; + t.run(arr, 0, (byte) 100); + assertEquals(100, arr[0]); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aput_byte_1 t = new T_aput_byte_1(); + byte[] arr = new byte[2]; + try { + t.run(arr, 2, (byte) 100); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aput_byte_1 t = new T_aput_byte_1(); + try { + t.run(null, 2, (byte) 100); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aput_byte_1 t = new T_aput_byte_1(); + byte[] arr = new byte[2]; + try { + t.run(arr, -1, (byte) 100); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_byte/jm/T_aput_byte_1.java b/jack-tests/tests/com/android/jack/opcodes/aput_byte/jm/T_aput_byte_1.java new file mode 100644 index 00000000..729d7230 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_byte/jm/T_aput_byte_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_byte.jm; + +public class T_aput_byte_1 { + public void run(byte[] arr, int idx, byte value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_char/Test_aput_char.java b/jack-tests/tests/com/android/jack/opcodes/aput_char/Test_aput_char.java new file mode 100644 index 00000000..c8dd3bbe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_char/Test_aput_char.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_char; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput_char.jm.T_aput_char_1; +import com.android.jack.opcodes.aput_char.jm.T_aput_char_4; +import com.android.jack.opcodes.aput_char.jm.T_aput_char_5; + + +public class Test_aput_char extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aput_char_1 t = new T_aput_char_1(); + char[] arr = new char[2]; + t.run(arr, 1, 'g'); + assertEquals('g', arr[1]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aput_char_1 t = new T_aput_char_1(); + char[] arr = new char[2]; + t.run(arr, 0, 'g'); + assertEquals('g', arr[0]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN3() { + T_aput_char_4 t = new T_aput_char_4(); + char[] arr = new char[2]; + t.run(arr, 1, 'g'); + assertEquals('g', arr[1]); + } + + + /** + * @title normal test. Trying different indexes + */ + public void testN4() { + T_aput_char_5 t = new T_aput_char_5(); + char[] arr = new char[2]; + t.run(arr, 1, 'g'); + assertEquals('g', arr[1]); + } + + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aput_char_1 t = new T_aput_char_1(); + char[] arr = new char[2]; + try { + t.run(arr, 2, 'g'); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aput_char_1 t = new T_aput_char_1(); + try { + t.run(null, 2, 'g'); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aput_char_1 t = new T_aput_char_1(); + char[] arr = new char[2]; + try { + t.run(arr, -1, 'g'); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_1.java b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_1.java new file mode 100644 index 00000000..eb7caefb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_char.jm; + +public class T_aput_char_1 { + public void run(char[] arr, int idx, char value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_4.java b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_4.java new file mode 100644 index 00000000..7128b211 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_char.jm; + +public class T_aput_char_4 { + + public void run(char[] arr, double idx, char value) { + arr[(int)idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_5.java b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_5.java new file mode 100644 index 00000000..fdfb656c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_char.jm; + +public class T_aput_char_5 { + + public void run(char[] arr, int idx, long value) { + arr[idx] = (char)value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_object/Test_aput_object.java b/jack-tests/tests/com/android/jack/opcodes/aput_object/Test_aput_object.java new file mode 100644 index 00000000..a417d101 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_object/Test_aput_object.java @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_object; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput_object.jm.T_aput_object_1; +import com.android.jack.opcodes.aput_object.jm.T_aput_object_10; + + +public class Test_aput_object extends DxTestCase { + + /** + * @title Normal test. Trying different indexes + */ + public void testN1() { + T_aput_object_1 t = new T_aput_object_1(); + String[] arr = new String[2]; + t.run(arr, 0, "hello"); + assertEquals("hello", arr[0]); + } + + /** + * @title Normal test. Trying different indexes + */ + public void testN2() { + T_aput_object_1 t = new T_aput_object_1(); + String[] value = {"world", null, ""}; + String[] arr = new String[2]; + for (int i = 0; i < value.length; i++) { + t.run(arr, 1, value[i]); + assertEquals(value[i], arr[1]); + } + } + + /** + * @title Normal test. Trying different indexes + */ + public void testN3() { + T_aput_object_10 t = new T_aput_object_10(); + Integer[] arr = new Integer[2]; + Integer value = new Integer(12345); + t.run(arr, 0, value); + assertEquals(value, arr[0]); + } + + /** + * @title ArrayIndexOutOfBoundsException expected + */ + public void testE1() { + T_aput_object_1 t = new T_aput_object_1(); + String[] arr = new String[2]; + try { + t.run(arr, arr.length, "abc"); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE2() { + T_aput_object_1 t = new T_aput_object_1(); + String[] arr = new String[2]; + try { + t.run(arr, -1, "abc"); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE3() { + T_aput_object_1 t = new T_aput_object_1(); + String[] arr = null; + try { + t.run(arr, 0, "abc"); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_1.java b/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_1.java new file mode 100644 index 00000000..de0b456c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_object.jm; + +public class T_aput_object_1 { + + public void run(String[] arr, int idx, String value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_10.java b/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_10.java new file mode 100644 index 00000000..6ba1468d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_10.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_object.jm; + +public class T_aput_object_10 { + + public void run(Integer[] arr, int idx, Integer value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_short/Test_aput_short.java b/jack-tests/tests/com/android/jack/opcodes/aput_short/Test_aput_short.java new file mode 100644 index 00000000..1e640274 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_short/Test_aput_short.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_short; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput_short.jm.T_aput_short_1; +import com.android.jack.opcodes.aput_short.jm.T_aput_short_4; +import com.android.jack.opcodes.aput_short.jm.T_aput_short_5; + + +public class Test_aput_short extends DxTestCase { + + /** + * @title normal test. trying different indexes + */ + public void testN1() { + T_aput_short_1 t = new T_aput_short_1(); + short[] arr = new short[2]; + t.run(arr, 1, (short) 10000); + assertEquals(10000, arr[1]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN2() { + T_aput_short_1 t = new T_aput_short_1(); + short[] arr = new short[2]; + t.run(arr, 0, (short) 10000); + assertEquals(10000, arr[0]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN3() { + T_aput_short_4 t = new T_aput_short_4(); + short[] arr = new short[2]; + t.run(arr, 0, (short) 10000); + assertEquals(10000, arr[0]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN4() { + T_aput_short_5 t = new T_aput_short_5(); + short[] arr = new short[2]; + t.run(arr, 0, (short) 10000); + assertEquals(10000, arr[0]); + } + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aput_short_1 t = new T_aput_short_1(); + short[] arr = new short[2]; + try { + t.run(arr, 2, (short) 10000); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aput_short_1 t = new T_aput_short_1(); + try { + t.run(null, 2, (short) 10000); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aput_short_1 t = new T_aput_short_1(); + short[] arr = new short[2]; + try { + t.run(arr, -1, (short) 10000); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_1.java b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_1.java new file mode 100644 index 00000000..f8784fce --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_short.jm; + +public class T_aput_short_1 { + public void run(short[] arr, int idx, short value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_4.java b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_4.java new file mode 100644 index 00000000..7495433a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_short.jm; + +public class T_aput_short_4 { + + public void run(short[] arr, double idx, short value) { + arr[(int)idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_5.java b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_5.java new file mode 100644 index 00000000..dd9556a5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_short.jm; + +public class T_aput_short_5 { + + public void run(short[] arr, int idx, long value) { + arr[idx] = (short)value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_wide/Test_aput_wide.java b/jack-tests/tests/com/android/jack/opcodes/aput_wide/Test_aput_wide.java new file mode 100644 index 00000000..90d8f34a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_wide/Test_aput_wide.java @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_wide; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.aput_wide.jm.T_aput_wide_1; +import com.android.jack.opcodes.aput_wide.jm.T_aput_wide_2; +import com.android.jack.opcodes.aput_wide.jm.T_aput_wide_3; +import com.android.jack.opcodes.aput_wide.jm.T_aput_wide_4; + + +public class Test_aput_wide extends DxTestCase { + + /** + * @title normal test. Trying different indexes + */ + public void testN1() { + T_aput_wide_1 t = new T_aput_wide_1(); + double[] arr = new double[2]; + t.run(arr, 1, 2.7d); + assertEquals(2.7d, arr[1]); + } + + /** + * @title normal test. Trying different indexes + */ + public void testN2() { + T_aput_wide_1 t = new T_aput_wide_1(); + double[] arr = new double[2]; + t.run(arr, 0, 2.7d); + assertEquals(2.7d, arr[0]); + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE1() { + T_aput_wide_1 t = new T_aput_wide_1(); + double[] arr = new double[2]; + try { + t.run(arr, 2, 2.7d); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title expected NullPointerException + */ + public void testE2() { + T_aput_wide_1 t = new T_aput_wide_1(); + try { + t.run(null, 2, 2.7d); + fail("expected NullPointerException"); + } catch (NullPointerException aie) { + // expected + } + } + + /** + * @title expected ArrayIndexOutOfBoundsException + */ + public void testE3() { + T_aput_wide_1 t = new T_aput_wide_1(); + double[] arr = new double[2]; + try { + t.run(arr, -1, 2.7d); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title normal test. trying different indexes + */ + public void testN1Long() { + T_aput_wide_2 t = new T_aput_wide_2(); + long[] arr = new long[2]; + t.run(arr, 1, 100000000000l); + assertEquals(100000000000l, arr[1]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN2Long() { + T_aput_wide_2 t = new T_aput_wide_2(); + long[] arr = new long[2]; + t.run(arr, 0, 100000000000l); + assertEquals(100000000000l, arr[0]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN3Long() { + T_aput_wide_3 t = new T_aput_wide_3(); + long[] arr = new long[2]; + t.run(arr, 0, 100000000000l); + assertEquals(100000000000l, arr[0]); + } + + /** + * @title normal test. trying different indexes + */ + public void testN4Long() { + T_aput_wide_4 t = new T_aput_wide_4(); + long[] arr = new long[2]; + t.run(arr, 0, 1000); + assertEquals(1000, arr[0]); + } + /** + * @title Exception - ArrayIndexOutOfBoundsException + */ + public void testE1Long() { + T_aput_wide_2 t = new T_aput_wide_2(); + long[] arr = new long[2]; + try { + t.run(arr, 2, 100000000000l); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } + + /** + * @title Exception - NullPointerException + */ + public void testE2Long() { + T_aput_wide_2 t = new T_aput_wide_2(); + try { + t.run(null, 1, 100000000000l); + fail("expected NullPointerException"); + } catch (NullPointerException np) { + // expected + } + } + + /** + * @title Exception - ArrayIndexOutOfBoundsException + */ + public void testE3Long() { + T_aput_wide_2 t = new T_aput_wide_2(); + long[] arr = new long[2]; + try { + t.run(arr, -1, 100000000000l); + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException aie) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_1.java b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_1.java new file mode 100644 index 00000000..7fc2f3e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_1.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_wide.jm; + +public class T_aput_wide_1 { + public void run(double[] arr, int idx, double value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_2.java b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_2.java new file mode 100644 index 00000000..4f631379 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_wide.jm; + +public class T_aput_wide_2 { + + public void run(long[] arr, int idx, long value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_3.java b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_3.java new file mode 100644 index 00000000..4e372d5e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_wide.jm; + +public class T_aput_wide_3 { + + public void run(long[] arr, double idx, long value) { + arr[(int)idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_4.java b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_4.java new file mode 100644 index 00000000..0e50f6fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.aput_wide.jm; + +public class T_aput_wide_4 { + + public void run(long[] arr, int idx, int value) { + arr[idx] = value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/array_length/Test_array_length.java b/jack-tests/tests/com/android/jack/opcodes/array_length/Test_array_length.java new file mode 100644 index 00000000..79540dc8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/array_length/Test_array_length.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.array_length; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.array_length.jm.T_array_length_1; +import com.android.jack.opcodes.array_length.jm.T_array_length_2; + + +public class Test_array_length extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_array_length_1 t = new T_array_length_1(); + String[] a = new String[5]; + assertEquals(5, t.run(a)); + } + + /** + * @title NullPointerException expected + */ + public void testNPE1() { + T_array_length_1 t = new T_array_length_1(); + try { + t.run(null); + fail("NPE expected"); + } catch (NullPointerException npe) { + // expected + } + } + + /** + * @title NullPointerException expected + */ + public void testNPE2() { + T_array_length_2 t = new T_array_length_2(); + try { + t.run(); + fail("NPE expected"); + } catch (NullPointerException npe) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_1.java b/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_1.java new file mode 100644 index 00000000..7632d157 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.array_length.jm; + +public class T_array_length_1 { + + public int run(Object[] arr) { + return arr.length; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_2.java b/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_2.java new file mode 100644 index 00000000..a029ac02 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/array_length/jm/T_array_length_2.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.array_length.jm; + +public class T_array_length_2 { + + public int run() { + byte[] ba = null; + return ba.length; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/check_cast/Test_check_cast.java b/jack-tests/tests/com/android/jack/opcodes/check_cast/Test_check_cast.java new file mode 100644 index 00000000..60b4c1c4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/check_cast/Test_check_cast.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.check_cast; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.check_cast.jm.T_check_cast_1; + + +public class Test_check_cast extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_check_cast_1 t = new T_check_cast_1(); + String s = ""; + assertEquals(s, t.run(s)); + } + + /** + * @title check null value + */ + public void testN2() { + T_check_cast_1 t = new T_check_cast_1(); + assertNull(t.run(null)); + } + + /** + * @title expected ClassCastException + */ + public void testE1() { + T_check_cast_1 t = new T_check_cast_1(); + try { + t.run(this); + fail("expected ClassCastException"); + } catch (ClassCastException iae) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/check_cast/jm/T_check_cast_1.java b/jack-tests/tests/com/android/jack/opcodes/check_cast/jm/T_check_cast_1.java new file mode 100644 index 00000000..ff46b2b3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/check_cast/jm/T_check_cast_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.check_cast.jm; + +public class T_check_cast_1 { + + public String run(Object o) { + return (String)o; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmp_long/Test_cmp_long.java b/jack-tests/tests/com/android/jack/opcodes/cmp_long/Test_cmp_long.java new file mode 100644 index 00000000..ceba8a9c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmp_long/Test_cmp_long.java @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmp_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.cmp_long.jm.T_cmp_long_1; +import com.android.jack.opcodes.cmp_long.jm.T_cmp_long_3; +import com.android.jack.opcodes.cmp_long.jm.T_cmp_long_4; +import com.android.jack.opcodes.cmp_long.jm.T_cmp_long_5; + + +public class Test_cmp_long extends DxTestCase { + + /** + * @title Arguments = 111234567891l > 111234567890l + */ + public void testN1() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(1, t.run(111234567891l, 111234567890l)); + } + + /** + * @title Arguments = 112234567890 == 112234567890 + */ + public void testN2() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(0, t.run(112234567890l, 112234567890l)); + } + + /** + * @title Arguments = 112234567890 < 998876543210 + */ + public void testN3() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(-1, t.run(112234567890l, 998876543210l)); + } + + /** + * @title Arguments = 112234567890 < 998876543210 + */ + public void testN4() { + T_cmp_long_3 t = new T_cmp_long_3(); + assertEquals(false, t.run(112234567890l, 998876543210l)); + } + + /** + * @title Arguments = 112234567890 < 998876543210 + */ + public void testN5() { + T_cmp_long_4 t = new T_cmp_long_4(); + assertEquals(false, t.run(112234567890l, 998876543210l)); + } + + /** + * @title Arguments = 11223 < 998876543210 + */ + public void testN6() { + T_cmp_long_5 t = new T_cmp_long_5(); + assertEquals(false, t.run(11223, 998876543210l)); + } + + /** + * @title Arguments = Long.MAX_VALUE > Long.MIN_VALUE + */ + public void testB1() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(1, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); + } + + /** + * @title Arguments = Long.MIN_VALUE < Long.MAX_VALUE + */ + public void testB2() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(-1, t.run(Long.MIN_VALUE, Long.MAX_VALUE)); + } + + /** + * @title Arguments = 1 > 0 + */ + public void testB3() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(1, t.run(1l, 0l)); + } + + /** + * @title Arguments = 0 > -1 + */ + public void testB4() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(1, t.run(0l, -1l)); + } + + /** + * @title Arguments = -1 < 0 + */ + public void testB5() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(-1, t.run(-1l, 0l)); + } + + /** + * @title Arguments = 0 = 0 + */ + public void testB6() { + T_cmp_long_1 t = new T_cmp_long_1(); + assertEquals(0, t.run(0l, 0l)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_1.java b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_1.java new file mode 100644 index 00000000..48d8bb7d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_1.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmp_long.jm; + +public class T_cmp_long_1 { + + public int run(long a, long b) { + if (a > b) return 1; + if (a == b) return 0; + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_3.java b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_3.java new file mode 100644 index 00000000..66bc92a4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmp_long.jm; + +public class T_cmp_long_3 { + + public boolean run(long a, double b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_4.java b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_4.java new file mode 100644 index 00000000..c802853a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmp_long.jm; + +public class T_cmp_long_4 { + + public boolean run(float a, long b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_5.java b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_5.java new file mode 100644 index 00000000..c6858467 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmp_long.jm; + +public class T_cmp_long_5 { + + public boolean run(int a, long b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_double/Test_cmpg_double.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/Test_cmpg_double.java new file mode 100644 index 00000000..8f3e1540 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/Test_cmpg_double.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.cmpg_double.jm.T_cmpg_double_1; +import com.android.jack.opcodes.cmpg_double.jm.T_cmpg_double_2; + + +public class Test_cmpg_double extends DxTestCase { + + /** + * @title Arguments = 3.14d, 2.7d + */ + public void testN1() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(1, t.run(3.14d, 2.7d)); + } + + /** + * @title Arguments = -3.14d, 2.7d + */ + public void testN2() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(-1, t.run(-3.14d, 2.7d)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN3() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(0, t.run(3.14d, 3.14d)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN4() { + T_cmpg_double_2 t = new T_cmpg_double_2(); + assertEquals(false, t.run(3.14d, 3.14d)); + } + +// /** +// * @title Arguments = Double.NaN, Double.MAX_VALUE +// */ +// public void testB1() { +// T_cmpg_double_1 t = new T_cmpg_double_1(); +// assertEquals(1, t.run(Double.NaN, Double.MAX_VALUE)); +// } + + /** + * @title Arguments = +0, -0 + */ + public void testB2() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(0, t.run(+0f, -0f)); + } + + /** + * @title Arguments = Double.NEGATIVE_INFINITY, Double.MIN_VALUE + */ + public void testB3() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(-1, t.run(Double.NEGATIVE_INFINITY, Double.MIN_VALUE)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, Double.MAX_VALUE + */ + public void testB4() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(1, t.run(Double.POSITIVE_INFINITY, Double.MAX_VALUE)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB5() { + T_cmpg_double_1 t = new T_cmpg_double_1(); + assertEquals(1, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_1.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_1.java new file mode 100644 index 00000000..2256452a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_1.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_double.jm; + +public class T_cmpg_double_1 { + + public int run(double a, double b) { + if(a > b) + return 1; + if(a == b) + return 0; + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_2.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_2.java new file mode 100644 index 00000000..0d76b00f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_double.jm; + +public class T_cmpg_double_2 { + + public boolean run(double a, double b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_float/Test_cmpg_float.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/Test_cmpg_float.java new file mode 100644 index 00000000..04bc6c90 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/Test_cmpg_float.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.cmpg_float.jm.T_cmpg_float_1; +import com.android.jack.opcodes.cmpg_float.jm.T_cmpg_float_2; + + +public class Test_cmpg_float extends DxTestCase { + + /** + * @title Arguments = 3.14f, 2.7f + */ + public void testN1() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(1, t.run(3.14f, 2.7f)); + } + + /** + * @title Arguments = -3.14f, 2.7f + */ + public void testN2() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(-1, t.run(-3.14f, 2.7f)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN3() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(0, t.run(3.14f, 3.14f)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN4() { + T_cmpg_float_2 t = new T_cmpg_float_2(); + assertEquals(false, t.run(3.14f, 3.14f)); + } + + /** + * @title Arguments = +0, -0 + */ + public void testB2() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(0, t.run(+0f, -0f)); + } + + /** + * @title Arguments = Float.NEGATIVE_INFINITY, Float.MIN_VALUE + */ + public void testB3() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(-1, t.run(Float.NEGATIVE_INFINITY, Float.MIN_VALUE)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, Float.MAX_VALUE + */ + public void testB4() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(1, t.run(Float.POSITIVE_INFINITY, Float.MAX_VALUE)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB5() { + T_cmpg_float_1 t = new T_cmpg_float_1(); + assertEquals(1, t.run(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java new file mode 100644 index 00000000..b6e8c8c6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_float.jm; + +public class T_cmpg_float_1 { + + public int run(float a, float b) { + if(a > b) + return 1; + if(a == b) + return 0; + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java new file mode 100644 index 00000000..a6eee616 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpg_float.jm; + +public class T_cmpg_float_2 { + + public boolean run(float a, float b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpl_double/Test_cmpl_double.java b/jack-tests/tests/com/android/jack/opcodes/cmpl_double/Test_cmpl_double.java new file mode 100644 index 00000000..0dbfe1e4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpl_double/Test_cmpl_double.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpl_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.cmpl_double.jm.T_cmpl_double_1; + + +public class Test_cmpl_double extends DxTestCase { + + /** + * @title Arguments = Double.NaN, Double.MAX_VALUE + */ + public void testB1() { + T_cmpl_double_1 t = new T_cmpl_double_1(); + assertEquals(-1, t.run(Double.NaN, Double.MAX_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpl_double/jm/T_cmpl_double_1.java b/jack-tests/tests/com/android/jack/opcodes/cmpl_double/jm/T_cmpl_double_1.java new file mode 100644 index 00000000..ea8b7564 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpl_double/jm/T_cmpl_double_1.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpl_double.jm; + +public class T_cmpl_double_1 { + + public int run(double a, double b) { + if(a > b) + return 1; + if(a == b) + return 0; + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpl_float/Test_cmpl_float.java b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/Test_cmpl_float.java new file mode 100644 index 00000000..e4cd5009 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/Test_cmpl_float.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpl_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.cmpl_float.jm.T_cmpl_float_1; +import com.android.jack.opcodes.cmpl_float.jm.T_cmpl_float_2; + + +public class Test_cmpl_float extends DxTestCase { + + /** + * @title Arguments = 3.14f, 2.7f + */ + public void testN1() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(1, t.run(3.14f, 2.7f)); + } + + /** + * @title Arguments = -3.14f, 2.7f + */ + public void testN2() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(-1, t.run(-3.14f, 2.7f)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN3() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(0, t.run(3.14f, 3.14f)); + } + + /** + * @title Arguments = 3.14, 3.14 + */ + public void testN4() { + T_cmpl_float_2 t = new T_cmpl_float_2(); + assertEquals(false, t.run(3.14f, 3.14f)); + } + + /** + * @title Arguments = Float.NaN, Float.MAX_VALUE + */ + public void testB1() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(-1, t.run(Float.NaN, Float.MAX_VALUE)); + } + + /** + * @title Arguments = +0, -0 + */ + public void testB2() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(0, t.run(+0f, -0f)); + } + + /** + * @title Arguments = Float.NEGATIVE_INFINITY, Float.MIN_VALUE + */ + public void testB3() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(-1, t.run(Float.NEGATIVE_INFINITY, Float.MIN_VALUE)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, Float.MAX_VALUE + */ + public void testB4() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(1, t.run(Float.POSITIVE_INFINITY, Float.MAX_VALUE)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB5() { + T_cmpl_float_1 t = new T_cmpl_float_1(); + assertEquals(1, t.run(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java new file mode 100644 index 00000000..87ba296d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpl_float.jm; + +public class T_cmpl_float_1 { + + public int run(float a, float b) { + if(a > b) + return 1; + if(a == b) + return 0; + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java new file mode 100644 index 00000000..80288b3a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.cmpl_float.jm; + +public class T_cmpl_float_2 { + + public boolean run(float a, float b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/Test_const4_16.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/Test_const4_16.java new file mode 100644 index 00000000..eb5180a2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/Test_const4_16.java @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_1; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_10; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_11; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_12; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_13; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_14; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_15; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_16; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_2; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_3; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_4; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_5; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_6; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_7; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_8; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_9; +import com.android.jack.opcodes.const4_16.jm.T_const4_16_17; + + +public class Test_const4_16 extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_const4_16_1 t = new T_const4_16_1(); + assertEquals(100, t.run()); + } + + /** + * @title normal test + */ + public void testB1() { + T_const4_16_2 t = new T_const4_16_2(); + assertEquals(0, t.run()); + } + + /** + * @title normal test + */ + public void testB2() { + T_const4_16_3 t = new T_const4_16_3(); + assertEquals(-1, t.run()); + } + + /** + * @title normal test + */ + public void testB3() { + T_const4_16_4 t = new T_const4_16_4(); + assertEquals(1, t.run()); + } + + /** + * @title const/16 -13570 + */ + public void testN2() { + T_const4_16_5 t = new T_const4_16_5(); + assertEquals(-13570, t.run()); + } + + /** + * @title const/4 0 + */ + public void testB4() { + T_const4_16_6 t = new T_const4_16_6(); + assertEquals(0, t.run()); + } + + /** + * @title const/4 - 1 + */ + public void testB5() { + T_const4_16_7 t = new T_const4_16_7(); + assertEquals(-1, t.run()); + } + + /** + * @title normal test + */ + public void testN3() { + T_const4_16_8 t = new T_const4_16_8(); + int b = 1234; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN4() { + T_const4_16_9 t = new T_const4_16_9(); + int b = 1235; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN5() { + T_const4_16_10 t = new T_const4_16_10(); + int b = 1236; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN6() { + T_const4_16_11 t = new T_const4_16_11(); + int b = 1237; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN7() { + T_const4_16_12 t = new T_const4_16_12(); + int b = 1238; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN8() { + T_const4_16_13 t = new T_const4_16_13(); + int b = 1239; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN9() { + T_const4_16_14 t = new T_const4_16_14(); + int b = 1233; + int c = 1234; + int d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN1Float_0() { + T_const4_16_15 t = new T_const4_16_15(); + float b = 1234f; + float c = 1234f; + float d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN1Float_1() { + T_const4_16_16 t = new T_const4_16_16(); + float b = 1235f; + float c = 1234f; + float d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title normal test + */ + public void testN1Float_2() { + T_const4_16_17 t = new T_const4_16_17(); + float b = 1236f; + float c = 1234f; + float d = b - c; + assertEquals(d, t.run()); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_1.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_1.java new file mode 100644 index 00000000..89028dd2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_1 { + + public byte run() { + return (byte)100; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_10.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_10.java new file mode 100644 index 00000000..623ecb5d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_10.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_10 { + + public int run() { + return 2; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_11.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_11.java new file mode 100644 index 00000000..0acde01c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_11.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_11 { + + public int run() { + return 3; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_12.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_12.java new file mode 100644 index 00000000..89dedda8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_12.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_12 { + + public int run() { + return 4; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_13.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_13.java new file mode 100644 index 00000000..d3bfa59b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_13.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_13 { + + public int run() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_14.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_14.java new file mode 100644 index 00000000..2007bab5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_14.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_14 { + + public int run() { + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_15.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_15.java new file mode 100644 index 00000000..67cf654e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_15.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_15 { + + public float run() { + return 0f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_16.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_16.java new file mode 100644 index 00000000..856e141f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_16.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_16 { + + public float run() { + return 1f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_17.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_17.java new file mode 100644 index 00000000..87e08a30 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_17.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_17 { + + public float run() { + return 2f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_2.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_2.java new file mode 100644 index 00000000..26d6a72a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_2 { + + public byte run() { + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_3.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_3.java new file mode 100644 index 00000000..c5b38d1b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_3 { + + public byte run() { + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_4.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_4.java new file mode 100644 index 00000000..cb6a3b07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_4 { + + public byte run() { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_5.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_5.java new file mode 100644 index 00000000..648d4c3b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_5 { + + public short run() { + return (short)0xcafe; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_6.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_6.java new file mode 100644 index 00000000..0aa7072a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_6 { + + public short run() { + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_7.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_7.java new file mode 100644 index 00000000..17a78b79 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_7.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_7 { + + public short run() { + return -1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_8.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_8.java new file mode 100644 index 00000000..ea6b2620 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_8.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_8 { + + public int run() { + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_9.java b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_9.java new file mode 100644 index 00000000..d159f539 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_9.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const4_16.jm; + +public class T_const4_16_9 { + + public int run() { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_string/Test_const_string.java b/jack-tests/tests/com/android/jack/opcodes/const_string/Test_const_string.java new file mode 100644 index 00000000..ee1170f5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_string/Test_const_string.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_string; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.const_string.jm.T_const_string_1; + + +public class Test_const_string extends DxTestCase { + + /** + * @title push string into stack + */ + public void testN1() { + T_const_string_1 t = new T_const_string_1(); + // lcd is hard to test isolated + String res = t.run(); + assertEquals(5, res.length()); + assertEquals('h', res.charAt(0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_string/jm/T_const_string_1.java b/jack-tests/tests/com/android/jack/opcodes/const_string/jm/T_const_string_1.java new file mode 100644 index 00000000..0d83b277 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_string/jm/T_const_string_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_string.jm; + +public class T_const_string_1 { + + public String run() { + return "hello"; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/Test_const_wide.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/Test_const_wide.java new file mode 100644 index 00000000..e9b7f6fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/Test_const_wide.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_1; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_2; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_3; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_4; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_5; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_6; +import com.android.jack.opcodes.const_wide.jm.T_const_wide_7; + + +public class Test_const_wide extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_const_wide_1 t = new T_const_wide_1(); + long a = 20l; + long b = 20l; + assertEquals(a - b, t.run()); + } + + /** + * @title normal test + */ + public void testN2() { + T_const_wide_2 t = new T_const_wide_2(); + long a = 20l; + long b = 19l; + assertEquals(a - b, t.run()); + } + + /** + * @title normal test + */ + public void testN3() { + T_const_wide_3 t = new T_const_wide_3(); + double b = 1234d; + double c = 1234d; + double d = b - c; + assertEquals(d, t.run()); + } + + /** + * @title push long into stack + */ + public void testN4() { + T_const_wide_4 t = new T_const_wide_4(); + long a = 1234567890122l; + long b = 1l; + assertEquals(a + b, t.run()); + } + + /** + * @title push double into stack + */ + public void testN5() { + T_const_wide_5 t = new T_const_wide_5(); + double a = 1234567890123232323232232323232323232323232323456788d; + double b = 1d; + assertEquals(a + b, t.run(), 0d); + } + + public void testN6() { + T_const_wide_6 t = new T_const_wide_6(); + assertEquals(1234567890123l, t.run()); + } + + public void testN7() { + T_const_wide_7 t = new T_const_wide_7(); + assertEquals(9876543210123l, t.run()); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_1.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_1.java new file mode 100644 index 00000000..d4ef38bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_1 { + + public long run() { + return 0l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_2.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_2.java new file mode 100644 index 00000000..bc0b043e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_2 { + + public long run() { + return 1l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_3.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_3.java new file mode 100644 index 00000000..99ee7149 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_3 { + + public double run() { + return 0d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_4.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_4.java new file mode 100644 index 00000000..b5cddde4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_4 { + + public long run() { + return 1234567890123l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_5.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_5.java new file mode 100644 index 00000000..9c9684d9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_5 { + + public double run() { + return 1234567890123232323232232323232323232323232323456789d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_6.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_6.java new file mode 100644 index 00000000..08d81c0b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_6 { + + public long run() { + return 1234567890123l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_7.java b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_7.java new file mode 100644 index 00000000..798ccca9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_7.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.const_wide.jm; + +public class T_const_wide_7 { + + public long run() { + return 9876543210123l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_double/Test_div_double.java b/jack-tests/tests/com/android/jack/opcodes/div_double/Test_div_double.java new file mode 100644 index 00000000..55865ce5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_double/Test_div_double.java @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.div_double.jm.T_div_double_1; +import com.android.jack.opcodes.div_double.jm.T_div_double_3; +import com.android.jack.opcodes.div_double.jm.T_div_double_4; + + +public class Test_div_double extends DxTestCase { + + /** + * @title Arguments = 2.7d, 3.14d + */ + public void testN1() { + + T_div_double_1 t = new T_div_double_1(); + assertEquals(0.8598726114649682d, t.run(2.7d, 3.14d)); + } + + /** + * @title Dividend = 0 + */ + public void testN2() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(0d, t.run(0, 3.14d)); + } + + /** + * @title Dividend is negative + */ + public void testN3() { + + T_div_double_1 t = new T_div_double_1(); + assertEquals(-1.162962962962963d, t.run(-3.14d, 2.7d)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + + T_div_double_1 t = new T_div_double_1(); + assertEquals(-1.162962962962963d, t.run(-3.14d, 2.7d)); + } + + /** + * @title Dividend is negative + */ + public void testN5() { + + T_div_double_3 t = new T_div_double_3(); + assertEquals(-1.162963001816361d, t.run(-3.14f, 2.7d)); + } + + /** + * @title Dividend is negative + */ + public void testN6() { + + T_div_double_4 t = new T_div_double_4(); + assertEquals(-116.29629629629629d, t.run(-314l, 2.7d)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB2() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, -2.7d + */ + public void testB3() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + -2.7d)); + } + + /** + * @title Arguments = -2.7d, Double.NEGATIVE_INFINITY + */ + public void testB4() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(0d, t.run(-2.7d, Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.NaN, t.run(0, 0)); + } + + /** + * @title Arguments = 0, -2.7 + */ + public void testB6() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(-0d, t.run(0, -2.7d)); + } + + /** + * @title Arguments = -2.7, 0 + */ + public void testB7() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(-2.7d, 0)); + } + + /** + * @title Arguments = 1, Double.MAX_VALUE + */ + public void testB8() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(1, Double.MIN_VALUE)); + } + + /** + * @title Arguments = Double.MAX_VALUE, -1E-9f + */ + public void testB9() { + T_div_double_1 t = new T_div_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(Double.MAX_VALUE, -1E-9f)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_1.java b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_1.java new file mode 100644 index 00000000..2a51de64 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_double.jm; + +public class T_div_double_1 { + + public double run(double a, double b) { + return a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_3.java b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_3.java new file mode 100644 index 00000000..97436659 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_double.jm; + +public class T_div_double_3 { + + public double run(float a, double b) { + return (double)a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_4.java b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_4.java new file mode 100644 index 00000000..a0e2abfd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_double/jm/T_div_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_double.jm; + +public class T_div_double_4 { + + public double run(long a, double b) { + return (double)a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_float/Test_div_float.java b/jack-tests/tests/com/android/jack/opcodes/div_float/Test_div_float.java new file mode 100644 index 00000000..fbce8c97 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_float/Test_div_float.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.div_float.jm.T_div_float_1; +import com.android.jack.opcodes.div_float.jm.T_div_float_3; +import com.android.jack.opcodes.div_float.jm.T_div_float_4; + + +public class Test_div_float extends DxTestCase { + + /** + * @title Arguments = 2.7f, 3.14f + */ + public void testN1() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(0.8598726f, t.run(2.7f, 3.14f)); + } + + /** + * @title Dividend = 0 + */ + public void testN2() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(0f, t.run(0, 3.14f)); + } + + /** + * @title Dividend is negative + */ + public void testN3() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(-1.162963f, t.run(-3.14f, 2.7f)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_div_float_3 t = new T_div_float_3(); + assertEquals(-1.162963f, t.run(-3.14f, 2.7f)); + } + + /** + * @title Dividend is negative + */ + public void testN5() { + T_div_float_4 t = new T_div_float_4(); + assertEquals(-116.296295f, t.run(-314l, 2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.NaN + */ + public void testB1() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NaN, t.run(Float.MAX_VALUE, Float.NaN)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB2() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NaN, t.run(Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, -2.7f + */ + public void testB3() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + -2.7f)); + } + + /** + * @title Arguments = -2.7f, Float.NEGATIVE_INFINITY + */ + public void testB4() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(0f, t.run(-2.7f, Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NaN, t.run(0, 0)); + } + + /** + * @title Arguments = 0, -2.7 + */ + public void testB6() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(-0f, t.run(0, -2.7f)); + } + + /** + * @title Arguments = -2.7, 0 + */ + public void testB7() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(-2.7f, 0)); + } + + /** + * @title Arguments = 1, Float.MAX_VALUE + */ + public void testB8() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(1, Float.MIN_VALUE)); + } + + /** + * @title Arguments = Float.MAX_VALUE, -1E-9f + */ + public void testB9() { + T_div_float_1 t = new T_div_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(Float.MAX_VALUE, -1E-9f)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_1.java b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_1.java new file mode 100644 index 00000000..52a5b083 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_float.jm; + +public class T_div_float_1 { + + public float run(float a, float b) { + return a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_3.java b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_3.java new file mode 100644 index 00000000..2c20734e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_float.jm; + +public class T_div_float_3 { + + public float run(float a, double b) { + return a/(float)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_4.java b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_4.java new file mode 100644 index 00000000..98ed7e38 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_float/jm/T_div_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_float.jm; + +public class T_div_float_4 { + + public float run(long a, float b) { + return (float)a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_int/Test_div_int.java b/jack-tests/tests/com/android/jack/opcodes/div_int/Test_div_int.java new file mode 100644 index 00000000..f1fc30a1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_int/Test_div_int.java @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.div_int.jm.T_div_int_1; +import com.android.jack.opcodes.div_int.jm.T_div_int_3; +import com.android.jack.opcodes.div_int.jm.T_div_int_4; + + +public class Test_div_int extends DxTestCase { + + /** + * @title Arguments = 8, 4 + */ + public void testN1() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(2, t.run(8, 4)); + } + + /** + * @title Rounding + */ + public void testN2() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(268435455, t.run(1073741823, 4)); + } + + /** + * @title Dividend = 0 + */ + public void testN3() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(0, t.run(0, 4)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(-3, t.run(-10, 3)); + } + + /** + * @title Divisor is negative + */ + public void testN5() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(-357913941, t.run(1073741824, -3)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN6() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(5965, t.run(-17895697, -3000)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN7() { + T_div_int_3 t = new T_div_int_3(); + assertEquals(5965, t.run(-17895697, -3000)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN8() { + T_div_int_4 t = new T_div_int_4(); + assertEquals(5965, t.run(-17895697, -3000)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, -1 + */ + public void testB1() { + T_div_int_1 t = new T_div_int_1(); + // result is MIN_VALUE because overflow occurs in this case + assertEquals(Integer.MIN_VALUE, t.run(Integer.MIN_VALUE, -1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, 1 + */ + public void testB2() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, 1 + */ + public void testB3() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MAX_VALUE + */ + public void testB4() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(-1, t.run(Integer.MIN_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = 1, Integer.MAX_VALUE + */ + public void testB5() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(0, t.run(1, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = 1, Integer.MIN_VALUE + */ + public void testB6() { + T_div_int_1 t = new T_div_int_1(); + assertEquals(0, t.run(1, Integer.MIN_VALUE)); + } + + /** + * @title Divisor is 0 + */ + public void testE1() { + T_div_int_1 t = new T_div_int_1(); + try { + t.run(1, 0); + fail("expected ArithmeticException"); + } catch (ArithmeticException ae) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_1.java b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_1.java new file mode 100644 index 00000000..d80597e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_int.jm; + +public class T_div_int_1 { + + public int run(int a, int b) { + return a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_3.java b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_3.java new file mode 100644 index 00000000..01c25d6d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_int.jm; + +public class T_div_int_3 { + + public int run(int a, double b) { + return a/(int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_4.java b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_4.java new file mode 100644 index 00000000..5192c1b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_int/jm/T_div_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_int.jm; + +public class T_div_int_4 { + + public int run(long a, int b) { + return (int)a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_long/Test_div_long.java b/jack-tests/tests/com/android/jack/opcodes/div_long/Test_div_long.java new file mode 100644 index 00000000..177e10ac --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_long/Test_div_long.java @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.div_long.jm.T_div_long_1; +import com.android.jack.opcodes.div_long.jm.T_div_long_4; +import com.android.jack.opcodes.div_long.jm.T_div_long_5; +import com.android.jack.opcodes.div_long.jm.T_div_long_6; + + +public class Test_div_long extends DxTestCase { + + /** + * @title Arguments = 100000000000l, 40000000000l + */ + public void testN1() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(2l, t.run(100000000000l, 40000000000l)); + } + + /** + * @title Rounding + */ + public void testN2() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(8l, t.run(98765432123456l, 12345678912345l)); + } + + /** + * @title Dividend = 0 + */ + public void testN3() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(0l, t.run(0l, 98765432123456l)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(-8, t.run(-98765432123456l, 12345678912345l)); + } + + /** + * @title Divisor is negative + */ + public void testN5() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(-8, t.run(98765432123456l, -12345678912345l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN6() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(80l, t.run(-98765432123456l, -1234567891234l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN7() { + T_div_long_4 t = new T_div_long_4(); + assertEquals(80l, t.run(-98765432123456l, -1234567891234l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN8() { + T_div_long_5 t = new T_div_long_5(); + assertEquals(0, t.run(-9876, -1234567891234l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN9() { + T_div_long_6 t = new T_div_long_6(); + assertEquals(80l, t.run(-98765432123456l, -1234567891234l)); + } + + /** + * @title Arguments = Long.MIN_VALUE, -1 + */ + public void testB1() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, -1)); + } + /** + * @title Arguments = Long.MIN_VALUE, 1 + */ + public void testB2() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, 1)); + } + /** + * @title Arguments = Long.MAX_VALUE, 1 + */ + public void testB3() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(9223372036854775807L, t.run(Long.MAX_VALUE, 1)); + } + /** + * @title Arguments = Long.MIN_VALUE, Long.MAX_VALUE + */ + public void testB4() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(-1, t.run(Long.MIN_VALUE, Long.MAX_VALUE)); + } + /** + * @title Arguments = 1, Long.MAX_VALUE + */ + public void testB5() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(0, t.run(1, Long.MAX_VALUE)); + } + /** + * @title Arguments = 1, Long.MIN_VALUE + */ + public void testB6() { + T_div_long_1 t = new T_div_long_1(); + assertEquals(0, t.run(1, Long.MIN_VALUE)); + } + + /** + * @title Divisor is 0 + */ + public void testE1() { + T_div_long_1 t = new T_div_long_1(); + try { + t.run(12345678912345l, 0); + fail("expected ArithmeticException"); + } catch (ArithmeticException ae) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_1.java b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_1.java new file mode 100644 index 00000000..bb38e322 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_1.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_long.jm; + + +public class T_div_long_1 { + + public long run(long a, long b) { + return a/b; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_4.java b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_4.java new file mode 100644 index 00000000..533b3483 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_long.jm; + +public class T_div_long_4 { + + public long run(long a, double b) { + return (long)(a/b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_5.java b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_5.java new file mode 100644 index 00000000..f6dda75a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_long.jm; + +public class T_div_long_5 { + + public long run(int a, long b) { + return a/b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_6.java b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_6.java new file mode 100644 index 00000000..7c1d9ee0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/div_long/jm/T_div_long_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.div_long.jm; + +public class T_div_long_6 { + + public long run(float a, long b) { + return (long)(a/b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_float/Test_double_to_float.java b/jack-tests/tests/com/android/jack/opcodes/double_to_float/Test_double_to_float.java new file mode 100644 index 00000000..549a2b57 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_float/Test_double_to_float.java @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.double_to_float.jm.T_double_to_float_1; +import com.android.jack.opcodes.double_to_float.jm.T_double_to_float_3; +import com.android.jack.opcodes.double_to_float.jm.T_double_to_float_4; + + +public class Test_double_to_float extends DxTestCase { + + /** + * @title Argument = 2.71 + */ + public void testN1() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(2.71f, t.run(2.71d)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(1f, t.run(1d)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(-1f, t.run(-1d)); + } + + /** + * @title Argument = 271 + */ + public void testN4() { + T_double_to_float_3 t = new T_double_to_float_3(); + assertEquals(271f, t.run(271l)); + } + + /** + * @title Argument = 271 + */ + public void testN5() { + T_double_to_float_4 t = new T_double_to_float_4(); + assertEquals(271f, t.run(271l)); + } + + /** + * @title Argument = Double.MAX_VALUE + */ + public void testB1() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Double.MAX_VALUE)); + } + + /** + * @title Argument = Double.MIN_VALUE + */ + public void testB2() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(0f, t.run(Double.MIN_VALUE)); + } + + /** + * @title Argument = -0 + */ + public void testB3() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(-0f, t.run(-0d)); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertTrue(Float.isNaN(t.run(Double.NaN))); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertTrue(Float.isInfinite(t.run(Double.POSITIVE_INFINITY))); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertTrue(Float.isInfinite(t.run(Double.NEGATIVE_INFINITY))); + } + + + /** + * @title Argument = -Double.MIN_VALUE + */ + public void testB7() { + T_double_to_float_1 t = new T_double_to_float_1(); + assertEquals(-0f, t.run(-4.9E-324d)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_1.java b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_1.java new file mode 100644 index 00000000..09b48406 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_float.jm; + +public class T_double_to_float_1 { + + public float run(double a) { + return (float)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_3.java b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_3.java new file mode 100644 index 00000000..50e8c1c3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_float.jm; + +public class T_double_to_float_3 { + + public float run(float a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_4.java b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_4.java new file mode 100644 index 00000000..82ec04bc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_float.jm; + +public class T_double_to_float_4 { + + public float run(long a) { + return (float) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_int/Test_double_to_int.java b/jack-tests/tests/com/android/jack/opcodes/double_to_int/Test_double_to_int.java new file mode 100644 index 00000000..b9bd1e43 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_int/Test_double_to_int.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.double_to_int.jm.T_double_to_int_1; +import com.android.jack.opcodes.double_to_int.jm.T_double_to_int_3; +import com.android.jack.opcodes.double_to_int.jm.T_double_to_int_4; + + +public class Test_double_to_int extends DxTestCase { + + /** + * @title Argument = 2.9999999d + */ + public void testN1() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(2, t.run(2.9999999d)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(1, t.run(1d)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(-1, t.run(-1d)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_double_to_int_3 t = new T_double_to_int_3(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_double_to_int_4 t = new T_double_to_int_4(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = -0 + */ + public void testB1() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(0, t.run(-0d)); + } + + /** + * @title Argument = Double.MAX_VALUE + */ + public void testB2() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Double.MAX_VALUE)); + } + + /** + * @title Argument = Double.MIN_VALUE + */ + public void testB3() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(0, t.run(Double.MIN_VALUE)); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(0, t.run(Double.NaN)); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Double.POSITIVE_INFINITY)); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_double_to_int_1 t = new T_double_to_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Double.NEGATIVE_INFINITY)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_1.java b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_1.java new file mode 100644 index 00000000..5bec3117 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_int.jm; + +public class T_double_to_int_1 { + + public int run(double a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_3.java b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_3.java new file mode 100644 index 00000000..3741f380 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_int.jm; + +public class T_double_to_int_3 { + + public int run(float a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_4.java b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_4.java new file mode 100644 index 00000000..63684733 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_int.jm; + +public class T_double_to_int_4 { + + public int run(long a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_long/Test_double_to_long.java b/jack-tests/tests/com/android/jack/opcodes/double_to_long/Test_double_to_long.java new file mode 100644 index 00000000..efed44bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_long/Test_double_to_long.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.double_to_long.jm.T_double_to_long_1; +import com.android.jack.opcodes.double_to_long.jm.T_double_to_long_3; +import com.android.jack.opcodes.double_to_long.jm.T_double_to_long_4; + + +public class Test_double_to_long extends DxTestCase { + + /** + * @title Argument = 2.9999999 + */ + public void testN1() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(2l, t.run(2.9999999d)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(1l, t.run(1d)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(-1l, t.run(-1d)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_double_to_long_3 t = new T_double_to_long_3(); + assertEquals(-1l, t.run(-1l)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_double_to_long_4 t = new T_double_to_long_4(); + assertEquals(-1l, t.run(-1l)); + } + + /** + * @title Argument = Double.MAX_VALUE + */ + public void testB1() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(Long.MAX_VALUE, t.run(Double.MAX_VALUE)); + } + + /** + * @title Argument = Double.MIN_VALUE + */ + public void testB2() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(0, t.run(Double.MIN_VALUE)); + } + + /** + * @title Argument = -0 + */ + public void testB3() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(0l, t.run(-0)); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(0l, t.run(Double.NaN)); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(Long.MAX_VALUE, t.run(Double.POSITIVE_INFINITY)); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_double_to_long_1 t = new T_double_to_long_1(); + assertEquals(Long.MIN_VALUE, t.run(Double.NEGATIVE_INFINITY)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_1.java b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_1.java new file mode 100644 index 00000000..eda4031f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_long.jm; + +public class T_double_to_long_1 { + + public long run(double a) { + return (long)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_3.java b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_3.java new file mode 100644 index 00000000..149cef2c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_long.jm; + +public class T_double_to_long_3 { + + public long run(float a) { + return (long)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_4.java b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_4.java new file mode 100644 index 00000000..17d8ba44 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.double_to_long.jm; + +public class T_double_to_long_4 { + + public long run(long a) { + return (long)(double)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_double/Test_float_to_double.java b/jack-tests/tests/com/android/jack/opcodes/float_to_double/Test_float_to_double.java new file mode 100644 index 00000000..b8b8bfd6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_double/Test_float_to_double.java @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.float_to_double.jm.T_float_to_double_1; +import com.android.jack.opcodes.float_to_double.jm.T_float_to_double_3; +import com.android.jack.opcodes.float_to_double.jm.T_float_to_double_4; + + +public class Test_float_to_double extends DxTestCase { + + /** + * @title Argument = 0.5 + */ + public void testN1() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertEquals(0.5d, t.run(0.5f), 0d); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertEquals(1d, t.run(1), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertEquals(-1d, t.run(-1), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_float_to_double_3 t = new T_float_to_double_3(); + assertEquals(-1d, t.run(-1), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_float_to_double_4 t = new T_float_to_double_4(); + assertEquals(-1d, t.run(-1), 0d); + } + + /** + * @title Argument = Float.MAX_VALUE + */ + public void testB1() { + T_float_to_double_1 t = new T_float_to_double_1(); + double r = 0x1.fffffeP+127d; + assertEquals(r, t.run(Float.MAX_VALUE), 0d); + } + + /** + * @title Argument = Float.MIN_VALUE + */ + public void testB2() { + T_float_to_double_1 t = new T_float_to_double_1(); + double r = 0x0.000002P-126d; + assertEquals(r, t.run(Float.MIN_VALUE), 0d); + } + + /** + * @title Argument = -0 + */ + public void testB3() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertEquals(-0d, t.run(-0), 0d); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertTrue(Double.isNaN(t.run(Float.NaN))); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertTrue(Double.isInfinite(t.run(Float.POSITIVE_INFINITY))); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_float_to_double_1 t = new T_float_to_double_1(); + assertTrue(Double.isInfinite(t.run(Float.NEGATIVE_INFINITY))); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_1.java b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_1.java new file mode 100644 index 00000000..586e0212 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_double.jm; + +public class T_float_to_double_1 { + + public double run(float a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_3.java b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_3.java new file mode 100644 index 00000000..1d760478 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_double.jm; + +public class T_float_to_double_3 { + + public double run(double a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_4.java b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_4.java new file mode 100644 index 00000000..a23737ba --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_double.jm; + +public class T_float_to_double_4 { + + public double run(long a) { + return (float) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_int/Test_float_to_int.java b/jack-tests/tests/com/android/jack/opcodes/float_to_int/Test_float_to_int.java new file mode 100644 index 00000000..39cc6dd8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_int/Test_float_to_int.java @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.float_to_int.jm.T_float_to_int_1; +import com.android.jack.opcodes.float_to_int.jm.T_float_to_int_3; +import com.android.jack.opcodes.float_to_int.jm.T_float_to_int_4; + + +public class Test_float_to_int extends DxTestCase { + + /** + * @title Argument = 2.999999f + */ + public void testN1() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(2, t.run(2.999999f)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(1, t.run(1f)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(-1, t.run(-1f)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_float_to_int_3 t = new T_float_to_int_3(); + assertEquals(-1, t.run(-1f)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_float_to_int_4 t = new T_float_to_int_4(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = -0f + */ + public void testB1() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(0, t.run(-0f)); + } + + /** + * @title Argument = Float.MAX_VALUE + */ + public void testB2() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Float.MAX_VALUE)); + } + + /** + * @title Argument = Float.MIN_VALUE + */ + public void testB3() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(0, t.run(Float.MIN_VALUE)); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(0, t.run(Float.NaN)); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Float.POSITIVE_INFINITY)); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_float_to_int_1 t = new T_float_to_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Float.NEGATIVE_INFINITY)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_1.java b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_1.java new file mode 100644 index 00000000..d2714a0a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_int.jm; + +public class T_float_to_int_1 { + + public int run(float a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_3.java b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_3.java new file mode 100644 index 00000000..63e70c4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_int.jm; + +public class T_float_to_int_3 { + + public int run(double a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_4.java b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_4.java new file mode 100644 index 00000000..b28ca239 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_int.jm; + +public class T_float_to_int_4 { + + public int run(long a) { + return (int)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_long/Test_float_to_long.java b/jack-tests/tests/com/android/jack/opcodes/float_to_long/Test_float_to_long.java new file mode 100644 index 00000000..6d942d21 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_long/Test_float_to_long.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.float_to_long.jm.T_float_to_long_1; +import com.android.jack.opcodes.float_to_long.jm.T_float_to_long_3; +import com.android.jack.opcodes.float_to_long.jm.T_float_to_long_4; + + +public class Test_float_to_long extends DxTestCase { + + /** + * @title Argument = 2.999999f + */ + public void testN1() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(2l, t.run(2.999999f)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(1l, t.run(1)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_float_to_long_3 t = new T_float_to_long_3(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_float_to_long_4 t = new T_float_to_long_4(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = Float.MAX_VALUE + */ + public void testB1() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(Long.MAX_VALUE, t.run(Float.MAX_VALUE)); + } + + /** + * @title Argument = Float.MIN_VALUE + */ + public void testB2() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(0, t.run(Float.MIN_VALUE)); + } + + /** + * @title Argument = 0 + */ + public void testB3() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(0l, t.run(0)); + } + + /** + * @title Argument = NaN + */ + public void testB4() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(0l, t.run(Float.NaN)); + } + + /** + * @title Argument = POSITIVE_INFINITY + */ + public void testB5() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(Long.MAX_VALUE, t.run(Float.POSITIVE_INFINITY)); + } + + /** + * @title Argument = NEGATIVE_INFINITY + */ + public void testB6() { + T_float_to_long_1 t = new T_float_to_long_1(); + assertEquals(Long.MIN_VALUE, t.run(Float.NEGATIVE_INFINITY)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_1.java b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_1.java new file mode 100644 index 00000000..fd470ab8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_long.jm; + +public class T_float_to_long_1 { + + public long run(float a) { + return (long)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_3.java b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_3.java new file mode 100644 index 00000000..4c7aee76 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_long.jm; + +public class T_float_to_long_3 { + + public long run(double a) { + return (long)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_4.java b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_4.java new file mode 100644 index 00000000..4aee445d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.float_to_long.jm; + +public class T_float_to_long_4 { + + public long run(long a) { + return (long)(float)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eq/Test_if_eq.java b/jack-tests/tests/com/android/jack/opcodes/if_eq/Test_if_eq.java new file mode 100644 index 00000000..5b151a3e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eq/Test_if_eq.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eq; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_eq.jm.T_if_eq_1; +import com.android.jack.opcodes.if_eq.jm.T_if_eq_2; +import com.android.jack.opcodes.if_eq.jm.T_if_eq_3; + + +public class Test_if_eq extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_if_eq_1 t = new T_if_eq_1(); + String a = "a"; + String b = "b"; + + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_eq instruction + */ + assertEquals(1234, t.run(a, b)); + } + + /** + * @title normal test + */ + public void testN2() { + T_if_eq_1 t = new T_if_eq_1(); + String a = "a"; + assertEquals(1, t.run(a, a)); + } + + public void testN3() { + T_if_eq_2 t = new T_if_eq_2(); + String a = "a"; + assertEquals(true, t.run(a, a)); + } + + /** + * @title Compare with null + */ + public void testB1() { + T_if_eq_1 t = new T_if_eq_1(); + String a = "a"; + assertEquals(1234, t.run(null, a)); + } + + /** + * @title Arguments = 5, 6 + */ + public void testN1Int() { + T_if_eq_3 t = new T_if_eq_3(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_eq instruction + */ + assertEquals(1234, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1234, t.run(5, -5)); + } + + /** + * @title Arguments = 0x01001234, 0x1234 + */ + public void testN4Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1234, t.run(0x01001234, 0x1234)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB3Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1234, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB4Int() { + T_if_eq_3 t = new T_if_eq_3(); + assertEquals(1, t.run(0, 0)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_1.java b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_1.java new file mode 100644 index 00000000..2b759d53 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eq.jm; + +public class T_if_eq_1 { + + public int run(String a, String b) { + return a == b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_2.java b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_2.java new file mode 100644 index 00000000..67a5d135 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eq.jm; + +public class T_if_eq_2 { + + public boolean run(String a, String b) { + return a == b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_3.java b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_3.java new file mode 100644 index 00000000..66bfdc82 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eq.jm; + +public class T_if_eq_3 { + + public int run(int a, int b) { + return a == b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eqz/Test_if_eqz.java b/jack-tests/tests/com/android/jack/opcodes/if_eqz/Test_if_eqz.java new file mode 100644 index 00000000..5f40686f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eqz/Test_if_eqz.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eqz; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_eqz.jm.T_if_eqz_1; +import com.android.jack.opcodes.if_eqz.jm.T_if_eqz_2; +import com.android.jack.opcodes.if_eqz.jm.T_if_eqz_3; +import com.android.jack.opcodes.if_eqz.jm.T_if_eqz_4; + + +public class Test_if_eqz extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_eqz_1 t = new T_if_eqz_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_eqz instruction + */ + assertEquals(1234, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_eqz_1 t = new T_if_eqz_1(); + assertEquals(1, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_eqz_1 t = new T_if_eqz_1(); + assertEquals(1234, t.run(-5)); + } + + /** + * @title Arguments = -5 + */ + public void testN4() { + T_if_eqz_2 t = new T_if_eqz_2(); + assertEquals(false, t.run(-5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_eqz_1 t = new T_if_eqz_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE + */ + public void testB2() { + T_if_eqz_1 t = new T_if_eqz_1(); + assertEquals(1234, t.run(Integer.MIN_VALUE)); + } + + /** + * @title Argument = this + */ + public void testN1Null() { + T_if_eqz_3 t = new T_if_eqz_3(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_eqz instruction + */ + assertEquals(1234, t.run(this)); + } + + /** + * @title Argument = null + */ + public void testN2Null() { + T_if_eqz_3 t = new T_if_eqz_3(); + assertEquals(1, t.run(null)); + } + + /** + * @title Argument = null + */ + public void testN3Null() { + T_if_eqz_4 t = new T_if_eqz_4(); + assertEquals(true, t.run(null)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java new file mode 100644 index 00000000..ee763039 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eqz.jm; + +public class T_if_eqz_1 { + + public int run(int a) { + return a == 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java new file mode 100644 index 00000000..86e16295 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eqz.jm; + +public class T_if_eqz_2 { + + public boolean run(int a) { + return a == 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java new file mode 100644 index 00000000..578aa247 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eqz.jm; + +public class T_if_eqz_3 { + + public int run(Object o) { + return o == null ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java new file mode 100644 index 00000000..fb529905 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_eqz.jm; + +public class T_if_eqz_4 { + + public boolean run(Object o) { + return o == null; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ge/Test_if_ge.java b/jack-tests/tests/com/android/jack/opcodes/if_ge/Test_if_ge.java new file mode 100644 index 00000000..004f13b3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ge/Test_if_ge.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ge; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_ge.jm.T_if_ge_1; +import com.android.jack.opcodes.if_ge.jm.T_if_ge_2; + + +public class Test_if_ge extends DxTestCase { + + /** + * @title Arguments = 5, 6 + */ + public void testN1() { + T_if_ge_1 t = new T_if_ge_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_ge instruction + */ + assertEquals(1234, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(5, -5)); + } + + /** + * @title Arguments = 0x0f0e0d0d, 0x0f0e0d0c + */ + public void testN4() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(0x0f0e0d0d, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 0x1234, 0x01001234 + */ + public void testN5() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1234, t.run(0x1234, 0x01001234)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN6() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1234, t.run(-5, 5)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN7() { + T_if_ge_2 t = new T_if_ge_2(); + assertEquals(false, t.run(-5, 5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 1234567, 0 + */ + public void testB3() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(1234567, 0)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB4() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1234, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_if_ge_1 t = new T_if_ge_1(); + assertEquals(1, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_1.java b/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_1.java new file mode 100644 index 00000000..06ca508e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ge.jm; + +public class T_if_ge_1 { + + public int run(int a, int b) { + return a >= b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_2.java b/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_2.java new file mode 100644 index 00000000..8a49b7a0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ge.jm; + +public class T_if_ge_2 { + + public boolean run(int a, int b) { + return a >= b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gez/Test_if_gez.java b/jack-tests/tests/com/android/jack/opcodes/if_gez/Test_if_gez.java new file mode 100644 index 00000000..0aa5e158 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gez/Test_if_gez.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gez; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_gez.jm.T_if_gez_1; +import com.android.jack.opcodes.if_gez.jm.T_if_gez_2; + + +public class Test_if_gez extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_gez_1 t = new T_if_gez_1(); + assertEquals(1, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_gez_1 t = new T_if_gez_1(); + assertEquals(1, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_gez_1 t = new T_if_gez_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_gez instruction + */ + assertEquals(1234, t.run(-5)); + } + + /** + * @title Argument = 5 + */ + public void testN4() { + T_if_gez_2 t = new T_if_gez_2(); + assertTrue(t.run(5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_gez_1 t = new T_if_gez_1(); + assertEquals(1, t.run(Integer.MAX_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_1.java b/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_1.java new file mode 100644 index 00000000..74a996cb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gez.jm; + +public class T_if_gez_1 { + + public int run(int a) { + return a >= 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_2.java b/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_2.java new file mode 100644 index 00000000..75f49b83 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gez.jm; + +public class T_if_gez_2 { + + public boolean run(int a) { + return a >= 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gt/Test_if_gt.java b/jack-tests/tests/com/android/jack/opcodes/if_gt/Test_if_gt.java new file mode 100644 index 00000000..c895aa84 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gt/Test_if_gt.java @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gt; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_gt.jm.T_if_gt_1; +import com.android.jack.opcodes.if_gt.jm.T_if_gt_2; + + +public class Test_if_gt extends DxTestCase { + + /** + * @title Arguments = 5, 6 + */ + public void testN1() { + T_if_gt_1 t = new T_if_gt_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_gt instruction + */ + assertEquals(1234, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1, t.run(5, -5)); + } + + /** + * @title Arguments = 0x0f0e0d0d, 0x0f0e0d0c + */ + public void testN4() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1, t.run(0x0f0e0d0d, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 0x1234, 0x01001234 + */ + public void testN5() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(0x1234, 0x01001234)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN6() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(-5, 5)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN7() { + T_if_gt_2 t = new T_if_gt_2(); + assertEquals(false, t.run(-5, 5)); + } + + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 1234567, 0 + */ + public void testB3() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1, t.run(1234567, 0)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB4() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_if_gt_1 t = new T_if_gt_1(); + assertEquals(1234, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_1.java b/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_1.java new file mode 100644 index 00000000..c78f683c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gt.jm; + +public class T_if_gt_1 { + + public int run(int a, int b) { + return a > b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_2.java b/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_2.java new file mode 100644 index 00000000..e4fb856a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gt.jm; + +public class T_if_gt_2 { + + public boolean run(int a, int b) { + return a > b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gtz/Test_if_gtz.java b/jack-tests/tests/com/android/jack/opcodes/if_gtz/Test_if_gtz.java new file mode 100644 index 00000000..3328763c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gtz/Test_if_gtz.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gtz; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_gtz.jm.T_if_gtz_1; +import com.android.jack.opcodes.if_gtz.jm.T_if_gtz_2; + + +public class Test_if_gtz extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_gtz_1 t = new T_if_gtz_1(); + assertEquals(1, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_gtz_1 t = new T_if_gtz_1(); + assertEquals(1234, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_gtz_1 t = new T_if_gtz_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_gtz instruction + */ + assertEquals(1234, t.run(-5)); + } + + /** + * @title Argument = 5 + */ + public void testN4() { + T_if_gtz_2 t = new T_if_gtz_2(); + assertTrue(t.run(5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_gtz_1 t = new T_if_gtz_1(); + assertEquals(1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE + */ + public void testB2() { + T_if_gtz_1 t = new T_if_gtz_1(); + assertEquals(1234, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java b/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java new file mode 100644 index 00000000..50ae6eba --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gtz.jm; + +public class T_if_gtz_1 { + + public int run(int a) { + return a > 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java b/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java new file mode 100644 index 00000000..1e57da5f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_gtz.jm; + +public class T_if_gtz_2 { + + public boolean run(int a) { + return a > 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_le/Test_if_le.java b/jack-tests/tests/com/android/jack/opcodes/if_le/Test_if_le.java new file mode 100644 index 00000000..c10a7804 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_le/Test_if_le.java @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_le; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_le.jm.T_if_le_1; +import com.android.jack.opcodes.if_le.jm.T_if_le_2; + + +public class Test_if_le extends DxTestCase { + + /** + * @title Arguments = 5, 6 + */ + public void testN1() { + T_if_le_1 t = new T_if_le_1(); + + assertEquals(1, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3() { + T_if_le_1 t = new T_if_le_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_le instruction + */ + assertEquals(1234, t.run(5, -5)); + } + + /** + * @title Arguments = 0x0f0e0d0d, 0x0f0e0d0c + */ + public void testN4() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1234, t.run(0x0f0e0d0d, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 0x1234, 0x01001234 + */ + public void testN5() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(0x1234, 0x01001234)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN6() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(-5, 5)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN7() { + T_if_le_2 t = new T_if_le_2(); + assertEquals(true, t.run(-5, 5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 1234567, 0 + */ + public void testB3() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1234, t.run(1234567, 0)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB4() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_if_le_1 t = new T_if_le_1(); + assertEquals(1, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_1.java b/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_1.java new file mode 100644 index 00000000..dd1f49a2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_le.jm; + +public class T_if_le_1 { + + public int run(int a, int b) { + return a <= b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_2.java b/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_2.java new file mode 100644 index 00000000..6d13b51e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_le/jm/T_if_le_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_le.jm; + +public class T_if_le_2 { + + public boolean run(int a, int b) { + return a <= b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lez/Test_if_lez.java b/jack-tests/tests/com/android/jack/opcodes/if_lez/Test_if_lez.java new file mode 100644 index 00000000..783f14b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lez/Test_if_lez.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lez; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_lez.jm.T_if_lez_1; +import com.android.jack.opcodes.if_lez.jm.T_if_lez_2; + + +public class Test_if_lez extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_lez_1 t = new T_if_lez_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_lez instruction + */ + assertEquals(1234, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_lez_1 t = new T_if_lez_1(); + assertEquals(1, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_lez_1 t = new T_if_lez_1(); + assertEquals(1, t.run(-5)); + } + + /** + * @title Arguments = -5 + */ + public void testN4() { + T_if_lez_2 t = new T_if_lez_2(); + assertEquals(true, t.run(-5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_lez_1 t = new T_if_lez_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE + */ + public void testB2() { + T_if_lez_1 t = new T_if_lez_1(); + assertEquals(1, t.run(Integer.MIN_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_1.java b/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_1.java new file mode 100644 index 00000000..f8756246 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lez.jm; + +public class T_if_lez_1 { + + public int run(int a) { + return a <= 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_2.java b/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_2.java new file mode 100644 index 00000000..3130e3d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lez.jm; + +public class T_if_lez_2 { + + public boolean run(int a) { + return a <= 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lt/Test_if_lt.java b/jack-tests/tests/com/android/jack/opcodes/if_lt/Test_if_lt.java new file mode 100644 index 00000000..d3378c66 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lt/Test_if_lt.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lt; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_lt.jm.T_if_lt_1; +import com.android.jack.opcodes.if_lt.jm.T_if_lt_2; + + +public class Test_if_lt extends DxTestCase { + + /** + * @title Arguments = 5, 6 + */ + public void testN1() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2() { + T_if_lt_1 t = new T_if_lt_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_lt instruction + */ + assertEquals(1234, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(5, -5)); + } + + /** + * @title Arguments = 0x0f0e0d0d, 0x0f0e0d0c + */ + public void testN4() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(0x0f0e0d0d, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 0x1234, 0x01001234 + */ + public void testN5() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1, t.run(0x1234, 0x01001234)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN6() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1, t.run(-5, 5)); + } + + /** + * @title Arguments = -5, 5 + */ + public void testN7() { + T_if_lt_2 t = new T_if_lt_2(); + assertEquals(true, t.run(-5, 5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 1234567, 0 + */ + public void testB3() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(1234567, 0)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB4() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_if_lt_1 t = new T_if_lt_1(); + assertEquals(1234, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_1.java b/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_1.java new file mode 100644 index 00000000..115d8124 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lt.jm; + +public class T_if_lt_1 { + + public int run(int a, int b) { + return a < b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_2.java b/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_2.java new file mode 100644 index 00000000..57d67526 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_lt.jm; + +public class T_if_lt_2 { + + public boolean run(int a, int b) { + return a < b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ltz/Test_if_ltz.java b/jack-tests/tests/com/android/jack/opcodes/if_ltz/Test_if_ltz.java new file mode 100644 index 00000000..a1724e4d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ltz/Test_if_ltz.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ltz; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_ltz.jm.T_if_ltz_1; +import com.android.jack.opcodes.if_ltz.jm.T_if_ltz_2; + + +public class Test_if_ltz extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_ltz_1 t = new T_if_ltz_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_ltz instruction + */ + assertEquals(1234, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_ltz_1 t = new T_if_ltz_1(); + assertEquals(1234, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_ltz_1 t = new T_if_ltz_1(); + assertEquals(1, t.run(-5)); + } + + /** + * @title Arguments = -5 + */ + public void testN4() { + T_if_ltz_2 t = new T_if_ltz_2(); + assertEquals(true, t.run(-5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_ltz_1 t = new T_if_ltz_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE + */ + public void testB2() { + T_if_ltz_1 t = new T_if_ltz_1(); + assertEquals(1, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java b/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java new file mode 100644 index 00000000..a4e7cf9f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ltz.jm; + +public class T_if_ltz_1 { + + public int run(int a) { + return a < 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java b/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java new file mode 100644 index 00000000..fc067985 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ltz.jm; + +public class T_if_ltz_2 { + + public boolean run(int a) { + return a < 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ne/Test_if_ne.java b/jack-tests/tests/com/android/jack/opcodes/if_ne/Test_if_ne.java new file mode 100644 index 00000000..41cf5f9f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ne/Test_if_ne.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ne; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_ne.jm.T_if_ne_1; + + +public class Test_if_ne extends DxTestCase { + + /** + * @title Arguments = 5, 6 + */ + public void testN1() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1, t.run(5, 6)); + } + + /** + * @title Arguments = 0x0f0e0d0c, 0x0f0e0d0c + */ + public void testN2() { + T_if_ne_1 t = new T_if_ne_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_ne instruction + */ + assertEquals(1234, t.run(0x0f0e0d0c, 0x0f0e0d0c)); + } + + /** + * @title Arguments = 5, -5 + */ + public void testN3() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1, t.run(5, -5)); + } + + /** + * @title Arguments = 0x01001234, 0x1234 + */ + public void testN4() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1, t.run(0x01001234, 0x1234)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB1() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1234, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MIN_VALUE + */ + public void testB2() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1234, t.run(Integer.MIN_VALUE, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 0, 1234567 + */ + public void testB3() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1, t.run(0, 1234567)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB4() { + T_if_ne_1 t = new T_if_ne_1(); + assertEquals(1234, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_1.java b/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_1.java new file mode 100644 index 00000000..26d45bb8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ne.jm; + +public class T_if_ne_1 { + + public int run(int a, int b) { + return a != b ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_2.java b/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_2.java new file mode 100644 index 00000000..9ae7f560 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_ne.jm; + +public class T_if_ne_2 { + + public boolean run(int a, int b) { + return a != b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_nez/Test_if_nez.java b/jack-tests/tests/com/android/jack/opcodes/if_nez/Test_if_nez.java new file mode 100644 index 00000000..0822431e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_nez/Test_if_nez.java @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_nez; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.if_nez.jm.T_if_nez_1; +import com.android.jack.opcodes.if_nez.jm.T_if_nez_2; +import com.android.jack.opcodes.if_nez.jm.T_if_nez_3; +import com.android.jack.opcodes.if_nez.jm.T_if_nez_4; + + +public class Test_if_nez extends DxTestCase { + + /** + * @title Argument = 5 + */ + public void testN1() { + T_if_nez_1 t = new T_if_nez_1(); + assertEquals(1, t.run(5)); + } + + /** + * @title Argument = 0 + */ + public void testN2() { + T_if_nez_1 t = new T_if_nez_1(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_nez instruction + */ + assertEquals(1234, t.run(0)); + } + + /** + * @title Arguments = -5 + */ + public void testN3() { + T_if_nez_1 t = new T_if_nez_1(); + assertEquals(1, t.run(-5)); + } + + /** + * @title Arguments = -5 + */ + public void testN4() { + T_if_nez_2 t = new T_if_nez_2(); + assertEquals(true, t.run(-5)); + } + + /** + * @title Arguments = Integer.MAX_VALUE + */ + public void testB1() { + T_if_nez_1 t = new T_if_nez_1(); + assertEquals(1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MIN_VALUE + */ + public void testB2() { + T_if_nez_1 t = new T_if_nez_1(); + assertEquals(1, t.run(Integer.MIN_VALUE)); + } + + /** + * @title Argument = this + */ + public void testN1NonNull() { + T_if_nez_3 t = new T_if_nez_3(); + assertEquals(1, t.run(this)); + } + + /** + * @title Argument = null + */ + public void testN2NonNull() { + T_if_nez_3 t = new T_if_nez_3(); + /* + * Compare with 1234 to check that in case of failed comparison + * execution proceeds at the address following if_nez instruction + */ + assertEquals(1234, t.run(null)); + } + + /** + * @title Argument = this + */ + public void testN3NonNull() { + T_if_nez_4 t = new T_if_nez_4(); + assertEquals(true, t.run(this)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_1.java b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_1.java new file mode 100644 index 00000000..0097da59 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_nez.jm; + +public class T_if_nez_1 { + + public int run(int a) { + return a != 0 ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_2.java b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_2.java new file mode 100644 index 00000000..b51e18d3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_nez.jm; + +public class T_if_nez_2 { + + public boolean run(int a) { + return a != 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_3.java b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_3.java new file mode 100644 index 00000000..c092877e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_nez.jm; + +public class T_if_nez_3 { + + public int run(Object o) { + return o != null ? 1 : 1234; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_4.java b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_4.java new file mode 100644 index 00000000..8cd762cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.if_nez.jm; + +public class T_if_nez_4 { + + public boolean run(Object o) { + return o != null; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/Test_iget.java b/jack-tests/tests/com/android/jack/opcodes/iget/Test_iget.java new file mode 100644 index 00000000..df64f02b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/Test_iget.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.iget.jm.T_iget_1; +import com.android.jack.opcodes.iget.jm.T_iget_11; +import com.android.jack.opcodes.iget.jm.T_iget_15; +import com.android.jack.opcodes.iget.jm.T_iget_2; +import com.android.jack.opcodes.iget.jm.T_iget_4; +import com.android.jack.opcodes.iget.jm.T_iget_5; +import com.android.jack.opcodes.iget.jm.T_iget_6; + + +public class Test_iget extends DxTestCase { + private int TestStubField = 123; + protected int TestStubFieldP = 0; + + private int privateInt = 456; + + /** + * @title type - int + */ + public void testN1() { + T_iget_1 t = new T_iget_1(); + assertEquals(35, t.run()); + } + + /** + * @title type - double + */ + public void testN2() { + T_iget_2 t = new T_iget_2(); + assertEquals(123d, t.run()); + } + + /** + * @title access protected field from subclass + */ + public void testN3() { + // @uses com.android.jack.opcodes.iget.jm.T_iget_1 + T_iget_11 t = new T_iget_11(); + assertEquals(10, t.run()); + } + + public void testN4() { + T_iget_4 t = new T_iget_4(); + assertEquals(5, t.run()); + } + + public void testN5() { + T_iget_15 t = new T_iget_15(); + assertNull(t.run()); + } + + /** + * @title attempt to access static field + */ + public void testN6() { + T_iget_5 t = new T_iget_5(); + assertEquals(5, t.run()); + } + + /** + * @title attempt to access of non-accessible private field + */ + public void testN7() { + T_iget_6 t = new T_iget_6(); + int res = t.run(); + assertEquals(-99, t.run()); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_1.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_1.java new file mode 100644 index 00000000..40d1c928 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_1.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_1 { + public int i1 = 5; + protected int p1 = 10; + private int pvt1 = 20; + + public int run(){ + return i1 + p1 + pvt1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_11.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_11.java new file mode 100644 index 00000000..49505c5e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_11.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_11 extends T_iget_1 { + + public int run(){ + return p1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_15.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_15.java new file mode 100644 index 00000000..568ad3e3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_15.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_15 { + + public Object run() { + TChild s = new TChild(); + return s.o; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_2.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_2.java new file mode 100644 index 00000000..3f353ea7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_2 { + + public double val = 123.0d; + + public double run() { + return val; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_4.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_4.java new file mode 100644 index 00000000..81609edb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_4 { + + public int i1 = 5; + public int run(){ + return i1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_5.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_5.java new file mode 100644 index 00000000..7fa65e5c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_5.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_5 { + + public static int i1 = 5; + public int run(){ + return i1; + } +} + diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_6.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_6.java new file mode 100644 index 00000000..1fafddc7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/T_iget_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + +public class T_iget_6 { + + public int run() { + return -99; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iget/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/iget/jm/TestStubs.java new file mode 100644 index 00000000..bb7b96cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iget/jm/TestStubs.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iget.jm; + + + +class TSuper { + public String s = "abc"; +} + +class TChild extends TSuper { + public Object o = null; +} + +public class TestStubs { + private int privateInt = 456; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_byte/Test_int_to_byte.java b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/Test_int_to_byte.java new file mode 100644 index 00000000..8145ddec --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/Test_int_to_byte.java @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_byte; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_byte.jm.T_int_to_byte_1; +import com.android.jack.opcodes.int_to_byte.jm.T_int_to_byte_3; +import com.android.jack.opcodes.int_to_byte.jm.T_int_to_byte_4; + + +public class Test_int_to_byte extends DxTestCase { + + /** + * @title Argument = 1 + */ + public void testN1() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(1, t.run(1)); + } + + /** + * @title Argument = -1 + */ + public void testN2() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-1, t.run(-1)); + } + + /** + * @title Argument = 16 + */ + public void testN3() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(16, t.run(16)); + } + + /** + * @title Argument = -32 + */ + public void testN4() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-32, t.run(-32)); + } + + /** + * @title Argument = 134 + */ + public void testN5() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-122, t.run(134)); + } + + /** + * @title Argument = -134 + */ + public void testN6() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(122, t.run(-134)); + } + + /** + * @title Argument = 1 + */ + public void testN7() { + T_int_to_byte_3 t = new T_int_to_byte_3(); + assertEquals(1, t.run(1)); + } + + /** + * @title Argument = 1 + */ + public void testN8() { + T_int_to_byte_4 t = new T_int_to_byte_4(); + assertEquals(1, t.run(1)); + } + + /** + * @title s. Argument = 127 + */ + public void testB1() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(127, t.run(127)); + } + + /** + * @title s. Argument = 128 + */ + public void testB2() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-128, t.run(128)); + } + + /** + * @title s. Argument = 0 + */ + public void testB3() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(0, t.run(0)); + } + + /** + * @title s. Argument = -128 + */ + public void testB4() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-128, t.run(-128)); + } + + /** + * @title s. Argument = -129 + */ + public void testB5() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(127, t.run(-129)); + } + + /** + * @title s. Argument = Integer.MAX_VALUE + */ + public void testB6() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(-1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title s. Argument = Integer.MIN_VALUE + */ + public void testB7() { + T_int_to_byte_1 t = new T_int_to_byte_1(); + assertEquals(0, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_1.java new file mode 100644 index 00000000..918bc55f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_byte.jm; + +public class T_int_to_byte_1 { + + public byte run(int a) { + return (byte) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_3.java new file mode 100644 index 00000000..f3d0a687 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_byte.jm; + +public class T_int_to_byte_3 { + + public byte run(double a) { + return (byte) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_4.java new file mode 100644 index 00000000..c8e9f993 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_byte.jm; + +public class T_int_to_byte_4 { + + public byte run(long a) { + return (byte) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_char/Test_int_to_char.java b/jack-tests/tests/com/android/jack/opcodes/int_to_char/Test_int_to_char.java new file mode 100644 index 00000000..291e6c92 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_char/Test_int_to_char.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_char; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_char.jm.T_int_to_char_1; +import com.android.jack.opcodes.int_to_char.jm.T_int_to_char_3; +import com.android.jack.opcodes.int_to_char.jm.T_int_to_char_4; + + +public class Test_int_to_char extends DxTestCase { + + /** + * @title Argument = 65 + */ + public void testN1() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('A', t.run(65)); + } + + /** + * @title Argument = 65537 + */ + public void testN2() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\u0001', t.run(65537)); + } + + /** + * @title Argument = -2 + */ + public void testN3() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\ufffe', t.run(-2)); + } + + /** + * @title Argument = 0x110000 + */ + public void testN4() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\u0000', t.run(0x110000)); + } + + /** + * @title Argument = 65 + */ + public void testN5() { + T_int_to_char_3 t = new T_int_to_char_3(); + assertEquals('A', t.run(65)); + } + + /** + * @title Argument = 65 + */ + public void testN6() { + T_int_to_char_4 t = new T_int_to_char_4(); + assertEquals('A', t.run(65)); + } + + /** + * @title Argument = 0 + */ + public void testB1() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\u0000', t.run(0)); + } + + /** + * @title Argument = 65535 + */ + public void testB2() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\uffff', t.run(65535)); + } + + /** + * @title Argument = Integer.MAX_VALUE + */ + public void testB3() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\uffff', t.run(Integer.MAX_VALUE)); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB4() { + T_int_to_char_1 t = new T_int_to_char_1(); + assertEquals('\u0000', t.run(Integer.MIN_VALUE)); + } + + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_1.java new file mode 100644 index 00000000..9ac1e521 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_char.jm; + +public class T_int_to_char_1 { + + public char run(int a) { + return (char) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_3.java new file mode 100644 index 00000000..13975689 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_char.jm; + +public class T_int_to_char_3 { + + public char run(double a) { + return (char) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_4.java new file mode 100644 index 00000000..516eccab --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_char.jm; + +public class T_int_to_char_4 { + + public char run(long a) { + return (char) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_double/Test_int_to_double.java b/jack-tests/tests/com/android/jack/opcodes/int_to_double/Test_int_to_double.java new file mode 100644 index 00000000..5512fc27 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_double/Test_int_to_double.java @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_double.jm.T_int_to_double_1; + + +public class Test_int_to_double extends DxTestCase { + + /** + * @title Argument = 300000000 + */ + public void testN1() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(300000000d, t.run(300000000), 0d); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(1d, t.run(1), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(-1d, t.run(-1), 0d); + } + + + /** + * @title Argument = Integer.MAX_VALUE + */ + public void testB1() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(2147483647d, t.run(Integer.MAX_VALUE), 0d); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB2() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(-2147483648d, t.run(Integer.MIN_VALUE), 0d); + } + + /** + * @title Argument = 0 + */ + public void testB3() { + T_int_to_double_1 t = new T_int_to_double_1(); + assertEquals(0d, t.run(0), 0d); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_1.java new file mode 100644 index 00000000..b523a884 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_double.jm; + +public class T_int_to_double_1 { + + public double run(int a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_3.java new file mode 100644 index 00000000..ac739bed --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_double.jm; + +public class T_int_to_double_3 { + + public double run(float a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_4.java new file mode 100644 index 00000000..bc11c753 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_double.jm; + +public class T_int_to_double_4 { + + public double run(long a) { + return (double) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_float/Test_int_to_float.java b/jack-tests/tests/com/android/jack/opcodes/int_to_float/Test_int_to_float.java new file mode 100644 index 00000000..641ee486 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_float/Test_int_to_float.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_float.jm.T_int_to_float_1; +import com.android.jack.opcodes.int_to_float.jm.T_int_to_float_3; +import com.android.jack.opcodes.int_to_float.jm.T_int_to_float_4; + + +public class Test_int_to_float extends DxTestCase { + + /** + * @title Argument = 123456 + */ + public void testN1() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(123456f, t.run(123456), 0f); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(1f, t.run(1), 0f); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(-1f, t.run(-1), 0f); + } + + /** + * @title Argument = 33564439 + */ + public void testN4() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(3.356444E7f, t.run(33564439), 0f); + } + + /** + * @title Argument = 33564439 + */ + public void testN5() { + T_int_to_float_3 t = new T_int_to_float_3(); + assertEquals(3.356444E7f, t.run(33564439), 0f); + } + + /** + * @title Argument = 33564439 + */ + public void testN6() { + T_int_to_float_4 t = new T_int_to_float_4(); + assertEquals(3.356444E7f, t.run(33564439), 0f); + } + + /** + * @title Argument = 0 + */ + public void testB1() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(0f, t.run(0), 0f); + } + + /** + * @title Argument = Argument = Integer.MAX_VALUE + */ + public void testB2() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(2147483650f, t.run(Integer.MAX_VALUE), 0f); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB3() { + T_int_to_float_1 t = new T_int_to_float_1(); + assertEquals(-2147483650f, t.run(Integer.MIN_VALUE), 0f); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_1.java new file mode 100644 index 00000000..7b79780a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_float.jm; + +public class T_int_to_float_1 { + + public float run(int a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_3.java new file mode 100644 index 00000000..36b7ee37 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_float.jm; + +public class T_int_to_float_3 { + + public float run(double a) { + return (float)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_4.java new file mode 100644 index 00000000..ce5a2ce2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_float.jm; + +public class T_int_to_float_4 { + + public float run(long a) { + return (float) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_long/Test_int_to_long.java b/jack-tests/tests/com/android/jack/opcodes/int_to_long/Test_int_to_long.java new file mode 100644 index 00000000..78c6f9fa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_long/Test_int_to_long.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_long.jm.T_int_to_long_1; +import com.android.jack.opcodes.int_to_long.jm.T_int_to_long_3; +import com.android.jack.opcodes.int_to_long.jm.T_int_to_long_4; + + +public class Test_int_to_long extends DxTestCase { + + /** + * @title Argument = 123456 + */ + public void testN1() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(123456l, t.run(123456)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(1l, t.run(1)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_int_to_long_3 t = new T_int_to_long_3(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_int_to_long_4 t = new T_int_to_long_4(); + assertEquals(-1l, t.run(-1)); + } + + /** + * @title Argument = 0 + */ + public void testB1() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(0l, t.run(0)); + } + + /** + * @title Argument = Integer.MAX_VALUE + */ + public void testB2() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(2147483647l, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB3() { + T_int_to_long_1 t = new T_int_to_long_1(); + assertEquals(-2147483648l, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_1.java new file mode 100644 index 00000000..aa021c1e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_long.jm; + +public class T_int_to_long_1 { + + public long run(int a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_3.java new file mode 100644 index 00000000..8f0bc4f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_long.jm; + +public class T_int_to_long_3 { + + public long run(double a) { + return (long)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_4.java new file mode 100644 index 00000000..54414f92 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_long.jm; + +public class T_int_to_long_4 { + + public long run(long a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_short/Test_int_to_short.java b/jack-tests/tests/com/android/jack/opcodes/int_to_short/Test_int_to_short.java new file mode 100644 index 00000000..4b6ee234 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_short/Test_int_to_short.java @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_short; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.int_to_short.jm.T_int_to_short_1; +import com.android.jack.opcodes.int_to_short.jm.T_int_to_short_3; +import com.android.jack.opcodes.int_to_short.jm.T_int_to_short_4; + + +public class Test_int_to_short extends DxTestCase { + + /** + * @title Argument = 1 + */ + public void testN1() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(1, t.run(1)); + } + + /** + * @title Argument = -1 + */ + public void testN2() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(-1, t.run(-1)); + } + + /** + * @title Argument = 32767 + */ + public void testN3() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(32767, t.run(32767)); + } + + /** + * @title Argument = -32768 + */ + public void testN4() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(-32768, t.run(-32768)); + } + + /** + * @title Argument = -32769 + */ + public void testN5() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(32767, t.run(-32769)); + } + + /** + * @title Argument = 32768 + */ + public void testN6() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(-32768, t.run(32768)); + } + + /** + * @title Argument = 0x10fedc; + */ + public void testN7() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(0xfffffedc, t.run(0x10fedc)); + } + + /** + * @title Argument = 0x10fedc; + */ + public void testN8() { + T_int_to_short_3 t = new T_int_to_short_3(); + assertEquals(0xfffffedc, t.run(0x10fedc)); + } + + /** + * @title Argument = 0x10fedc; + */ + public void testN9() { + T_int_to_short_4 t = new T_int_to_short_4(); + assertEquals(0xfffffedc, t.run(0x10fedc)); + } + + + /** + * @title Argument = 0 + */ + public void testB1() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(0, t.run(0)); + } + + /** + * @title Argument = Integer.MAX_VALUE + */ + public void testB2() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(-1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB3() { + T_int_to_short_1 t = new T_int_to_short_1(); + assertEquals(0, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_1.java b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_1.java new file mode 100644 index 00000000..4afb7ee4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_short.jm; + +public class T_int_to_short_1 { + + public short run(int a) { + return (short)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_3.java b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_3.java new file mode 100644 index 00000000..5543f6b2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_short.jm; + +public class T_int_to_short_3 { + + public short run(double a) { + return (short)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_4.java b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_4.java new file mode 100644 index 00000000..0a866511 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.int_to_short.jm; + +public class T_int_to_short_4 { + + public short run(long a) { + return (short)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_direct/Test_invoke_direct.java b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/Test_invoke_direct.java new file mode 100644 index 00000000..724a5b67 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/Test_invoke_direct.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_direct; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.invoke_direct.jm.T_invoke_direct_2; +import com.android.jack.opcodes.invoke_direct.jm.T_invoke_direct_21; + + + +public class Test_invoke_direct extends DxTestCase { + + /** + * @title private method call + */ + public void testN2() { + T_invoke_direct_2 t = new T_invoke_direct_2(); + assertEquals(345, t.run()); + } + + /** + * @title Check that new frame is created by invokespecial + */ + public void testN7() { + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper + T_invoke_direct_21 t = new T_invoke_direct_21(); + assertEquals(1, t.run()); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/TSuper.java b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/TSuper.java new file mode 100644 index 00000000..a500d944 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/TSuper.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.opcodes.invoke_direct.jm; + +/** + * @author fjost + * + */ +public class TSuper { + public int toInt() { + return 5; + } + + public int toInt(float v) { + return (int)v; + } + + public int testArgsOrder(int a, int b) { + return a/b; + } + + public native int toIntNative(); + + public static int toIntStatic() { + return 5; + } + + protected int toIntP() { + return 5; + } + + private int toIntPvt() { + return 5; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_2.java new file mode 100644 index 00000000..7cbab105 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_2.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_direct.jm; + +public class T_invoke_direct_2 { + + public int run() { + return getInt(); + } + + private int getInt() { + return 345; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_21.java b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_21.java new file mode 100644 index 00000000..bba82e72 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_21.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_direct.jm; + +public class T_invoke_direct_21 extends TSuper { + + + private int test(int a, int b) { + int i = 0; + int j = 0; + return 5; + } + + public int run() { + int i = 123; + int j = 456; + test(0, 1); + + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/Test_invoke_interface.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/Test_invoke_interface.java new file mode 100644 index 00000000..c1a4fa3b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/Test_invoke_interface.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.invoke_interface.jm.ITestImpl; +import com.android.jack.opcodes.invoke_interface.jm.T_invoke_interface_1; +import com.android.jack.opcodes.invoke_interface.jm.T_invoke_interface_12; +import com.android.jack.opcodes.invoke_interface.jm.T_invoke_interface_14; +import com.android.jack.opcodes.invoke_interface.jm.T_invoke_interface_19; +import com.android.jack.opcodes.invoke_interface.jm.T_invoke_interface_2; + + +public class Test_invoke_interface extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_invoke_interface_1 t = new T_invoke_interface_1(); + assertEquals(0, t.run("aa", "aa")); + assertEquals(-1, t.run("aa", "bb")); + assertEquals(1, t.run("bb", "aa")); + } + + /** + * @title Check that new frame is created by invoke_interface and + * arguments are passed to method + */ + public void testN2() { + //@uses com.android.jack.opcodes.invoke_interface.jm.ITest + //@uses com.android.jack.opcodes.invoke_interface.jm.ITestImpl + T_invoke_interface_14 t = new T_invoke_interface_14(); + ITestImpl impl = new ITestImpl(); + assertEquals(1, t.run(impl)); + } + + /** + * @title Check that monitor is acquired if method is synchronized + */ + public void testN3() { + //@uses com.android.jack.opcodes.invoke_interface.jm.ITest + assertTrue(T_invoke_interface_19.execute()); + } + + /** + * @title expected NullPointerException + */ + public void testE3() { + //@uses com.android.jack.opcodes.invoke_interface.jm.ITest + try { + new T_invoke_interface_2(null); + fail("expected NullPointerException"); + } catch (NullPointerException npe) { + // expected + } + } + + /** + * @title Native method can't be linked + */ + public void testE5() { + //@uses com.android.jack.opcodes.invoke_interface.jm.ITest + //@uses com.android.jack.opcodes.invoke_interface.jm.ITestImpl + T_invoke_interface_12 t = new T_invoke_interface_12(); + ITestImpl impl = new ITestImpl(); + try { + t.run(impl); + fail("expected UnsatisfiedLinkError"); + } catch (UnsatisfiedLinkError e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITest.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITest.java new file mode 100644 index 00000000..7aec0795 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITest.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public interface ITest { + public void doit(); + public void doit(int i); + public void doitNative(); + public int test(int a); + public int testArgsOrder(int a, int b); +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImpl.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImpl.java new file mode 100644 index 00000000..6d5f0d8f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImpl.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class ITestImpl implements ITest { + public void doit() { + // impl + } + + public void doit(int i) { + // + } + + public native void doitNative(); + + public int test(int a) { + if (a == 999) return 195; + return 0; + } + + public int testArgsOrder(int a, int b) { + return a / b; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImplAbstract.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImplAbstract.java new file mode 100644 index 00000000..862c55e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImplAbstract.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +abstract class ITestImplAbstract implements ITest { + abstract public void doit(); + abstract public void doit(int i); + public native void doitNative(); +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_1.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_1.java new file mode 100644 index 00000000..ac476fea --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_1 { + + public int run(Comparable c, Object o) { + return c.compareTo(o); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_12.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_12.java new file mode 100644 index 00000000..300faddc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_12.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_12 { + + public void run(ITest test) { + test.doitNative(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_14.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_14.java new file mode 100644 index 00000000..248a9c41 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_14.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_14 { + + public int run(ITest test) { + int a = 123; + int b = 345; + if(test.testArgsOrder(64, 2) == 32) + { + if(a == 123) + if(b == 345) + return 1; + } + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_17.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_17.java new file mode 100644 index 00000000..4b8558fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_17.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_17 { + + public void run(ITest test) { + test.test(1); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_19.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_19.java new file mode 100644 index 00000000..ab5cdbf4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_19.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + + +public class T_invoke_interface_19 implements Runnable, ITest { + public final static int CNT = 1000; + int value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + doit(); + } + } + + public synchronized void doit(){ + value++; + int c = value; + Thread.yield(); + if(c != value) + failed = true; + } + public void doit(int i){ + } + public void doitNative(){ + } + public int test(int a) { + return 0; + } + public int testArgsOrder(int a, int b){ + return 0; + } + + public static boolean execute() { + T_invoke_interface_19 test = new T_invoke_interface_19(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_2.java new file mode 100644 index 00000000..bc104809 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_2 { + + public T_invoke_interface_2 (ITest test) { + test.doit(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_23.java b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_23.java new file mode 100644 index 00000000..a6cef6cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_23.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_interface.jm; + +public class T_invoke_interface_23 { + + public T_invoke_interface_23 (ITest test) { + test.doit(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/TestStubs.java new file mode 100644 index 00000000..b035960e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/TestStubs.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static; + +public class TestStubs { + + protected void TestStub() { + // used by testE9 + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/Test_invoke_static.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/Test_invoke_static.java new file mode 100644 index 00000000..8f9eb5ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/Test_invoke_static.java @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_1; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_12; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_13; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_14; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_15; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_18; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_2; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_4; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_5; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_6; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_7; +import com.android.jack.opcodes.invoke_static.jm.T_invoke_static_8; + + +public class Test_invoke_static extends DxTestCase { + + /** + * @title Static method from library class Math + */ + public void testN1() { + T_invoke_static_1 t = new T_invoke_static_1(); + assertEquals(1234567, t.run()); + } + + /** + * @title Static method from user class + */ + public void testN2() { + // @uses com.android.jack.opcodes.invoke_static.jm.TestClass + T_invoke_static_2 t = new T_invoke_static_2(); + assertEquals(777, t.run()); + } + + /** + * @title Check that is called + */ + public void testN3() { + assertEquals(123456789l, T_invoke_static_4.run()); + } + + /** + * @title Check that monitor is acquired if method is synchronized + */ + public void testN4() { + assertTrue(T_invoke_static_12.execute()); + } + + /** + * @title Check that new frame is created by invoke_static and + * arguments are passed to method + */ + public void testN5() { + // @uses com.android.jack.opcodes.invoke_static.jm.TestClass + T_invoke_static_15 t = new T_invoke_static_15(); + assertTrue(t.run()); + } + + /** + * @title Static protected method from other class in the same package + */ + public void testN6() { + // @uses com.android.jack.opcodes.invoke_static.jm.TestClass + T_invoke_static_18 t = new T_invoke_static_18(); + assertEquals(888, t.run()); + } + + /** + * @title attempt to call non-static method + * + */ + public void testE1() { + T_invoke_static_5 t = new T_invoke_static_5(); + t.run(); + } + + /** + * @title Native method can't be linked + * + */ + public void testE2() { + T_invoke_static_6 t = new T_invoke_static_6(); + try { + t.run(); + fail("expected UnsatisfiedLinkError"); + } catch (UnsatisfiedLinkError ule) { + // expected + } + } + + public void testN7() { + T_invoke_static_7 t = new T_invoke_static_7(); + t.run(); + } + + public void testN8() { + T_invoke_static_8 t = new T_invoke_static_8(); + t.run(); + } + + public void testN9() { + T_invoke_static_13 t = new T_invoke_static_13(); + t.run(); + } + + /** + * @title initialization of referenced class throws exception + */ + public void testE7() { + // @uses com.android.jack.opcodes.invoke_static.jm.TestClassInitError + T_invoke_static_14 t = new T_invoke_static_14(); + try { + t.run(); + fail("expected Error"); + } catch (Error e) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_1.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_1.java new file mode 100644 index 00000000..12ef1687 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_1 { + + public int run() { + return Math.abs(-1234567); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_12.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_12.java new file mode 100644 index 00000000..deb94a1f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_12.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_12 implements Runnable { + public final static int CNT = 1000; + static int value = 0; + static boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized static void test() { + value++; + int c = value; + Thread.yield(); + if(c != value) + failed = true; + } + + public static boolean execute() { + T_invoke_static_12 test = new T_invoke_static_12(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(value != CNT * 2) + return false; + return !failed; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_13.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_13.java new file mode 100644 index 00000000..68ba42bc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_13.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_13 { + + public void run(){ + TestClass.test1(1); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_14.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_14.java new file mode 100644 index 00000000..b8c0ce1c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_14.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_14 { + + public void run(){ + TestClassInitError.test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_15.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_15.java new file mode 100644 index 00000000..c24221dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_15.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_15 { + + public boolean run(){ + int i = 123; + int j = 345; + if(TestClass.testArgsOrder(12, 2) == 6) + if(i == 123) + if(j == 345) + return true; + return false; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_18.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_18.java new file mode 100644 index 00000000..b0f21e4c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_18.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +import com.android.jack.opcodes.invoke_static.jm.TestClass; + +public class T_invoke_static_18 { + + public int run() { + return TestClass.testP(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_2.java new file mode 100644 index 00000000..58f2bda8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +import com.android.jack.opcodes.invoke_static.jm.TestClass; + +public class T_invoke_static_2 { + + public int run() { + return TestClass.test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_20.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_20.java new file mode 100644 index 00000000..8e9cf364 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_20.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_20 { + + public int run() { + return Math.abs(-1234567); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_4.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_4.java new file mode 100644 index 00000000..daec2a91 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_4.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_4 { + + static long v2 = 123456789l; + + public static long run() { + return v2; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_5.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_5.java new file mode 100644 index 00000000..ab84180a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_5.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_5 { + + public int run() { + return test(5); + } + + public int test(int i1) { + return i1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_6.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_6.java new file mode 100644 index 00000000..d75bff24 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_6.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_6 { + + public static native void test(); + + public void run() { + test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_7.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_7.java new file mode 100644 index 00000000..3053da95 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_7.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_7 { + + public static void test(){ + } + + public void run(){ + test(); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_8.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_8.java new file mode 100644 index 00000000..f4b6b33a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_8.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class T_invoke_static_8 { + + public void run(){ + TestClass.test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClass.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClass.java new file mode 100644 index 00000000..61227ae6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClass.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class TestClass { + + public static int test(){ + return 777; + } + + public static int test1(int i1){ + int i = i1 + 5; + return i; + } + + public static int testArgsOrder(int i1, int i2){ + int a = 3454; + int b = 2302; + int i = i1 / i2; + return i; + } + + protected static int testP(){ + return 888; + } + + private static void testPvt(){ + + } +} + diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassAbstract.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassAbstract.java new file mode 100644 index 00000000..fd9a847a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassAbstract.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public abstract class TestClassAbstract { + + public abstract void test(); +} + diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassInitError.java b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassInitError.java new file mode 100644 index 00000000..93965017 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_static/jm/TestClassInitError.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_static.jm; + +public class TestClassInitError { + static int a = 1 / 0; + public static void test() { + + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/Test_invoke_super.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/Test_invoke_super.java new file mode 100644 index 00000000..8b1539a0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/Test_invoke_super.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.invoke_super.jm.T_invoke_super_1; +import com.android.jack.opcodes.invoke_super.jm.T_invoke_super_15; +import com.android.jack.opcodes.invoke_super.jm.T_invoke_super_18; +import com.android.jack.opcodes.invoke_super.jm.T_invoke_super_19; +import com.android.jack.opcodes.invoke_super.jm.T_invoke_super_26; + + +public class Test_invoke_super extends DxTestCase { + /** + * @title Superclass' method call + */ + public void testN1() { + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper + T_invoke_super_1 t = new T_invoke_super_1(); + assertEquals(5, t.run()); + } + + /** + * @title Invoke method of superclass of superclass + */ + public void testN3() { + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper2 + T_invoke_super_15 t = new T_invoke_super_15(); + assertEquals(5, t.run()); + } + + /** + * @title Invoke protected method of superclass if method with the + * same name exists in "this" class + */ + public void testN5() { + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper + T_invoke_super_18 t = new T_invoke_super_18(); + assertEquals(5, t.run()); + } + + /** + * @title Check that method's arguments are popped from stack + */ + public void testN6() { + //@uses com.android.jack.opcodes.invokespecial.jm.TSuper + T_invoke_super_19 t = new T_invoke_super_19(); + assertEquals(2, t.run()); + } + + public void testN10() { + T_invoke_super_26 t = new T_invoke_super_26(); + assertEquals(13, t.run()); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper.java new file mode 100644 index 00000000..47201f20 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.opcodes.invoke_super.jm; + +/** + * @author fjost + * + */ +public class TSuper { + public int toInt() { + return 5; + } + + public int toInt(float v) { + return (int)v; + } + + public int testArgsOrder(int a, int b) { + return a/b; + } + + public native int toIntNative(); + + public static int toIntStatic() { + return 5; + } + + protected int toIntP() { + return 5; + } + + private int toIntPvt() { + return 5; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper2.java new file mode 100644 index 00000000..8b512fb2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/TSuper2.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.opcodes.invoke_super.jm; + +/** + * @author fjost + * + */ +public class TSuper2 extends TSuper { + + public int test() { + return 13; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_1.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_1.java new file mode 100644 index 00000000..e2a2f1cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_1.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_1 extends TSuper { + + public int run() { + return super.toInt(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_14.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_14.java new file mode 100644 index 00000000..e65cc124 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_14.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_14 extends TSuper { + + public int run() { + return super.toInt(5f); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_15.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_15.java new file mode 100644 index 00000000..3387cc83 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_15.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_15 extends TSuper2 { + + public int run() { + return super.toInt(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_18.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_18.java new file mode 100644 index 00000000..2cd09a94 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_18.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_18 extends TSuper { + + protected int toIntP() { + return 10; + } + + public int run() { + return super.toIntP(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_19.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_19.java new file mode 100644 index 00000000..dab3c0ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_19.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_19 extends TSuper { + + public int run() { + return super.testArgsOrder(128, 64); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_26.java b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_26.java new file mode 100644 index 00000000..d19103f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_26.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_super.jm; + + +public class T_invoke_super_26 extends TSuper2 { + + public int run() { + return super.test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/TProtected.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/TProtected.java new file mode 100644 index 00000000..ccffbeb7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/TProtected.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual; + +public class TProtected { + + @SuppressWarnings("unused") + private void TestStub() { + // used by testE6 + } + + + protected void TestStubP() { + // used by testE7 + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/Test_invoke_virtual.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/Test_invoke_virtual.java new file mode 100644 index 00000000..f435bb22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/Test_invoke_virtual.java @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_1; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_13; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_14; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_17; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_19; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_2; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_22; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_23; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_4; +import com.android.jack.opcodes.invoke_virtual.jm.T_invoke_virtual_7; + + +public class Test_invoke_virtual extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_invoke_virtual_1 t = new T_invoke_virtual_1(); + int a = 1; + String sa = "a" + a; + String sb = "a1"; + assertTrue(t.run(sa, sb)); + assertFalse(t.run(this, sa)); + assertFalse(t.run(sb, this)); + } + + /** + * @title Check that monitor is acquired if method is synchronized + */ + public void testN2() { + assertTrue(T_invoke_virtual_2.execute()); + } + + /** + * @title Invoke protected method of superclass + */ + public void testN3() { + // @uses com.android.jack.opcodes.invoke_virtual.jm.TSuper + T_invoke_virtual_7 t = new T_invoke_virtual_7(); + assertEquals(5, t.run()); + } + + /** + * @title Private method call + */ + public void testN4() { + T_invoke_virtual_13 t = new T_invoke_virtual_13(); + assertEquals(345, t.run()); + } + + /** + * @title Check that new frame is created by invoke_virtual and + * arguments are passed to method + */ + public void testN5() { + // @uses com.android.jack.opcodes.invoke_virtual.jm.TSuper + T_invoke_virtual_14 t = new T_invoke_virtual_14(); + assertTrue(t.run()); + } + + /** + * @title Recursion of method lookup procedure + */ + public void testN6() { + // @uses com.android.jack.opcodes.invoke_virtual.jm.TSuper + T_invoke_virtual_17 t = new T_invoke_virtual_17(); + assertEquals(5, t.run()); + } + + /** + * @title Recursion of method lookup procedure + */ + public void testN7() { + // @uses com.android.jack.opcodes.invoke_virtual.jm.TSuper + T_invoke_virtual_19 t = new T_invoke_virtual_19(); + assertEquals(3, t.run()); + } + + public void testN8() { + T_invoke_virtual_22 t = new T_invoke_virtual_22(); + assertEquals(1, t.run()); + } + + public void testN9() { + T_invoke_virtual_23 t = new T_invoke_virtual_23(); + assertEquals(13, t.run()); + } + + /** + * @title + */ + public void testE1() { + T_invoke_virtual_1 t = new T_invoke_virtual_1(); + String s = "s"; + try { + t.run(null, s); + fail("expected NullPointerException"); + } catch (NullPointerException npe) { + // expected + } + } + + /** + * @title Native method can't be linked + */ + public void testE2() { + T_invoke_virtual_4 t = new T_invoke_virtual_4(); + try { + t.run(); + fail("expected UnsatisfiedLinkError"); + } catch (UnsatisfiedLinkError ule) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/ATest.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/ATest.java new file mode 100644 index 00000000..f5a26ced --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/ATest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public abstract class ATest { + + public abstract void test(); + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TPlain.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TPlain.java new file mode 100644 index 00000000..603a9215 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TPlain.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.opcodes.invoke_virtual.jm; + +/** + * @author fjost + * + */ +public class TPlain { + public int toInt() { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper.java new file mode 100644 index 00000000..6a6f2bde --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.opcodes.invoke_virtual.jm; + +/** + * @author fjost + * + */ +public class TSuper { + public int toInt() { + return 5; + } + + public int toInt(float v) { + return (int)v; + } + + public native int toIntNative(); + + public static int toIntStatic() { + return 5; + } + + protected int toIntP() { + return 5; + } + + private int toIntPvt() { + return 5; + } + + public int testArgsOrder(int a, int b){ + int i = 349; + int j = 344656; + return a / b; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper2.java new file mode 100644 index 00000000..e616a7e2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class TSuper2 extends TSuper { + + public int test() { + return 13; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_1.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_1.java new file mode 100644 index 00000000..8ec270a7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class T_invoke_virtual_1 { + + public boolean run(Object x, Object y) { + return x.equals(y); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_13.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_13.java new file mode 100644 index 00000000..c33299e0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_13.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class T_invoke_virtual_13 { + + public int run() { + return getInt(); + } + + private int getInt() { + return 345; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_14.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_14.java new file mode 100644 index 00000000..ecff4fcf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_14.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +import com.android.jack.opcodes.invoke_virtual.jm.TSuper; + + +public class T_invoke_virtual_14 extends TSuper { + + public boolean run() { + int a = 123; + int b = 659; + if(testArgsOrder(300, 3) == 100) + if(a == 123) + if(b == 659) + return true; + return false; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_17.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_17.java new file mode 100644 index 00000000..b623f89e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_17.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +import com.android.jack.opcodes.invoke_virtual.jm.TSuper; + + +public class T_invoke_virtual_17 extends TSuper { + + public int run() { + return toInt(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_19.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_19.java new file mode 100644 index 00000000..be408339 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_19.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +import com.android.jack.opcodes.invoke_virtual.jm.TSuper; + + +public class T_invoke_virtual_19 extends TSuper { + + public int run() { + return toInt(3.14f); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_2.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_2.java new file mode 100644 index 00000000..262ceed3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_2.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class T_invoke_virtual_2 implements Runnable { + public final static int CNT = 1000; + int value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + public synchronized void test() { + value++; + int c = value; + Thread.yield(); + if(c != value) + failed = true; + } + + public static boolean execute() { + T_invoke_virtual_2 test = new T_invoke_virtual_2(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_22.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_22.java new file mode 100644 index 00000000..06fe65be --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_22.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +import com.android.jack.opcodes.invoke_virtual.jm.TSuper; + +public class T_invoke_virtual_22 extends TSuper { + + public int run() { + TPlain p = new TPlain(); + return p.toInt(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_23.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_23.java new file mode 100644 index 00000000..581b46e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_23.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class T_invoke_virtual_23 extends TSuper2 { + + public int run() { + return super.test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_4.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_4.java new file mode 100644 index 00000000..ed9c2a49 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_4.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +public class T_invoke_virtual_4 { + + public native void test(); + + public void run() { + test(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_7.java b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_7.java new file mode 100644 index 00000000..9bd78f97 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_7.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.invoke_virtual.jm; + +import com.android.jack.opcodes.invoke_virtual.jm.TSuper; + + +public class T_invoke_virtual_7 extends TSuper { + + public int run() { + return toIntP(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/TIput.java b/jack-tests/tests/com/android/jack/opcodes/iput/TIput.java new file mode 100644 index 00000000..e84e479f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/TIput.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput; + +class TIput { + // used by testE2 + @SuppressWarnings("unused") + private int TestStubField = 0; + + // used by testE7 + protected int TestStubFieldP = 0; + + // used by testE5 + public final int TestStubFieldFinal = 0; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/Test_iput.java b/jack-tests/tests/com/android/jack/opcodes/iput/Test_iput.java new file mode 100644 index 00000000..3ba68e18 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/Test_iput.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.iput.jm.T_iput_1; +import com.android.jack.opcodes.iput.jm.T_iput_12; +import com.android.jack.opcodes.iput.jm.T_iput_14; +import com.android.jack.opcodes.iput.jm.T_iput_16; +import com.android.jack.opcodes.iput.jm.T_iput_18; +import com.android.jack.opcodes.iput.jm.T_iput_2; + + +public class Test_iput extends DxTestCase { + + /** + * @title type - int + */ + public void testN1() { + T_iput_1 t = new T_iput_1(); + assertEquals(0, t.st_i1); + t.run(); + assertEquals(1000000, t.st_i1); + } + + /** + * @title type - double + */ + public void testN2() { + T_iput_2 t = new T_iput_2(); + assertEquals(0d, t.st_d1); + t.run(); + assertEquals(1000000d, t.st_d1); + } + + /** + * @title modification of final field + */ + public void testN3() { + T_iput_12 t = new T_iput_12(); + assertEquals(0, t.st_i1); + t.run(); + assertEquals(1000000, t.st_i1); + } + + /** + * @title modification of protected field from subclass + */ + public void testN4() { + // @uses com.android.jack.opcodes.iput.jm.T_iput_1 + T_iput_14 t = new T_iput_14(); + assertEquals(0, t.getProtectedField()); + t.run(); + assertEquals(1000000, t.getProtectedField()); + } + + /** + * @title assignment compatible object references + */ + public void testN5() { + // @uses com.android.jack.opcodes.iput.jm.TChild + // @uses com.android.jack.opcodes.iput.jm.TSuper + T_iput_18 t = new T_iput_18(); + assertEquals(0, t.run().compareTo("xyz")); + } + + /** + * @title assignment compatible values + */ + public void testN6() { + T_iput_16 t = new T_iput_16(); + assertNull(t.o); + t.run(); + assertEquals("", (String) t.o); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_1.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_1.java new file mode 100644 index 00000000..04b3b2eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_1.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_1 { + public int st_i1; + protected int st_p1; + private int st_pvt1; + + public void run() { + st_i1 = 1000000; + } + + public int getPvtField() + { + return st_pvt1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_12.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_12.java new file mode 100644 index 00000000..6110ba81 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_12.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_12 { + public int st_i1; + + public void run() { + st_i1 = 1000000; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_14.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_14.java new file mode 100644 index 00000000..93ed641d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_14.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_14 extends T_iput_1{ + + public void run() { + st_p1 = 1000000; + } + + public int getProtectedField(){ + return st_p1; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_16.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_16.java new file mode 100644 index 00000000..7f957669 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_16.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_16 { + + public Object o = null; + + public void run() { + String s = new String(""); + o = s; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_18.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_18.java new file mode 100644 index 00000000..40dcd32b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_18.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_18 { + + public String run() { + TChild c = new TChild(); + c.s = "xyz"; + return c.s; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_2.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_2.java new file mode 100644 index 00000000..257cbb8e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/T_iput_2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + +public class T_iput_2 { + + public double st_d1; + + public void run() { + st_d1 = 1000000d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/iput/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/iput/jm/TestStubs.java new file mode 100644 index 00000000..389f9d50 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/iput/jm/TestStubs.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.iput.jm; + + + +class TSuper { + public String s = "abc"; +} + +class TChild extends TSuper { + public Object o = null; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_double/Test_long_to_double.java b/jack-tests/tests/com/android/jack/opcodes/long_to_double/Test_long_to_double.java new file mode 100644 index 00000000..476979cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_double/Test_long_to_double.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.long_to_double.jm.T_long_to_double_1; +import com.android.jack.opcodes.long_to_double.jm.T_long_to_double_3; +import com.android.jack.opcodes.long_to_double.jm.T_long_to_double_4; + + +public class Test_long_to_double extends DxTestCase { + + /** + * @title Argument = 50000000000 + */ + public void testN1() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(5.0E10d, t.run(50000000000l), 0d); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(1d, t.run(1l), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(-1d, t.run(-1l), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_long_to_double_3 t = new T_long_to_double_3(); + assertEquals(-1d, t.run(-1l), 0d); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_long_to_double_4 t = new T_long_to_double_4(); + assertEquals(-1d, t.run(-1), 0d); + } + + /** + * @title Argument = Long.MAX_VALUE + */ + public void testB1() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(9.223372036854776E18d, t.run(Long.MAX_VALUE), 0d); + } + + /** + * @title Argument = Long.MIN_VALUE + */ + public void testB2() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(-9.223372036854776E18, t.run(Long.MIN_VALUE), 0d); + } + + /** + * @title Argument = 0 + */ + public void testB3() { + T_long_to_double_1 t = new T_long_to_double_1(); + assertEquals(0d, t.run(0), 0d); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_1.java b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_1.java new file mode 100644 index 00000000..bb6b351e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_double.jm; + +public class T_long_to_double_1 { + + public double run(long a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_3.java b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_3.java new file mode 100644 index 00000000..61e2333d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_3.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_double.jm; + +public class T_long_to_double_3 { + + public double run(float a) { + return a; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_4.java b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_4.java new file mode 100644 index 00000000..427fdeb2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_double.jm; + +public class T_long_to_double_4 { + + public double run(int a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_float/Test_long_to_float.java b/jack-tests/tests/com/android/jack/opcodes/long_to_float/Test_long_to_float.java new file mode 100644 index 00000000..dba67cc8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_float/Test_long_to_float.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.long_to_float.jm.T_long_to_float_1; +import com.android.jack.opcodes.long_to_float.jm.T_long_to_float_3; +import com.android.jack.opcodes.long_to_float.jm.T_long_to_float_4; + + +public class Test_long_to_float extends DxTestCase { + + /** + * @title Argument = 123456789012345 + */ + public void testN1() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(1.23456788E14f, t.run(123456789012345l), 0f); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(1f, t.run(1l), 0f); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(-1f, t.run(-1l), 0f); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_long_to_float_3 t = new T_long_to_float_3(); + assertEquals(-1f, t.run(-1l), 0f); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_long_to_float_4 t = new T_long_to_float_4(); + assertEquals(-1f, t.run(-1), 0f); + } + + /** + * @title Argument = Long.MAX_VALUE + */ + public void testB1() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(9.223372036854776E18, t.run(Long.MAX_VALUE), 0f); + } + + /** + * @title Argument = Long.MIN_VALUE + */ + public void testB2() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(-9.223372036854776E18, t.run(Long.MIN_VALUE), 0f); + } + + /** + * @title Argument = 0 + */ + public void testB3() { + T_long_to_float_1 t = new T_long_to_float_1(); + assertEquals(0f, t.run(0l), 0f); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_1.java b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_1.java new file mode 100644 index 00000000..e3fd86b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_float.jm; + +public class T_long_to_float_1 { + + public float run(long a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_3.java b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_3.java new file mode 100644 index 00000000..9bc2b482 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_float.jm; + +public class T_long_to_float_3 { + + public float run(double a) { + return (float)a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_4.java b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_4.java new file mode 100644 index 00000000..22201644 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_float.jm; + +public class T_long_to_float_4 { + + public float run(int a) { + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_int/Test_long_to_int.java b/jack-tests/tests/com/android/jack/opcodes/long_to_int/Test_long_to_int.java new file mode 100644 index 00000000..f5a49033 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_int/Test_long_to_int.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.long_to_int.jm.T_long_to_int_1; +import com.android.jack.opcodes.long_to_int.jm.T_long_to_int_3; +import com.android.jack.opcodes.long_to_int.jm.T_long_to_int_4; + + +public class Test_long_to_int extends DxTestCase { + + /** + * @title Argument = 0xAAAAFFEEDDCCl + */ + public void testN1() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(0xFFEEDDCC, t.run(0xAAAAFFEEDDCCl)); + } + + /** + * @title Argument = -123456789 + */ + public void testN2() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(-123456789, t.run(-123456789l)); + } + + /** + * @title Argument = 1 + */ + public void testN3() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(1, t.run(1l)); + } + + /** + * @title Argument = -1 + */ + public void testN4() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_long_to_int_3 t = new T_long_to_int_3(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = -1 + */ + public void testN6() { + T_long_to_int_4 t = new T_long_to_int_4(); + assertEquals(-1, t.run(-1l)); + } + + /** + * @title Argument = Long.MAX_VALUE + */ + public void testB1() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(-1, t.run(Long.MAX_VALUE)); + } + + /** + * @title Argument = Long.MIN_VALUE + */ + public void testB2() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(0, t.run(Long.MIN_VALUE)); + } + + /** + * @title Argument = 0 + */ + public void testB3() { + T_long_to_int_1 t = new T_long_to_int_1(); + assertEquals(0, t.run(0l)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_1.java b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_1.java new file mode 100644 index 00000000..e83c2154 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_int.jm; + +public class T_long_to_int_1 { + + public int run(long a) { + return (int) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_3.java b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_3.java new file mode 100644 index 00000000..a6cc593c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_int.jm; + +public class T_long_to_int_3 { + + public int run(double a) { + return (int) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_4.java b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_4.java new file mode 100644 index 00000000..4348c41b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.long_to_int.jm; + +public class T_long_to_int_4 { + + public int run(float a) { + return (int) a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/monitor_enter/Test_monitor_enter.java b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/Test_monitor_enter.java new file mode 100644 index 00000000..fa31ad4d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/Test_monitor_enter.java @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.monitor_enter; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.monitor_enter.jm.T_monitor_enter_1; +import com.android.jack.opcodes.monitor_enter.jm.T_monitor_enter_2; +import com.android.jack.opcodes.monitor_enter.jm.T_monitor_enter_4; + + +public class Test_monitor_enter extends DxTestCase { + + /** + * @title normal test + * + * @throws InterruptedException + */ + public void testN1() throws InterruptedException { + //@uses com.android.jack.opcodes.monitor_enter.TestRunnable + final T_monitor_enter_1 t1 = new T_monitor_enter_1(); + Runnable r1 = new TestRunnable(t1); + Runnable r2 = new TestRunnable(t1); + Thread tr1 = new Thread(r1); + Thread tr2 = new Thread(r2); + tr1.start(); + tr2.start(); + + tr1.join(); + tr2.join(); + assertEquals(2, t1.counter); + } + + /** + * @title Tests behavior when monitor owned by current thread. + * + * @throws InterruptedException + */ + public void testN2() throws InterruptedException { + //@uses com.android.jack.opcodes.monitor_enter.TestRunnable2 + final T_monitor_enter_2 t1 = new T_monitor_enter_2(); + Runnable r1 = new TestRunnable2(t1, 10); + Runnable r2 = new TestRunnable2(t1, 20); + Thread tr1 = new Thread(r1); + Thread tr2 = new Thread(r2); + tr1.start(); + tr2.start(); + + tr1.join(); + tr2.join(); + assertTrue(t1.result); + } + + + /** + * @title expected NullPointerException + */ + public void testE1() { + T_monitor_enter_4 t = new T_monitor_enter_4(); + try { + t.run(); + fail("expected NullPointerException"); + } catch (NullPointerException npe) { + // expected + } + } + +} + +class TestRunnable implements Runnable { + private T_monitor_enter_1 t1; + TestRunnable(T_monitor_enter_1 t1) { + this.t1 = t1; + } + + public void run() { + try { + t1.run(); + } catch (InterruptedException e) { + throw new RuntimeException("interrupted!"); + } + } +} + +class TestRunnable2 implements Runnable { + private T_monitor_enter_2 t2; + private int val; + TestRunnable2(T_monitor_enter_2 t2, int val) { + this.t2 = t2; + this.val = val; + } + + public void run() { + try { + t2.run(val); + } catch (InterruptedException e) { + throw new RuntimeException("interrupted!"); + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_1.java b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_1.java new file mode 100644 index 00000000..1097f4e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_1.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.monitor_enter.jm; + +public class T_monitor_enter_1 { + public int counter = 0; + + public void run() throws InterruptedException { + synchronized(this) { + int a = counter; + Thread.sleep(500); + counter = ++a; + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_2.java b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_2.java new file mode 100644 index 00000000..9927de6f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_2.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.monitor_enter.jm; + +public class T_monitor_enter_2 { + + private int flg = 0; + public boolean result = true; + + public void run(int v) throws InterruptedException { + synchronized(this) { + synchronized(this) { + flg = v; + } + Thread.sleep(500); + if(flg != v) { + result = false; + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_4.java b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_4.java new file mode 100644 index 00000000..c1103223 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_4.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.monitor_enter.jm; + +public class T_monitor_enter_4 { + + public void run() { + Object o = null; + synchronized(o) { + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_double/Test_mul_double.java b/jack-tests/tests/com/android/jack/opcodes/mul_double/Test_mul_double.java new file mode 100644 index 00000000..66fcd805 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_double/Test_mul_double.java @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.mul_double.jm.T_mul_double_1; +import com.android.jack.opcodes.mul_double.jm.T_mul_double_3; +import com.android.jack.opcodes.mul_double.jm.T_mul_double_4; + + +public class Test_mul_double extends DxTestCase { + + /** + * @title Arguments = 2.7d, 3.14d + */ + + public void testN1() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(8.478000000000002d, t.run(2.7d, 3.14d)); + } + + /** + * @title Arguments = 0, -3.14d + */ + public void testN2() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(-0d, t.run(0, -3.14d)); + } + + /** + * @title Arguments = -2.7d, -3.14d + */ + public void testN3() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(8.478000000000002d, t.run(-3.14d, -2.7d)); + } + + /** + * @title Arguments = -2.7d, -3.14d + */ + public void testN4() { + T_mul_double_3 t = new T_mul_double_3(); + assertEquals(8.478000283241272d, t.run(-3.14f, -2.7d)); + } + + /** + * @title Arguments = -2.7d, -3.14d + */ + public void testN5() { + T_mul_double_4 t = new T_mul_double_4(); + assertEquals(847.8000000000001d, t.run(-314l, -2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.NaN + */ + public void testB1() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(Double.NaN, t.run(Double.MAX_VALUE, Double.NaN)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, 0 + */ + public void testB2() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, 0)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, -2.7d + */ + public void testB3() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + -2.7d)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB4() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = +0, -0d + */ + public void testB5() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(-0d, t.run(+0d, -0d)); + } + + /** + * @title Arguments = -0d, -0d + */ + public void testB6() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(+0d, t.run(-0d, -0d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.MAX_VALUE + */ + public void testB7() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.MAX_VALUE, + Double.MAX_VALUE)); + } + + /** + * @title Arguments = Double.MIN_VALUE, -1.4E-45f + */ + public void testB8() { + T_mul_double_1 t = new T_mul_double_1(); + assertEquals(-0d, t.run(Double.MIN_VALUE, -1.4E-45f)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_1.java b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_1.java new file mode 100644 index 00000000..89881c51 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_double.jm; + +public class T_mul_double_1 { + + public double run(double a, double b) { + return a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_3.java b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_3.java new file mode 100644 index 00000000..024958d9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_double.jm; + +public class T_mul_double_3 { + + public double run(float a, double b) { + return (double)a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_4.java b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_4.java new file mode 100644 index 00000000..2d9a80ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_double.jm; + +public class T_mul_double_4 { + + public double run(long a, double b) { + return (double)a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_float/Test_mul_float.java b/jack-tests/tests/com/android/jack/opcodes/mul_float/Test_mul_float.java new file mode 100644 index 00000000..fe22406f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_float/Test_mul_float.java @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.mul_float.jm.T_mul_float_1; +import com.android.jack.opcodes.mul_float.jm.T_mul_float_3; +import com.android.jack.opcodes.mul_float.jm.T_mul_float_4; + + +public class Test_mul_float extends DxTestCase { + + /** + * @title Arguments = 2.7f, 3.14f + */ + public void testN1() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(8.478001f, t.run(2.7f, 3.14f)); + } + + /** + * @title Arguments = 0, -3.14f + */ + public void testN2() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(-0f, t.run(0, -3.14f)); + } + + /** + * @title Arguments = -2.7f, -3.14f + */ + public void testN3() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(8.478001f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -2.7f, -3.14f + */ + public void testN4() { + T_mul_float_3 t = new T_mul_float_3(); + assertEquals(8.478001f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -2.7f, -3.14f + */ + public void testN5() { + T_mul_float_4 t = new T_mul_float_4(); + assertEquals(847.8f, t.run(-314l, -2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.NaN + */ + public void testB1() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(Float.NaN, t.run(Float.MAX_VALUE, Float.NaN)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, 0 + */ + public void testB2() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(Float.NaN, t.run(Float.POSITIVE_INFINITY, 0)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, -2.7f + */ + public void testB3() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + -2.7f)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB4() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = +0, -0f + */ + public void testB5() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(-0f, t.run(+0f, -0f)); + } + + /** + * @title Arguments = -0f, -0f + */ + public void testB6() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(+0f, t.run(-0f, -0f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.MAX_VALUE + */ + public void testB7() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.MAX_VALUE, + Float.MAX_VALUE)); + } + + /** + * @title Arguments = Float.MIN_VALUE, -1.4E-45f + */ + public void testB8() { + T_mul_float_1 t = new T_mul_float_1(); + assertEquals(-0f, t.run(Float.MIN_VALUE, -1.4E-45f)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_1.java b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_1.java new file mode 100644 index 00000000..86f14e20 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_float.jm; + +public class T_mul_float_1 { + + public float run(float a, float b) { + return a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_3.java b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_3.java new file mode 100644 index 00000000..a3bd46df --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_float.jm; + +public class T_mul_float_3 { + + public float run(float a, double b) { + return a*(float)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_4.java b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_4.java new file mode 100644 index 00000000..e6471ad3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_float.jm; + +public class T_mul_float_4 { + + public float run(long a, float b) { + return (float)a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_int/Test_mul_int.java b/jack-tests/tests/com/android/jack/opcodes/mul_int/Test_mul_int.java new file mode 100644 index 00000000..5366161c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_int/Test_mul_int.java @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.mul_int.jm.T_mul_int_1; +import com.android.jack.opcodes.mul_int.jm.T_mul_int_3; +import com.android.jack.opcodes.mul_int.jm.T_mul_int_4; + + +public class Test_mul_int extends DxTestCase { + + /** + * @title Arguments = 8, 4 + */ + public void testN1() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(32, t.run(8, 4)); + } + + /** + * @title Arguments = -2, 255 + */ + public void testN2() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(-510, t.run(-2, 255)); + } + + /** + * @title Arguments = 0x7ffffffe, 2 + */ + public void testN3() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(-4, t.run(0x7ffffffe, 2)); + } + + /** + * @title Arguments = 4, 0x80000001 + */ + public void testN4() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(4, t.run(4, 0x80000001)); + } + + /** + * @title Arguments = 4, 0x80000001 + */ + public void testN5() { + T_mul_int_3 t = new T_mul_int_3(); + assertEquals(4, t.run(4, 0x80000001)); + } + + /** + * @title Arguments = 4, 0x80000001 + */ + public void testN6() { + T_mul_int_4 t = new T_mul_int_4(); + assertEquals(4, t.run(4, 0x80000001)); + } + + /** + * @title Arguments = 0, Integer.MAX_VALUE + */ + public void testB1() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(0, t.run(0, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, 1 + */ + public void testB2() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, 1 + */ + public void testB3() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MIN_VALUE + */ + public void testB4() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MAX_VALUE, + Integer.MIN_VALUE)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_mul_int_1 t = new T_mul_int_1(); + assertEquals(0, t.run(0, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_1.java b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_1.java new file mode 100644 index 00000000..c00e4164 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_int.jm; + +public class T_mul_int_1 { + + public int run(int a, int b) { + return a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_3.java b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_3.java new file mode 100644 index 00000000..971e4041 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_int.jm; + +public class T_mul_int_3 { + + public int run(int a, double b) { + return a*(int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_4.java b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_4.java new file mode 100644 index 00000000..6d523f54 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_int.jm; + +public class T_mul_int_4 { + + public int run(long a, int b) { + return (int)a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_long/Test_mul_long.java b/jack-tests/tests/com/android/jack/opcodes/mul_long/Test_mul_long.java new file mode 100644 index 00000000..28027f14 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_long/Test_mul_long.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.mul_long.jm.T_mul_long_1; +import com.android.jack.opcodes.mul_long.jm.T_mul_long_4; +import com.android.jack.opcodes.mul_long.jm.T_mul_long_5; +import com.android.jack.opcodes.mul_long.jm.T_mul_long_6; + + +public class Test_mul_long extends DxTestCase { + + /** + * @title Arguments = 222000000000l, 5000000000l + */ + public void testN1() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(3195355577426903040l, t.run(222000000000l, 5000000000l)); + } + + /** + * @title Arguments = -123456789l, 123456789l + */ + public void testN2() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(-15241578750190521l, t.run(-123456789l, 123456789l)); + } + + /** + * @title Arguments = -123456789l, -123456789l + */ + public void testN3() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(15241578750190521l, t.run(-123456789l, -123456789l)); + } + + /** + * @title Arguments = -123456789l, -123456789l + */ + public void testN4() { + T_mul_long_4 t = new T_mul_long_4(); + assertEquals(15241578750190520l, t.run(-123456789l, -123456789l)); + } + + /** + * @title Arguments = -123456789l, -123456789l + */ + public void testN5() { + T_mul_long_5 t = new T_mul_long_5(); + assertEquals(152345677626l, t.run(-123456789l, -1234)); + } + + /** + * @title Arguments = -123456789l, -123456789l + */ + public void testN6() { + T_mul_long_6 t = new T_mul_long_6(); + assertEquals(15241579434344448l, t.run(-123456789l, -123456789l)); + } + + /** + * @title Arguments = 0, Long.MAX_VALUE + */ + public void testB1() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(0, t.run(0, Long.MAX_VALUE)); + } + /** + * @title Arguments = Long.MAX_VALUE, 1 + */ + public void testB2() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(9223372036854775807L, t.run(Long.MAX_VALUE, 1)); + } + /** + * @title Arguments = Long.MIN_VALUE, 1 + */ + public void testB3() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, 1)); + } + /** + * @title Arguments = Long.MAX_VALUE, Long.MIN_VALUE + */ + public void testB4() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MAX_VALUE, + Long.MIN_VALUE)); + } + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(0, t.run(0, 0)); + } + /** + * @title Arguments = Long.MAX_VALUE, -1 + */ + public void testB6() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(-9223372036854775807L, t.run(Long.MAX_VALUE, -1)); + } + /** + * @title Arguments = Long.MIN_VALUE, -1 + */ + public void testB7() { + T_mul_long_1 t = new T_mul_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE, -1)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_1.java b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_1.java new file mode 100644 index 00000000..4bc6da42 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_long.jm; + +public class T_mul_long_1 { + + public long run(long a, long b) { + return a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_4.java b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_4.java new file mode 100644 index 00000000..2042dac0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_long.jm; + +public class T_mul_long_4 { + + public long run(long a, double b) { + return (long)(a*b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_5.java b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_5.java new file mode 100644 index 00000000..32981c54 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_long.jm; + +public class T_mul_long_5 { + + public long run(long a, int b) { + return a*b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_6.java b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_6.java new file mode 100644 index 00000000..0c851b3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.mul_long.jm; + +public class T_mul_long_6 { + + public long run(float a, long b) { + return (long)(a*b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_double/Test_neg_double.java b/jack-tests/tests/com/android/jack/opcodes/neg_double/Test_neg_double.java new file mode 100644 index 00000000..1cdfc143 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_double/Test_neg_double.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.neg_double.jm.T_neg_double_1; + + +public class Test_neg_double extends DxTestCase { + + /** + * @title Argument = 1 + */ + public void testN1() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(-1d, t.run(1d)); + } + + /** + * @title Argument = -1 + */ + public void testN2() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(1d, t.run(-1d)); + } + + /** + * @title Argument = +0 + */ + public void testN3() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(-0d, t.run(+0d)); + } + + /** + * @title Argument = -2.7 + */ + public void testN4() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(2.7d, t.run(-2.7d)); + } + + + /** + * @title Argument = Double.NaN + */ + public void testB1() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(Double.NaN, t.run(Double.NaN)); + } + + /** + * @title Argument = Double.NEGATIVE_INFINITY + */ + public void testB2() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.NEGATIVE_INFINITY)); + } + + /** + * @title Argument = Double.POSITIVE_INFINITY + */ + public void testB3() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(Double.NEGATIVE_INFINITY, t.run(Double.POSITIVE_INFINITY)); + } + + /** + * @title Argument = Double.MAX_VALUE + */ + public void testB4() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(-1.7976931348623157E308d, t.run(Double.MAX_VALUE)); + } + + /** + * @title Argument = Double.MIN + */ + public void testB5() { + T_neg_double_1 t = new T_neg_double_1(); + assertEquals(-4.9E-324d, t.run(Double.MIN_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_double/jm/T_neg_double_1.java b/jack-tests/tests/com/android/jack/opcodes/neg_double/jm/T_neg_double_1.java new file mode 100644 index 00000000..84768a11 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_double/jm/T_neg_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_double.jm; + +public class T_neg_double_1 { + + public double run(double d) { + return -d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_float/Test_neg_float.java b/jack-tests/tests/com/android/jack/opcodes/neg_float/Test_neg_float.java new file mode 100644 index 00000000..d6b30267 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_float/Test_neg_float.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.neg_float.jm.T_neg_float_1; + + +public class Test_neg_float extends DxTestCase { + + /** + * @title Argument = 1 + */ + public void testN1() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(-1f, t.run(1f)); + } + + /** + * @title Argument = -1 + */ + public void testN2() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(1f, t.run(-1f)); + } + + /** + * @title Argument = +0 + */ + public void testN3() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(-0f, t.run(+0f)); + } + + /** + * @title Argument = -2.7 + */ + public void testN4() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(2.7f, t.run(-2.7f)); + } + + /** + * @title Argument = Float.NaN + */ + public void testB1() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(Float.NaN, t.run(Float.NaN)); + } + + /** + * @title Argument = Float.NEGATIVE_INFINITY + */ + public void testB2() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.NEGATIVE_INFINITY)); + } + + /** + * @title Argument = Float.POSITIVE_INFINITY + */ + public void testB3() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(Float.NEGATIVE_INFINITY, t.run(Float.POSITIVE_INFINITY)); + } + + /** + * @title Argument = Float.MAX_VALUE + */ + public void testB4() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(-3.4028235E38f, t.run(Float.MAX_VALUE)); + } + + /** + * @title Argument = Float.MIN + */ + public void testB5() { + T_neg_float_1 t = new T_neg_float_1(); + assertEquals(-1.4E-45f, t.run(Float.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_float/jm/T_neg_float_1.java b/jack-tests/tests/com/android/jack/opcodes/neg_float/jm/T_neg_float_1.java new file mode 100644 index 00000000..d6533780 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_float/jm/T_neg_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_float.jm; + +public class T_neg_float_1 { + + public float run(float d) { + return -d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_int/Test_neg_int.java b/jack-tests/tests/com/android/jack/opcodes/neg_int/Test_neg_int.java new file mode 100644 index 00000000..6f154ec0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_int/Test_neg_int.java @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.neg_int.jm.T_neg_int_1; +import com.android.jack.opcodes.neg_int.jm.T_neg_int_2; + + +public class Test_neg_int extends DxTestCase { + + /** + * @title Argument = 1 + */ + public void testN1() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(-1, t.run(1)); + } + + /** + * @title Argument = -1 + */ + public void testN2() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(1, t.run(-1)); + } + + /** + * @title Argument = 32768 + */ + public void testN3() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(-32768, t.run(32768)); + } + + /** + * @title Argument = 0 + */ + public void testN4() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(0, t.run(0)); + } + + /** + * @title Check that -x == (~x + 1) + */ + public void testN5() { + T_neg_int_2 t = new T_neg_int_2(); + assertTrue(t.run(12345)); + } + + /** + * @title Check that -x == (~x + 1) + */ + public void testN6() { + T_neg_int_2 t = new T_neg_int_2(); + assertTrue(t.run(12345)); + } + + + /** + * @title Argument = Integer.MAX_VALUE + */ + public void testB1() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(0x80000001, t.run(Integer.MAX_VALUE)); + } + + /** + * @title Argument = Integer.MIN_VALUE + */ + public void testB2() { + T_neg_int_1 t = new T_neg_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_1.java b/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_1.java new file mode 100644 index 00000000..2858e1f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_int.jm; + +public class T_neg_int_1 { + + public int run(int d) { + return -d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_2.java b/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_2.java new file mode 100644 index 00000000..c020c3e5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_int.jm; + +public class T_neg_int_2 { + + public boolean run(int d) { + return -d == (~d + 1); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/Test_neg_long.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/Test_neg_long.java new file mode 100644 index 00000000..439c907d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/Test_neg_long.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.neg_long.jm.T_neg_long_1; +import com.android.jack.opcodes.neg_long.jm.T_neg_long_2; +import com.android.jack.opcodes.neg_long.jm.T_neg_long_4; +import com.android.jack.opcodes.neg_long.jm.T_neg_long_5; +import com.android.jack.opcodes.neg_long.jm.T_neg_long_6; + + +public class Test_neg_long extends DxTestCase { + + /** + * @title Argument = 123123123272432432l + */ + public void testN1() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(-123123123272432432l, t.run(123123123272432432l)); + } + + /** + * @title Argument = 1 + */ + public void testN2() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(-1l, t.run(1l)); + } + + /** + * @title Argument = -1 + */ + public void testN3() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(1l, t.run(-1l)); + } + + /** + * @title Check that -x == (~x + 1) + */ + public void testN4() { + T_neg_long_2 t = new T_neg_long_2(); + assertTrue(t.run(123123123272432432l)); + } + + /** + * @title Argument = -1 + */ + public void testN5() { + T_neg_long_4 t = new T_neg_long_4(); + assertEquals(1l, t.run(-1l)); + } + + /** + * @title Argument = -1 + */ + public void testN6() { + T_neg_long_5 t = new T_neg_long_5(); + assertEquals(1l, t.run(-1)); + } + + /** + * @title Argument = -1 + */ + public void testN7() { + T_neg_long_6 t = new T_neg_long_6(); + assertEquals(1l, t.run(-1l)); + } + + /** + * @title Argument = 0 + */ + public void testB1() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(0, t.run(0)); + } + + /** + * @title Argument = Long.MAX_VALUE + */ + public void testB2() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(-9223372036854775807L, t.run(Long.MAX_VALUE)); + } + + /** + * @title Argument = Long.MIN_VALUE + */ + public void testB3() { + T_neg_long_1 t = new T_neg_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_1.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_1.java new file mode 100644 index 00000000..f772a1eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long.jm; + +public class T_neg_long_1 { + + public long run(long d) { + return -d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_2.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_2.java new file mode 100644 index 00000000..e51ad7ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long.jm; + +public class T_neg_long_2 { + + public boolean run(long d) { + return -d == (~d + 1); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_4.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_4.java new file mode 100644 index 00000000..544e3be1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long.jm; + +public class T_neg_long_4 { + + public long run(double d) { + return (long)-d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_5.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_5.java new file mode 100644 index 00000000..ed53c241 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long.jm; + +public class T_neg_long_5 { + + public long run(int d) { + return -d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_6.java b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_6.java new file mode 100644 index 00000000..c10074cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.neg_long.jm; + +public class T_neg_long_6 { + + public long run(float d) { + return (long)-d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/Test_new_array.java b/jack-tests/tests/com/android/jack/opcodes/new_array/Test_new_array.java new file mode 100644 index 00000000..cbb1b6ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/Test_new_array.java @@ -0,0 +1,217 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.new_array.jm.T_new_array_1; +import com.android.jack.opcodes.new_array.jm.T_new_array_2; +import com.android.jack.opcodes.new_array.jm.T_new_array_4; +import com.android.jack.opcodes.new_array.jm.T_new_array_5; +import com.android.jack.opcodes.new_array.jm.T_new_array_6; + + +public class Test_new_array extends DxTestCase { + + /** + * @title Test for Object + */ + public void testN1() { + T_new_array_1 t = new T_new_array_1(); + + Object[] arr = t.run(10); + assertNotNull(arr); + assertEquals(10, arr.length); + for (int i = 0; i < 10; i++) + assertNull(arr[i]); + } + + /** + * @title Test for String + */ + public void testN2() { + T_new_array_1 t = new T_new_array_1(); + + String[] arr2 = t.run2(5); + assertNotNull(arr2); + assertEquals(5, arr2.length); + for (int i = 0; i < 5; i++) + assertNull(arr2[i]); + } + + /** + * @title Test for Integer + */ + public void testN3() { + T_new_array_1 t = new T_new_array_1(); + + Integer[] arr3 = t.run3(15); + assertNotNull(arr3); + assertEquals(15, arr3.length); + for (int i = 0; i < 15; i++) + assertNull(arr3[i]); + } + + /** + * @title if count is zero, no subsequent dimensions allocated + */ + public void testE1() { + T_new_array_1 t = new T_new_array_1(); + Object[] res = t.run(0); + try { + Object s = res[0]; + fail("expected ArrayIndexOutOfBoundsException"); + } catch (ArrayIndexOutOfBoundsException ae) { + // expected + } + } + + /** + * @title expected NegativeArraySizeException + */ + public void testE2() { + T_new_array_1 t = new T_new_array_1(); + try { + t.run(-2); + fail("expected NegativeArraySizeException"); + } catch (NegativeArraySizeException nase) { + // expected + } + } + + /** + * @title normal test + */ + public void testN1MultiDim() { + T_new_array_2 t = new T_new_array_2(); + String[][][] res = t.run(2, 5, 4); + + assertEquals(2, res.length); + + // check default initialization + for (int i = 0; i < 2; i++) { + assertEquals(5, res[i].length); + + for (int j = 0; j < 5; j++) { + assertEquals(4, res[i][j].length); + + for (int k = 0; j < 4; j++) { + assertNull(res[i][j][k]); + } + } + } + } + + /** + * @title if count is zero, no subsequent dimensions allocated + */ + public void testN2MultiDim() { + T_new_array_2 t = new T_new_array_2(); + String[][][] res = t.run(2, 0, 4); + + try { + String s = res[2][0][0]; + fail("expected ArrayIndexOutOfBoundsException"); + fail("dummy for s "+s); + } catch (ArrayIndexOutOfBoundsException ae) { + // expected + } + } + + public void testN3MultiDim() { + T_new_array_4 t = new T_new_array_4(); + String[][][] res = t.run(2, 1, 4); + + if (res.length != 2) fail("incorrect multiarray length"); + if (res[0].length != 1) fail("incorrect array length"); + + try { + int i = res[0][0].length; + fail("expected NullPointerException"); + fail("dummy for i "+i); + } catch (NullPointerException npe) { + // expected + } + } + + /** + * @title expected NegativeArraySizeException + */ + public void testE1MultiDim() { + T_new_array_2 t = new T_new_array_2(); + try { + t.run(2, -5, 3); + fail("expected NegativeArraySizeException"); + } catch (NegativeArraySizeException nase) { + // expected + } + } + + /** + * @title Array of ints + */ + public void testN1Simple() { + T_new_array_5 t = new T_new_array_5(); + int[] r = t.run(10); + int l = r.length; + assertEquals(10, l); + + // check default initialization + for (int i = 0; i < l; i++) { + assertEquals(0, r[i]); + } + + } + + /** + * @title Array of floats + */ + public void testN2Simple() { + T_new_array_6 t = new T_new_array_6(); + float[] r = t.run(10); + int l = r.length; + assertEquals(10, l); + + // check default initialization + for (int i = 0; i < l; i++) { + assertEquals(0f, r[i]); + } + } + + /** + * @title expected NegativeArraySizeException + */ + public void testE1Simple() { + T_new_array_6 t = new T_new_array_6(); + try { + t.run(-1); + fail("expected NegativeArraySizeException"); + } catch (NegativeArraySizeException nase) { + // expected + } + } + + /** + * @title Array size = 0 + */ + public void testB1Simple() { + T_new_array_5 t = new T_new_array_5(); + int[] r = t.run(0); + assertNotNull(r); + assertEquals(0, r.length); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_1.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_1.java new file mode 100644 index 00000000..8027d035 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_1.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_1 { + + public Object[] run(int idx) { + return new Object[idx]; + } + + public String[] run2(int idx) { + return new String[idx]; + } + + public Integer[] run3(int idx) { + return new Integer[idx]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_2.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_2.java new file mode 100644 index 00000000..9da8b7ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_2 { + + public String[][][] run(int d1, int d2, int d3) { + return new String[d1][d2][d3]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_3.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_3.java new file mode 100644 index 00000000..d06213cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_3 { + + public String[][] run(int d1, int d2) { + return new String[d1][d2]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_4.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_4.java new file mode 100644 index 00000000..08c4512e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_4 { + + public String[][][] run(int d1, int d2, int d3) { + return new String[d1][d2][]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_5.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_5.java new file mode 100644 index 00000000..b67adfb2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_5 { + + public int[] run(int sz) { + return new int[sz]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_6.java b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_6.java new file mode 100644 index 00000000..acc9c967 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/new_array/jm/T_new_array_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.new_array.jm; + +public class T_new_array_6 { + + public float[] run(int sz) { + return new float[sz]; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_const/Test_opc_const.java b/jack-tests/tests/com/android/jack/opcodes/opc_const/Test_opc_const.java new file mode 100644 index 00000000..c8549240 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_const/Test_opc_const.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_const; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_const.jm.T_opc_const_1; +import com.android.jack.opcodes.opc_const.jm.T_opc_const_2; + + +public class Test_opc_const extends DxTestCase { + + /** + * @title push float into stack + */ + public void testN1() { + T_opc_const_1 t = new T_opc_const_1(); + float a = 1.5f; + float b = 0.04f; + assertEquals(a + b, t.run(), 0f); + assertEquals(1.54f, t.run(), 0f); + } + + /** + * @title push int into stack + */ + public void testN2() { + T_opc_const_2 t = new T_opc_const_2(); + int a = 1000000000; + int b = 1000000000; + assertEquals(a + b, t.run()); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_1.java new file mode 100644 index 00000000..857e8c59 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_const.jm; + +public class T_opc_const_1 { + + public float run() { + return 1.54f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_2.java b/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_2.java new file mode 100644 index 00000000..47f8b547 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_const.jm; + +public class T_opc_const_2 { + + public int run() { + return 2000000000; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_goto/Test_opc_goto.java b/jack-tests/tests/com/android/jack/opcodes/opc_goto/Test_opc_goto.java new file mode 100644 index 00000000..760b573b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_goto/Test_opc_goto.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_goto; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_goto.jm.T_opc_goto_1; +import com.android.jack.opcodes.opc_goto.jm.T_opc_goto_5; + + +public class Test_opc_goto extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_opc_goto_1 t = new T_opc_goto_1(); + assertEquals(0, t.run(20)); + } + + /** + * @title normal test + */ + public void testN2() { + T_opc_goto_1 t = new T_opc_goto_1(); + assertEquals(-20, t.run(-20)); + } + + /** + * @title negative offset + */ + public void testN3() { + T_opc_goto_5 t = new T_opc_goto_5(); + assertTrue(t.run()); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_1.java new file mode 100644 index 00000000..b9f26557 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_1.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_goto.jm; + +public class T_opc_goto_1 { + + public int run(int a) { + while (a > 0) { + a--; + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_2.java b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_2.java new file mode 100644 index 00000000..5af7c4db --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_goto.jm; + +public class T_opc_goto_2 { + + public void run() { + String a = "a"; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_5.java b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_5.java new file mode 100644 index 00000000..2f4b1b48 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_goto.jm; + +public class T_opc_goto_5 { + + public boolean run() { + return true; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/Test_opc_instanceof.java b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/Test_opc_instanceof.java new file mode 100644 index 00000000..cec5479b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/Test_opc_instanceof.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_instanceof; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_instanceof.jm.T_opc_instanceof_1; + + +public class Test_opc_instanceof extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_opc_instanceof_1 t = new T_opc_instanceof_1(); + assertTrue(t.run("")); + } + + /** + * @title check null value + */ + public void testN2() { + T_opc_instanceof_1 t = new T_opc_instanceof_1(); + assertFalse(t.run(null)); + } + + /** + * @title normal test + */ + public void testN3() { + T_opc_instanceof_1 t = new T_opc_instanceof_1(); + assertFalse(t.run(this)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/T_opc_instanceof_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/T_opc_instanceof_1.java new file mode 100644 index 00000000..d429d840 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/T_opc_instanceof_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_instanceof.jm; + +public class T_opc_instanceof_1 { + + public boolean run(Object o) { + return (o instanceof String); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/TestStubs.java new file mode 100644 index 00000000..9e2dd1b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_instanceof/jm/TestStubs.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_instanceof.jm; + +public class TestStubs { + @SuppressWarnings("unused") + private class TestStub { + // testE1 + } +} + +interface SuperInterface{ + +} + +interface SuperInterface2{ + +} + +class SuperClass implements SuperInterface{ + +} + +class SubClass extends SuperClass{ + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_new/Test_opc_new.java b/jack-tests/tests/com/android/jack/opcodes/opc_new/Test_opc_new.java new file mode 100644 index 00000000..caf11a03 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_new/Test_opc_new.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_new; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_new.jm.T_opc_new_1; +import com.android.jack.opcodes.opc_new.jm.T_opc_new_3; +import com.android.jack.opcodes.opc_new.jm.T_opc_new_9; + + +public class Test_opc_new extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_opc_new_1 t = new T_opc_new_1(); + String s = t.run(); + assertNotNull(s); + assertEquals(0, s.compareTo("abc")); + } + + /** + * @title expected Error (exception during class loading) + */ + public void testE1() { + try { + T_opc_new_3.run(); + fail("expected Error"); + } catch (Error e) { + // expected + } + } + + /** + * @constraint 4.8.1.18 + * @title attempt to instantiate abstract + * class + */ + public void testE5() { + // @uses com.android.jack.opcodes.opc_new.jm.TestAbstractClass + T_opc_new_9 t = new T_opc_new_9(); + try { + t.run(); + fail("expected Error"); + } catch (Error iae) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_1.java new file mode 100644 index 00000000..880bb2af --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_new.jm; + +public class T_opc_new_1 { + + public String run() { + return new String("abc"); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_3.java b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_3.java new file mode 100644 index 00000000..767e93f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_3.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_new.jm; + +public class T_opc_new_3 { + + static int i = 123 / 0; + + public static int run() { + T_opc_new_3 t = new T_opc_new_3(); + return t.i; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_9.java b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_9.java new file mode 100644 index 00000000..6926f405 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_9.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_new.jm; + +public class T_opc_new_9 { + + public Object run() { + return new Object(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/TestStubs.java new file mode 100644 index 00000000..acac4c6f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_new/jm/TestStubs.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_new.jm; + + +interface TestInterface { + public abstract void test(); +} + +abstract class TestAbstractClass{ + +} + +public class TestStubs { + private static @SuppressWarnings("unused") class TestStub { + private TestStub() { + + } + // testE3 + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/Test_opc_return.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/Test_opc_return.java new file mode 100644 index 00000000..c24036c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/Test_opc_return.java @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_11; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_12; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_13; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_14; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_15; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_1; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_10; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_2; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_3; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_4; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_5; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_6; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_7; +import com.android.jack.opcodes.opc_return.jm.T_opc_return_8; + + +public class Test_opc_return extends DxTestCase { + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN1() { + T_opc_return_1 t = new T_opc_return_1(); + assertEquals(123456, t.run()); + } + + /** + * @title check that monitor is released by return + */ + public void testN2() { + assertTrue(T_opc_return_2.execute()); + } + + + public void testN3() { + T_opc_return_3 t = new T_opc_return_3(); + assertTrue(t.run()); + } + + /** + * @title Lock structural rule 1 is violated + */ + public void testE2() { + T_opc_return_4 t = new T_opc_return_4(); + try { + t.run(); + System.out.print("dvmvfe:"); + //fail("expected IllegalMonitorStateException"); + } catch (IllegalMonitorStateException imse) { + // expected + } + } + + /** + * @title simple + */ + public void testN1Float() { + T_opc_return_5 t = new T_opc_return_5(); + assertEquals(123456f, t.run()); + } + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN2Float() { + T_opc_return_7 t = new T_opc_return_7(); + assertEquals(123456f, t.run()); + } + + /** + * @title check that monitor is released by return + */ + public void testN3Float() { + assertTrue(T_opc_return_8.execute()); + } + + /** + * @title check that monitor is released by return + */ + public void testN4Float() { + T_opc_return_6 t = new T_opc_return_6(); + assertEquals(0f, t.run()); + } + +// /** +// * @title Method is synchronized but thread is not monitor owner +// */ +// public void testE1() { +// T_opc_return_9 t = new T_opc_return_9(); +// try { +// assertTrue(t.run()); +// fail("expected IllegalMonitorStateException"); +// } catch (IllegalMonitorStateException imse) { +// // expected +// } +// } + + /** + * @title Lock structural rule 1 is violated + */ + public void testE2Float() { + T_opc_return_10 t = new T_opc_return_10(); + try { + assertEquals(1f, t.run()); + System.out.print("dvmvfe:"); + //fail("expected IllegalMonitorStateException"); + } catch (IllegalMonitorStateException imse) { + // expected + } + } + + /** + * @title simple + */ + public void testN1Int() { + T_opc_return_11 t = new T_opc_return_11(); + assertEquals(123456, t.run()); + } + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN2Int() { + T_opc_return_12 t = new T_opc_return_12(); + assertEquals(123456, t.run()); + } + + /** + * @title check that monitor is released by return-int + */ + public void testN3Int() { + assertTrue(T_opc_return_13.execute()); + } + + /** + * @title Method is synchronized but thread is not monitor owner + */ + public void testE1Int() { + T_opc_return_14 t = new T_opc_return_14(); + assertTrue(t.run()); + } + + /** + * @title Lock structural rule 1 is violated + */ + public void testE2Int() { + T_opc_return_15 t = new T_opc_return_15(); + try { + assertEquals(1, t.run()); + System.out.print("dvmvfe:"); + //fail("expected IllegalMonitorStateException"); + } catch (IllegalMonitorStateException imse) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_1.java new file mode 100644 index 00000000..b24871cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_1.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_1 { + + public int run() { + return 123456; + } + + private static void test() { + int a = 0xaaaa; + int b = 0xbbbb; + int c = 0xcccc; + return; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_10.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_10.java new file mode 100644 index 00000000..a39d3bc7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_10.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_10 { + + public float run() { + return 1f; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_11.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_11.java new file mode 100644 index 00000000..c0e92317 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_11.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_11 { + + public int run() { + return 123456; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_12.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_12.java new file mode 100644 index 00000000..0681899a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_12.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_12 { + + public int run() { + return 123456; + } + + private static int test() { + int a = 0xaaaa; + int b = 0xbbbb; + int c = 0xcccc; + return 0xcafe; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_13.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_13.java new file mode 100644 index 00000000..cfb1135f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_13.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_13 implements Runnable { + public final static int CNT = 1000; + int value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized int test() { + value++; + int c = value; + Thread.yield(); + if(c != value) + failed = true; + return c; + } + + public static boolean execute() { + T_opc_return_13 test = new T_opc_return_13(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_14.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_14.java new file mode 100644 index 00000000..54b8f21b --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_14.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_14 { + + private synchronized int test() { + return 0; + } + + public boolean run() { + test(); + return true; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_15.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_15.java new file mode 100644 index 00000000..84cb6e31 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_15.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_15 { + + public int run() { + return 1; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_2.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_2.java new file mode 100644 index 00000000..c642e1fd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_2.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_2 implements Runnable { + public final static int CNT = 1000; + int value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized void test() { + value++; + int c = value; + Thread.yield(); + if(c != value) + failed = true; + } + + public static boolean execute() { + T_opc_return_2 test = new T_opc_return_2(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_3.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_3.java new file mode 100644 index 00000000..e741701c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_3.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_3 { + + private synchronized void test() { + return; + } + + public boolean run() { + test(); + return true; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_4.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_4.java new file mode 100644 index 00000000..fc13cc48 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_4 { + + public void run() { + return; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_5.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_5.java new file mode 100644 index 00000000..3888530d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_5 { + + public float run() { + return 123456f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_6.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_6.java new file mode 100644 index 00000000..7b1a9ef7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_6.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_6 { + + public float run() { + return 0f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_7.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_7.java new file mode 100644 index 00000000..524e577e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_7.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_7 { + + public float run() { + return 123456f; + } + + private static float test() { + float a = 1111f; + float b = 2222f; + float c = 3333f; + return 4444f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_8.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_8.java new file mode 100644 index 00000000..e7ca3c62 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_8.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_8 implements Runnable { + public final static int CNT = 1000; + float value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized float test() { + value++; + float c = value; + Thread.yield(); + if(c != value) + failed = true; + return c; + } + + public static boolean execute() { + T_opc_return_8 test = new T_opc_return_8(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_9.java b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_9.java new file mode 100644 index 00000000..98529098 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_9.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_return.jm; + +public class T_opc_return_9 { + + private synchronized float test() { + return 0f; + } + + public boolean run() { + test(); + return true; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_throw/Test_opc_throw.java b/jack-tests/tests/com/android/jack/opcodes/opc_throw/Test_opc_throw.java new file mode 100644 index 00000000..c318a695 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_throw/Test_opc_throw.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_throw; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.opc_throw.jm.T_opc_throw_1; +import com.android.jack.opcodes.opc_throw.jm.T_opc_throw_12; +import com.android.jack.opcodes.opc_throw.jm.T_opc_throw_2; +import com.android.jack.opcodes.opc_throw.jm.T_opc_throw_8; + + +public class Test_opc_throw extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_opc_throw_1 t = new T_opc_throw_1(); + try { + t.run(); + fail("must throw a RuntimeException"); + } catch (RuntimeException re) { + // expected + } + } + + /** + * @title Throwing of the objectref on the class Throwable + */ + public void testN2() { + T_opc_throw_2 t = new T_opc_throw_2(); + try { + t.run(); + fail("must throw a Throwable"); + } catch (Throwable e) { + // expected + } + } + + /** + * @title Throwing of the objectref on the subclass of Throwable + */ + public void testN3() { + T_opc_throw_8 t = new T_opc_throw_8(); + try { + t.run(); + fail("must throw a Error"); + } catch (Error e) { + // expected + } + } + + /** + * @title Nearest matching catch must be executed in case of exception + */ + public void testN4() { + T_opc_throw_12 t = new T_opc_throw_12(); + assertTrue(t.run()); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_1.java b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_1.java new file mode 100644 index 00000000..99d77515 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_throw.jm; + +public class T_opc_throw_1 { + + public void run() { + throw new RuntimeException(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_12.java b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_12.java new file mode 100644 index 00000000..eb56644d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_12.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_throw.jm; + +public class T_opc_throw_12 { + + public boolean run() { + try{ + try { + throw new RuntimeException(); + }catch(RuntimeException e1) { + return true; + } + } catch(RuntimeException e2) { + } + return false; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_2.java b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_2.java new file mode 100644 index 00000000..e722c7f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_throw.jm; + +public class T_opc_throw_2 { + + public void run() throws Throwable { + throw new Throwable(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_8.java b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_8.java new file mode 100644 index 00000000..1744aa40 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_8.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.opc_throw.jm; + +public class T_opc_throw_8 { + + public void run() throws Error { + throw new Error(); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_int/Test_or_int.java b/jack-tests/tests/com/android/jack/opcodes/or_int/Test_or_int.java new file mode 100644 index 00000000..3f2079bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_int/Test_or_int.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.or_int.jm.T_or_int_1; +import com.android.jack.opcodes.or_int.jm.T_or_int_3; +import com.android.jack.opcodes.or_int.jm.T_or_int_4; + + +public class Test_or_int extends DxTestCase { + + /** + * @title Arguments = 15, 8 + */ + public void testN1() { + T_or_int_1 t = new T_or_int_1(); + assertEquals(15, t.run(15, 8)); + } + + /** + * @title Arguments = 0xfffffff8, 0xfffffff1 + */ + public void testN2() { + T_or_int_1 t = new T_or_int_1(); + assertEquals(0xfffffff9, t.run(0xfffffff8, 0xfffffff1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN3() { + T_or_int_1 t = new T_or_int_1(); + assertEquals(-1, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN4() { + T_or_int_3 t = new T_or_int_3(); + assertEquals(-1, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN5() { + T_or_int_4 t = new T_or_int_4(); + assertEquals(-1, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_or_int_1 t = new T_or_int_1(); + assertEquals(-1, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & Integer.MIN_VALUE + */ + public void testB2() { + T_or_int_1 t = new T_or_int_1(); + assertEquals(0xffffffff, t.run(Integer.MAX_VALUE, Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_1.java b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_1.java new file mode 100644 index 00000000..da6e1cce --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_int.jm; + +public class T_or_int_1 { + + public int run(int a, int b) { + return a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_3.java b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_3.java new file mode 100644 index 00000000..5902141d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_int.jm; + +public class T_or_int_3 { + + public int run(double a, int b) { + return (int)a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_4.java b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_4.java new file mode 100644 index 00000000..bca1fbf6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_int/jm/T_or_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_int.jm; + +public class T_or_int_4 { + + public int run(int a, long b) { + return a | (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_long/Test_or_long.java b/jack-tests/tests/com/android/jack/opcodes/or_long/Test_or_long.java new file mode 100644 index 00000000..e3cab363 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_long/Test_or_long.java @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.or_long.jm.T_or_long_1; +import com.android.jack.opcodes.or_long.jm.T_or_long_3; +import com.android.jack.opcodes.or_long.jm.T_or_long_4; +import com.android.jack.opcodes.or_long.jm.T_or_long_5; + + +public class Test_or_long extends DxTestCase { + + /** + * @title Arguments = 123456789121l, 2l + */ + public void testN1() { + T_or_long_1 t = new T_or_long_1(); + assertEquals(123456789123l, t.run(123456789121l, 2l)); + } + + /** + * @title Arguments = 0xffffffffffffff8l, 0xffffffffffffff1l + */ + public void testN2() { + T_or_long_1 t = new T_or_long_1(); + assertEquals(0xffffffffffffff9l, t.run(0xffffffffffffff8l, + 0xffffffffffffff1l)); + } + + /** + * @title Arguments = 0xabcdefabcdef, -1 + */ + public void testN3() { + T_or_long_1 t = new T_or_long_1(); + assertEquals(-1l, t.run(0xabcdefabcdefl, -1l)); + } + + /** + * @title Arguments = 0xabcdefabcdef, -1 + */ + public void testN4() { + T_or_long_3 t = new T_or_long_3(); + assertEquals(-1l, t.run(0xabcdefabcdefl, -1l)); + } + + + /** + * @title Arguments = 0xabcdefabcdef, -1 + */ + public void testN5() { + T_or_long_4 t = new T_or_long_4(); + assertEquals(-1l, t.run(0xabcdefa, -1l)); + } + + + /** + * @title Arguments = 0xabcdefabcdef, -1 + */ + public void testN6() { + T_or_long_5 t = new T_or_long_5(); + assertEquals(-1l, t.run(0xabcdefabcdefl, -1l)); + } + + + /** + * @title Arguments = 0, -1 + */ + public void testB1() { + T_or_long_1 t = new T_or_long_1(); + assertEquals(-1l, t.run(0l, -1l)); + } + + /** + * @title Arguments = Long.MAX_VALUE, Long.MIN_VALUE + */ + public void testB2() { + T_or_long_1 t = new T_or_long_1(); + assertEquals(-1l, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_1.java b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_1.java new file mode 100644 index 00000000..4d427469 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_long.jm; + +public class T_or_long_1 { + + public long run(long a, long b) { + return a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_3.java b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_3.java new file mode 100644 index 00000000..ff8fa1fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_long.jm; + +public class T_or_long_3 { + + public long run(double a, long b) { + return (long)a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_4.java b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_4.java new file mode 100644 index 00000000..ba8311b5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_long.jm; + +public class T_or_long_4 { + + public long run(int a, long b) { + return a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_5.java b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_5.java new file mode 100644 index 00000000..cd2517fd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/or_long/jm/T_or_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.or_long.jm; + +public class T_or_long_5 { + + public long run(float a, long b) { + return (long)a | b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/packed_switch/Test_packed_switch.java b/jack-tests/tests/com/android/jack/opcodes/packed_switch/Test_packed_switch.java new file mode 100644 index 00000000..67a05328 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/packed_switch/Test_packed_switch.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.packed_switch; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.packed_switch.jm.T_packed_switch_1; + + +public class Test_packed_switch extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_packed_switch_1 t = new T_packed_switch_1(); + assertEquals(2, t.run(-1)); + + assertEquals(-1, t.run(4)); + assertEquals(20, t.run(2)); + assertEquals(-1, t.run(5)); + + assertEquals(-1, t.run(6)); + assertEquals(20, t.run(3)); + assertEquals(-1, t.run(7)); + } + + /** + * @title check Integer.MAX_VALUE + */ + public void testB1() { + T_packed_switch_1 t = new T_packed_switch_1(); + assertEquals(-1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title check Integer.MIN_VALUE + */ + public void testB2() { + T_packed_switch_1 t = new T_packed_switch_1(); + assertEquals(-1, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/packed_switch/jm/T_packed_switch_1.java b/jack-tests/tests/com/android/jack/opcodes/packed_switch/jm/T_packed_switch_1.java new file mode 100644 index 00000000..a6b091b4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/packed_switch/jm/T_packed_switch_1.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.packed_switch.jm; + +public class T_packed_switch_1 { + + public int run(int i) { + switch (i) { + case -1: + return 2; + case 2: + case 3: + return 20; + default: + return -1; + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_double/Test_rem_double.java b/jack-tests/tests/com/android/jack/opcodes/rem_double/Test_rem_double.java new file mode 100644 index 00000000..a72a343a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_double/Test_rem_double.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.rem_double.jm.T_rem_double_1; +import com.android.jack.opcodes.rem_double.jm.T_rem_double_3; +import com.android.jack.opcodes.rem_double.jm.T_rem_double_4; + + +public class Test_rem_double extends DxTestCase { + + /** + * @title Arguments = 2.7d, 3.14d + */ + public void testN1() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(2.7d, t.run(2.7d, 3.14d)); + } + + /** + * @title Dividend = 0 + */ + public void testN2() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(0d, t.run(0, 3.14d)); + } + + /** + * @title Dividend is negative + */ + public void testN3() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(-0.43999999999999995d, t.run(-3.14d, 2.7d)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_rem_double_3 t = new T_rem_double_3(); + assertEquals(-0.4399999523162843d, t.run(-3.14d, 2.7f)); + } + + /** + * @title Dividend is negative + */ + public void testN5() { + T_rem_double_4 t = new T_rem_double_4(); + assertEquals(-0.7999999999999794d, t.run(-314l, 2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.NaN + */ + public void testB1() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(Double.NaN, t.run(Double.MAX_VALUE, Double.NaN)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB2() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, -2.7d + */ + public void testB3() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, -2.7d)); + } + + /** + * @title Arguments = -2.7d, Double.NEGATIVE_INFINITY + */ + public void testB4() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(-2.7d, t.run(-2.7d, Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(Double.NaN, t.run(0, 0)); + } + + /** + * @title Arguments = 0, -2.7 + */ + public void testB6() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(0d, t.run(0, -2.7d)); + } + + /** + * @title Arguments = -2.7, 0 + */ + public void testB7() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(Double.NaN, t.run(-2.7d, 0)); + } + + /** + * @title Arguments = 1, Double.MAX_VALUE + */ + public void testB8() { + T_rem_double_1 t = new T_rem_double_1(); + assertEquals(0d, t.run(1, Double.MIN_VALUE)); + } + + /** + * @title Arguments = Double.MAX_VALUE, -1E-9d + */ + public void testB9() { + T_rem_double_1 t = new T_rem_double_1(); + + assertEquals(1.543905285031139E-10d, t.run(Double.MAX_VALUE, -1E-9d)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_1.java b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_1.java new file mode 100644 index 00000000..84d2e910 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_double.jm; + +public class T_rem_double_1 { + + public double run(double a, double b) { + return a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_3.java b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_3.java new file mode 100644 index 00000000..fecf0352 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_double.jm; + +public class T_rem_double_3 { + + public double run(double a, float b) { + return a%(double)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_4.java b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_4.java new file mode 100644 index 00000000..b7e1e33c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_double.jm; + +public class T_rem_double_4 { + + public double run(long a, double b) { + return (double)a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_float/Test_rem_float.java b/jack-tests/tests/com/android/jack/opcodes/rem_float/Test_rem_float.java new file mode 100644 index 00000000..409a9e80 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_float/Test_rem_float.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.rem_float.jm.T_rem_float_1; +import com.android.jack.opcodes.rem_float.jm.T_rem_float_3; +import com.android.jack.opcodes.rem_float.jm.T_rem_float_4; + + +public class Test_rem_float extends DxTestCase { + + /** + * @title Arguments = 2.7f, 3.14f + */ + public void testN1() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(2.7f, t.run(2.7f, 3.14f)); + } + + /** + * @title Dividend = 0 + */ + public void testN2() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(0f, t.run(0, 3.14f)); + } + + /** + * @title Dividend is negative + */ + public void testN3() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(-0.44000006f, t.run(-3.14f, 2.7f)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_rem_float_3 t = new T_rem_float_3(); + assertEquals(-0.44000006f, t.run(-3.14f, 2.7f)); + } + + /** + * @title Dividend is negative + */ + public void testN5() { + T_rem_float_4 t = new T_rem_float_4(); + assertEquals(-0.79999447f, t.run(-314l, 2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.NaN + */ + public void testB1() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(Float.NaN, t.run(Float.MAX_VALUE, Float.NaN)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB2() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(Float.NaN, t.run(Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, -2.7f + */ + public void testB3() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(Float.NaN, t.run(Float.POSITIVE_INFINITY, -2.7f)); + } + + /** + * @title Arguments = -2.7f, Float.NEGATIVE_INFINITY + */ + public void testB4() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(-2.7f, t.run(-2.7f, Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(Float.NaN, t.run(0, 0)); + } + + /** + * @title Arguments = 0, -2.7 + */ + public void testB6() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(0f, t.run(0, -2.7f)); + } + + /** + * @title Arguments = -2.7, 0 + */ + public void testB7() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(Float.NaN, t.run(-2.7f, 0)); + } + + /** + * @title Arguments = 1, Float.MAX_VALUE + */ + public void testB8() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(0f, t.run(1, Float.MIN_VALUE)); + } + + /** + * @title Arguments = Float.MAX_VALUE, -1E-9f + */ + public void testB9() { + T_rem_float_1 t = new T_rem_float_1(); + assertEquals(7.2584893E-10f, t.run(Float.MAX_VALUE, -1E-9f)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_1.java b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_1.java new file mode 100644 index 00000000..dccf75d3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_float.jm; + +public class T_rem_float_1 { + + public float run(float a, float b) { + return a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_3.java b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_3.java new file mode 100644 index 00000000..f55af8ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_float.jm; + +public class T_rem_float_3 { + + public float run(float a, double b) { + return a%(float)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_4.java b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_4.java new file mode 100644 index 00000000..7369c3d1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_float.jm; + +public class T_rem_float_4 { + + public float run(long a, float b) { + return (float)a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_int/Test_rem_int.java b/jack-tests/tests/com/android/jack/opcodes/rem_int/Test_rem_int.java new file mode 100644 index 00000000..3c699a9a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_int/Test_rem_int.java @@ -0,0 +1,153 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.rem_int.jm.T_rem_int_1; +import com.android.jack.opcodes.rem_int.jm.T_rem_int_3; +import com.android.jack.opcodes.rem_int.jm.T_rem_int_4; + + +public class Test_rem_int extends DxTestCase { + + /** + * @title Arguments = 8, 4 + */ + public void testN1() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(0, t.run(8, 4)); + } + + /** + * @title Arguments = 1073741823, 4 + */ + public void testN2() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(3, t.run(1073741823, 4)); + } + + /** + * @title Dividend = 0 + */ + public void testN3() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(0, t.run(0, 4)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(-1, t.run(-10, 3)); + } + + /** + * @title Divisor is negative + */ + public void testN5() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(1, t.run(1073741824, -3)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN6() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(-697, t.run(-17895697, -3000)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN7() { + T_rem_int_3 t = new T_rem_int_3(); + assertEquals(-697, t.run(-17895697, -3000)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN8() { + T_rem_int_4 t = new T_rem_int_4(); + assertEquals(-697, t.run(-17895697, -3000)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, -1 + */ + public void testB1() { + T_rem_int_1 t = new T_rem_int_1(); + // result is MIN_VALUE because overflow occurs in this case + assertEquals(0, t.run(Integer.MIN_VALUE, -1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, 1 + */ + public void testB2() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(0, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, 1 + */ + public void testB3() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(0, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, Integer.MAX_VALUE + */ + public void testB4() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(-1, t.run(Integer.MIN_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = 1, Integer.MAX_VALUE + */ + public void testB5() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(1, t.run(1, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = 1, Integer.MIN_VALUE + */ + public void testB6() { + T_rem_int_1 t = new T_rem_int_1(); + assertEquals(1, t.run(1, Integer.MIN_VALUE)); + } + + /** + * @title Divisor is 0 + */ + public void testE1() { + T_rem_int_1 t = new T_rem_int_1(); + try { + t.run(1, 0); + fail("expected ArithmeticException"); + } catch (ArithmeticException ae) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_1.java b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_1.java new file mode 100644 index 00000000..5367c8a9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_int.jm; + +public class T_rem_int_1 { + + public int run(int a, int b) { + return a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_3.java b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_3.java new file mode 100644 index 00000000..23f7c606 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_int.jm; + +public class T_rem_int_3 { + + public int run(int a, double b) { + return a%(int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_4.java b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_4.java new file mode 100644 index 00000000..3e7b6e28 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_int.jm; + +public class T_rem_int_4 { + + public int run(long a, int b) { + return (int)a%b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_long/Test_rem_long.java b/jack-tests/tests/com/android/jack/opcodes/rem_long/Test_rem_long.java new file mode 100644 index 00000000..955b5fa0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_long/Test_rem_long.java @@ -0,0 +1,155 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.rem_long.jm.T_rem_long_1; +import com.android.jack.opcodes.rem_long.jm.T_rem_long_3; +import com.android.jack.opcodes.rem_long.jm.T_rem_long_4; +import com.android.jack.opcodes.rem_long.jm.T_rem_long_5; + + +public class Test_rem_long extends DxTestCase { + + /** + * @title Arguments = 10000000000l, 4000000000l + */ + public void testN1() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(2000000000l, t.run(10000000000l, 4000000000l)); + } + + /** + * @title Arguments = 1234567890123l, 123456789l + */ + public void testN2() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(123l, t.run(1234567890123l, 123456789l)); + } + + /** + * @title Dividend = 0 + */ + public void testN3() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(0l, t.run(0l, 1234567890123l)); + } + + /** + * @title Dividend is negative + */ + public void testN4() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(-2000000000l, t.run(-10000000000l, 4000000000l)); + } + + /** + * @title Divisor is negative + */ + public void testN5() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(2000000000l, t.run(10000000000l, -4000000000l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN6() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(-2000000000l, t.run(-10000000000l, -4000000000l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN7() { + T_rem_long_3 t = new T_rem_long_3(); + assertEquals(-2000000000l, t.run(-10000000000l, -4000000000l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN8() { + T_rem_long_4 t = new T_rem_long_4(); + assertEquals(-1000, t.run(-1000, -4000000000l)); + } + + /** + * @title Both Dividend and divisor are negative + */ + public void testN9() { + T_rem_long_5 t = new T_rem_long_5(); + assertEquals(-2000000000l, t.run(-10000000000l, -4000000000l)); + } + + /** + * @title Arguments = Long.MIN_VALUE, -1l + */ + public void testB1() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(0l, t.run(Long.MIN_VALUE, -1l)); + } + /** + * @title Arguments = Long.MIN_VALUE, 1l + */ + public void testB2() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(0l, t.run(Long.MIN_VALUE, 1l)); + } + /** + * @title Arguments = Long.MAX_VALUE, 1l + */ + public void testB3() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(0l, t.run(Long.MAX_VALUE, 1l)); + } + /** + * @title Arguments = Long.MIN_VALUE, Long.MAX_VALUE + */ + public void testB4() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(-1l, t.run(Long.MIN_VALUE, Long.MAX_VALUE)); + } + /** + * @title Arguments = 1l, Long.MAX_VALUE + */ + public void testB5() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(1l, t.run(1l, Long.MAX_VALUE)); + } + /** + * @title Arguments = 1l, Long.MIN_VALUE + */ + public void testB6() { + T_rem_long_1 t = new T_rem_long_1(); + assertEquals(1l, t.run(1l, Long.MIN_VALUE)); + } + + /** + * @title Divisor is 0 + */ + public void testE1() { + T_rem_long_1 t = new T_rem_long_1(); + try { + t.run(1234567890123l, 0l); + fail("expected ArithmeticException"); + } catch (ArithmeticException ae) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_1.java b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_1.java new file mode 100644 index 00000000..56028a2c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_long.jm; + +public class T_rem_long_1 { + + public long run(long a, long b) { + return a % b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_3.java b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_3.java new file mode 100644 index 00000000..46d24442 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_long.jm; + +public class T_rem_long_3 { + + public long run(long a, double b) { + return (long) (a % b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_4.java b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_4.java new file mode 100644 index 00000000..c43cb0e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_long.jm; + +public class T_rem_long_4 { + + public long run(int a, long b) { + return a % b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_5.java b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_5.java new file mode 100644 index 00000000..2953e831 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.rem_long.jm; + +public class T_rem_long_5 { + + public long run(long a, float b) { + return (long) (a % b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/Runner.java b/jack-tests/tests/com/android/jack/opcodes/return_object/Runner.java new file mode 100644 index 00000000..81dcc1bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/Runner.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object; + +public interface Runner { + public void doit(); +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/RunnerGenerator.java b/jack-tests/tests/com/android/jack/opcodes/return_object/RunnerGenerator.java new file mode 100644 index 00000000..cd17a538 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/RunnerGenerator.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object; + +public interface RunnerGenerator { + public Runner run(); +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/Test_return_object.java b/jack-tests/tests/com/android/jack/opcodes/return_object/Test_return_object.java new file mode 100644 index 00000000..9ed11ce3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/Test_return_object.java @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.return_object.jm.T_return_object_1; +import com.android.jack.opcodes.return_object.jm.T_return_object_12; +import com.android.jack.opcodes.return_object.jm.T_return_object_13; +import com.android.jack.opcodes.return_object.jm.T_return_object_2; +import com.android.jack.opcodes.return_object.jm.T_return_object_6; +import com.android.jack.opcodes.return_object.jm.T_return_object_7; +import com.android.jack.opcodes.return_object.jm.T_return_object_9; + + +public class Test_return_object extends DxTestCase { + + /** + * @title simple + */ + public void testN1() { + T_return_object_1 t = new T_return_object_1(); + assertEquals("hello", t.run()); + } + + /** + * @title simple + */ + public void testN2() { + T_return_object_1 t = new T_return_object_1(); + assertEquals(t, t.run2()); + } + + /** + * @title simple + */ + public void testN3() { + T_return_object_1 t = new T_return_object_1(); + Integer a = 12345; + assertEquals(a, t.run3()); + } + + /** + * @title test for null + */ + public void testN4() { + T_return_object_2 t = new T_return_object_2(); + assertNull(t.run()); + } + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN5() { + T_return_object_6 t = new T_return_object_6(); + assertEquals("hello", t.run()); + } + + /** + * @title check that monitor is released by return_object + */ + public void testN6() { + assertTrue(T_return_object_7.execute()); + } + + /** + * @title assignment compatibility (TChild returned as TSuper) + */ + public void testN7() { + // @uses com.android.jack.opcodes.return_object.jm.TSuper + // @uses com.android.jack.opcodes.return_object.jm.TInterface + // @uses com.android.jack.opcodes.return_object.jm.TChild + T_return_object_12 t = new T_return_object_12(); + assertTrue(t.run()); + } + + /** + * @title assignment compatibility (TChild returned as TInterface) + */ + public void testN8() { + // @uses com.android.jack.opcodes.return_object.jm.TInterface + // @uses com.android.jack.opcodes.return_object.jm.TChild + // @uses com.android.jack.opcodes.return_object.jm.TSuper + T_return_object_13 t = new T_return_object_13(); + assertTrue(t.run()); + } + + /** + * @title Lock structural rule 1 is violated + */ + public void testE2() { + T_return_object_9 t = new T_return_object_9(); + try { + assertEquals("abc", t.run()); + System.out.print("dvmvfe:"); + //fail("expected IllegalMonitorStateException"); + } catch (IllegalMonitorStateException imse) { + // expected + } + } + + /** + * @constraint 4.8.2.14 + * @title assignment incompatible references + */ + @SuppressWarnings("cast") + public void testVFE7() { + // @uses com.android.jack.opcodes.return_object.jm.TSuper2 + // @uses com.android.jack.opcodes.return_object.Runner + // @uses com.android.jack.opcodes.return_object.RunnerGenerator + try { + RunnerGenerator rg = (RunnerGenerator) Class.forName( + "com.android.jack.opcodes.return_object.jm.T_return_object_15").newInstance(); + Runner r = rg.run(); + assertFalse(r instanceof Runner); + assertFalse(Runner.class.isAssignableFrom(r.getClass())); + // only upon invocation of a concrete method, + // a java.lang.IncompatibleClassChangeError is thrown + r.doit(); +// fail("expected a verification exception"); + } catch (Throwable t) { +// DxUtil.checkVerifyException(t); + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_1.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_1.java new file mode 100644 index 00000000..2539675e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_1.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_1 { + + public String run() { + return "hello"; + } + + public Object run2() { + return this; + } + + public Integer run3() { + Integer value = new Integer(12345); + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_12.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_12.java new file mode 100644 index 00000000..e154bcdc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_12.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_12 { + + private TSuper test() { + return new TChild(); + } + + public boolean run() { + TSuper t = test(); + return (t instanceof TChild); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_13.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_13.java new file mode 100644 index 00000000..6a97d1f5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_13.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + + +public class T_return_object_13 { + + private TInterface test() { + return new TChild(); + } + + public boolean run() { + TInterface t = test(); + return (t instanceof TChild); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_15.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_15.java new file mode 100644 index 00000000..dff40a24 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_15.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + + +public class T_return_object_15 { + + private TInterface test() { + //return new TSuper2(); + return new TSuper(); + } + + public boolean run() { + TInterface t = test(); + return (t instanceof TSuper); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_2.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_2.java new file mode 100644 index 00000000..c509f434 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_2 { + + public Object run() { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_3.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_3.java new file mode 100644 index 00000000..e15f65b0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_3 { + + public String run() { + return "hello"; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_6.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_6.java new file mode 100644 index 00000000..5bbd3fa1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_6.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_6 { + + public String run() { + return "hello"; + } + + private static String test() { + String a = "aaa"; + String b = "bbb"; + String c = "ccc"; + return "ddd"; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_7.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_7.java new file mode 100644 index 00000000..ed7d4b8c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_7.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +import com.android.jack.opcodes.return_object.jm.T_return_object_7; + +public class T_return_object_7 implements Runnable { + public final static int CNT = 1000; + Integer value = new Integer(0); + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized Integer test() { + Integer c = new Integer(value.intValue() + 1); + + value = c; + Thread.yield(); + if(c != value) + failed = true; + return c; + } + + public static boolean execute() { + T_return_object_7 test = new T_return_object_7(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value.intValue() != CNT * 2) + return false; + return !test.failed; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_9.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_9.java new file mode 100644 index 00000000..ee69b101 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/T_return_object_9.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + +public class T_return_object_9 { + + public String run() { + return "abc"; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_object/jm/TetsStubs.java b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/TetsStubs.java new file mode 100644 index 00000000..171b57fa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_object/jm/TetsStubs.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_object.jm; + + +interface TInterface{ + +} + +class TSuper implements TInterface { + +} + +class TChild extends TSuper { + +} + +class TSuper2 { + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/Test_return_wide.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/Test_return_wide.java new file mode 100644 index 00000000..681f49a2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/Test_return_wide.java @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_11; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_12; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_13; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_14; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_1; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_10; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_2; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_6; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_7; +import com.android.jack.opcodes.return_wide.jm.T_return_wide_9; + + +public class Test_return_wide extends DxTestCase { + + /** + * @title simple + */ + public void testN1() { + T_return_wide_1 t = new T_return_wide_1(); + assertEquals(123456d, t.run()); + } + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN2() { + T_return_wide_6 t = new T_return_wide_6(); + assertEquals(123456d, t.run()); + } + + /** + * @title check that monitor is released by return_wide + */ + public void testN3() { + assertTrue(T_return_wide_7.execute()); + } + + /** + * @title simple + */ + public void testN4() { + T_return_wide_2 t = new T_return_wide_2(); + assertEquals(0d, t.run()); + } + + /** + * @title simple + */ + public void testN5() { + T_return_wide_10 t = new T_return_wide_10(); + assertEquals(1d, t.run()); + } + + +// /** +// * @title Method is synchronized but thread is not monitor owner +// */ +// public void testE1() { +// T_return_wide_8 t = new T_return_wide_8(); +// try { +// assertTrue(t.run()); +// fail("expected IllegalMonitorStateException"); +// } catch (IllegalMonitorStateException imse) { +// // expected +// } +// } + + /** + * @title Lock structural rule 1 is violated + */ + public void testE2() { + T_return_wide_9 t = new T_return_wide_9(); + try { + assertEquals(1d, t.run()); + System.out.print("dvmvfe:"); + //fail("expected IllegalMonitorStateException"); + } catch (IllegalMonitorStateException imse) { + // expected + } + } + + /** + * @title simple + */ + public void testN1Long() { + T_return_wide_11 t = new T_return_wide_11(); + assertEquals(12345612345l, t.run()); + } + + /** + * @title check that frames are discarded and reinstananted correctly + */ + public void testN2Long() { + T_return_wide_12 t = new T_return_wide_12(); + assertEquals(12345612345l, t.run()); + } + + /** + * @title check that monitor is released by return_wide + */ + public void testN3Long() { + assertTrue(T_return_wide_13.execute()); + } + + + /** + * @title Method is synchronized but thread is not monitor owner + */ + public void testE1Long() { + T_return_wide_14 t = new T_return_wide_14(); + assertTrue(t.run()); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_1.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_1.java new file mode 100644 index 00000000..93680ad4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_1 { + + public double run() { + return 123456d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_10.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_10.java new file mode 100644 index 00000000..966ca3f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_10.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_10 { + + private static double test() { + return 1d; + } + + public double run() { + return test(); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_11.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_11.java new file mode 100644 index 00000000..0617e62d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_11.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_11 { + + public long run() { + return 12345612345l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_12.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_12.java new file mode 100644 index 00000000..8a38a1ca --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_12.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_12 { + + public long run() { + return 12345612345l; + } + + private static long test() { + long a = 11111111111l; + long b = 22222222222l; + long c = 33333333333l; + return 44444444444l; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_13.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_13.java new file mode 100644 index 00000000..78a8306a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_13.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + + +public class T_return_wide_13 implements Runnable { + public final static int CNT = 1000; + long value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized long test() { + value++; + long c = value; + Thread.yield(); + if(c != value) + failed = true; + return c; + } + + public static boolean execute() { + T_return_wide_13 test = new T_return_wide_13(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_14.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_14.java new file mode 100644 index 00000000..c318e329 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_14.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_14 { + + private synchronized long test() { + return 0l; + } + + public boolean run() { + test(); + return true; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_2.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_2.java new file mode 100644 index 00000000..e7283285 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_2.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_2 { + + public double run() { + return 0d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_6.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_6.java new file mode 100644 index 00000000..b0830a05 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_6.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_6 { + + public double run() { + return 123456d; + } + + private static double test() { + double a = 1111d; + double b = 2222d; + double c = 3333d; + return 4444d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_7.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_7.java new file mode 100644 index 00000000..84c0395d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_7.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_7 implements Runnable { + public final static int CNT = 1000; + double value = 0; + boolean failed = false; + + public void run() { + for(int i = 0; i < CNT; i++) { + test(); + } + } + + private synchronized double test() { + value++; + double c = value; + Thread.yield(); + if(c != value) + failed = true; + return c; + } + + public static boolean execute() { + T_return_wide_7 test = new T_return_wide_7(); + Thread t1 = new Thread(test); + Thread t2 = new Thread(test); + + t1.start(); + t2.start(); + + try + { + Thread.sleep(5000); + } + catch(InterruptedException ie) { + return false; + } + + if(test.value != CNT * 2) + return false; + return !test.failed; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_8.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_8.java new file mode 100644 index 00000000..bce3f500 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_8.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_8 { + + private synchronized double test() { + return 0d; + } + + public boolean run() { + test(); + return true; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_9.java b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_9.java new file mode 100644 index 00000000..637fa910 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_9.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.return_wide.jm; + +public class T_return_wide_9 { + + public double run() { + return 1d; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/sget/TestStubs.java new file mode 100644 index 00000000..e07ab86d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/TestStubs.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget; + +public class TestStubs { + private static int TestStubField = 50; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/Test_sget.java b/jack-tests/tests/com/android/jack/opcodes/sget/Test_sget.java new file mode 100644 index 00000000..877c0637 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/Test_sget.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sget.jm.T_sget_1; +import com.android.jack.opcodes.sget.jm.T_sget_11; +import com.android.jack.opcodes.sget.jm.T_sget_2; +import com.android.jack.opcodes.sget.jm.T_sget_5; +import com.android.jack.opcodes.sget.jm.T_sget_9; + + +public class Test_sget extends DxTestCase { + + /** + * @title type - int + */ + public void testN1() { + T_sget_1 t = new T_sget_1(); + assertEquals(35, t.run()); + } + + /** + * @title type - double + */ + public void testN2() { + T_sget_2 t = new T_sget_2(); + assertEquals(123d, t.run()); + } + + /** + * @title access protected field from subclass + */ + public void testN3() { + // @uses com.android.jack.opcodes.sget.jm.T_sget_1 + T_sget_11 t = new T_sget_11(); + assertEquals(10, t.run()); + } + + /** + * @title attempt to access non-static field + */ + public void testN4() { + T_sget_5 t = new T_sget_5(); + assertEquals(5, t.run()); + } + + /** + * @title initialization of referenced class throws exception + */ + public void testE6() { + // @uses com.android.jack.opcodes.sget.jm.StubInitError + T_sget_9 t = new T_sget_9(); + try { + t.run(); + fail("expected Error"); + } catch (Error e) { + // expected + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_1.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_1.java new file mode 100644 index 00000000..1c953faa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_1.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + +public class T_sget_1 { + public static int i1 = 5; + protected static int p1 = 10; + private static int pvt1 = 20; + + public int run(){ + return i1 + p1 + pvt1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_11.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_11.java new file mode 100644 index 00000000..dd42f1bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_11.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + +public class T_sget_11 extends T_sget_1 { + + public int run(){ + return p1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_2.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_2.java new file mode 100644 index 00000000..f4912e61 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + +public class T_sget_2 { + + public static double val = 123.0d; + + public double run() { + return val; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_4.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_4.java new file mode 100644 index 00000000..e9134ad4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + +public class T_sget_4 { + + public static int i1 = 5; + public int run(){ + return i1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_5.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_5.java new file mode 100644 index 00000000..5d2f882a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_5.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + +public class T_sget_5 { + + public int i1 = 5; + public int run(){ + return i1; + } +} + diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_9.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_9.java new file mode 100644 index 00000000..57e09e20 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/T_sget_9.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + + +public class T_sget_9 { + + public int run(){ + return StubInitError.value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sget/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/sget/jm/TestStubs.java new file mode 100644 index 00000000..9b871e55 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sget/jm/TestStubs.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sget.jm; + + +class StubInitError{ + public static int value = 5 / 0; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_int/Test_shl_int.java b/jack-tests/tests/com/android/jack/opcodes/shl_int/Test_shl_int.java new file mode 100644 index 00000000..147b21dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_int/Test_shl_int.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.shl_int.jm.T_shl_int_1; +import com.android.jack.opcodes.shl_int.jm.T_shl_int_3; +import com.android.jack.opcodes.shl_int.jm.T_shl_int_4; + + +public class Test_shl_int extends DxTestCase { + + /** + * @title 15 << 1 + */ + public void testN1() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(30, t.run(15, 1)); + } + + /** + * @title 33 << 2 + */ + public void testN2() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(132, t.run(33, 2)); + } + + /** + * @title -15 << 1 + */ + public void testN3() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(-30, t.run(-15, 1)); + } + + /** + * @title Arguments = 1 & -1 + */ + public void testN4() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(0x80000000, t.run(1, -1)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN5() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(66, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN6() { + T_shl_int_3 t = new T_shl_int_3(); + assertEquals(66, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN7() { + T_shl_int_4 t = new T_shl_int_4(); + assertEquals(66, t.run(33, 33)); + } + + /** + * FIXME: do we need to check that all the shift distances (0..31) works + * fine? + */ + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & 1 + */ + public void testB2() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(0xfffffffe, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE & 1 + */ + public void testB3() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(0, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 1 & 0 + */ + public void testB4() { + T_shl_int_1 t = new T_shl_int_1(); + assertEquals(1, t.run(1, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_1.java b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_1.java new file mode 100644 index 00000000..03594252 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_int.jm; + +public class T_shl_int_1 { + + public int run(int a, int b) { + return a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_3.java b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_3.java new file mode 100644 index 00000000..81b4b7f2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_int.jm; + +public class T_shl_int_3 { + + public int run(double a, int b) { + return (int)a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_4.java b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_4.java new file mode 100644 index 00000000..59d606fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_int.jm; + +public class T_shl_int_4 { + + public int run(int a, long b) { + return a << (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_long/Test_shl_long.java b/jack-tests/tests/com/android/jack/opcodes/shl_long/Test_shl_long.java new file mode 100644 index 00000000..4cac7eb7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_long/Test_shl_long.java @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.shl_long.jm.T_shl_long_1; +import com.android.jack.opcodes.shl_long.jm.T_shl_long_3; +import com.android.jack.opcodes.shl_long.jm.T_shl_long_4; +import com.android.jack.opcodes.shl_long.jm.T_shl_long_5; + + +public class Test_shl_long extends DxTestCase { + + /** + * @title Arguments = 5000000000l, 3 + */ + public void testN1() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(40000000000l, t.run(5000000000l, 3)); + } + + /** + * @title Arguments = 5000000000l, 1 + */ + public void testN2() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(10000000000l, t.run(5000000000l, 1)); + } + + /** + * @title Arguments = -5000000000l, 1 + */ + public void testN3() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(-10000000000l, t.run(-5000000000l, 1)); + } + + /** + * @title Arguments = 1, -1 + */ + public void testN4() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(0x8000000000000000l, t.run(1l, -1)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN5() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(130l, t.run(65l, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN6() { + T_shl_long_3 t = new T_shl_long_3(); + assertEquals(130l, t.run(65l, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN7() { + T_shl_long_4 t = new T_shl_long_4(); + assertEquals(130l, t.run(65, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN8() { + T_shl_long_5 t = new T_shl_long_5(); + assertEquals(130l, t.run(65l, 65)); + } + + /** + * @title Arguments = 0, -1 + */ + public void testB1() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = 1, 0 + */ + public void testB2() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(1, t.run(1, 0)); + } + + /** + * @title Arguments = Long.MAX_VALUE, 1 + */ + public void testB3() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(0xfffffffe, t.run(Long.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Long.MIN_VALUE, 1 + */ + public void testB4() { + T_shl_long_1 t = new T_shl_long_1(); + assertEquals(0l, t.run(Long.MIN_VALUE, 1)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_1.java b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_1.java new file mode 100644 index 00000000..9154ff06 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_long.jm; + +public class T_shl_long_1 { + + public long run(long a, int b) { + return a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_3.java b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_3.java new file mode 100644 index 00000000..3148122d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_long.jm; + +public class T_shl_long_3 { + + public long run(double a, int b) { + return (long)a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_4.java b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_4.java new file mode 100644 index 00000000..4e1ad56e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_long.jm; + +public class T_shl_long_4 { + + public long run(int a, int b) { + return a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_5.java b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_5.java new file mode 100644 index 00000000..05eb274f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shl_long.jm; + +public class T_shl_long_5 { + + public long run(float a, int b) { + return (long)a << b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_int/Test_shr_int.java b/jack-tests/tests/com/android/jack/opcodes/shr_int/Test_shr_int.java new file mode 100644 index 00000000..9204f213 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_int/Test_shr_int.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.shr_int.jm.T_shr_int_1; +import com.android.jack.opcodes.shr_int.jm.T_shr_int_3; +import com.android.jack.opcodes.shr_int.jm.T_shr_int_4; + + +public class Test_shr_int extends DxTestCase { + + /** + * @title 15 >> 1 + */ + public void testN1() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(7, t.run(15, 1)); + } + + /** + * @title 33 >> 2 + */ + public void testN2() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(8, t.run(33, 2)); + } + + /** + * @title -15 >> 1 + */ + public void testN3() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(-8, t.run(-15, 1)); + } + + /** + * @title Arguments = 1 & -1 + */ + public void testN4() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(0, t.run(1, -1)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN5() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN6() { + T_shr_int_3 t = new T_shr_int_3(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN7() { + T_shr_int_4 t = new T_shr_int_4(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & 1 + */ + public void testB2() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(0x3FFFFFFF, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE & 1 + */ + public void testB3() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(0xc0000000, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 1 & 0 + */ + public void testB4() { + T_shr_int_1 t = new T_shr_int_1(); + assertEquals(1, t.run(1, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_1.java b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_1.java new file mode 100644 index 00000000..8c452240 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_int.jm; + +public class T_shr_int_1 { + + public int run(int a, int b) { + return a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_3.java b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_3.java new file mode 100644 index 00000000..7fc62a65 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_int.jm; + +public class T_shr_int_3 { + + public int run(double a, int b) { + return (int)a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_4.java b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_4.java new file mode 100644 index 00000000..0f24f41d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_int.jm; + +public class T_shr_int_4 { + + public int run(int a, long b) { + return a >> (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_long/Test_shr_long.java b/jack-tests/tests/com/android/jack/opcodes/shr_long/Test_shr_long.java new file mode 100644 index 00000000..7e5cac6c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_long/Test_shr_long.java @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.shr_long.jm.T_shr_long_1; +import com.android.jack.opcodes.shr_long.jm.T_shr_long_3; +import com.android.jack.opcodes.shr_long.jm.T_shr_long_4; +import com.android.jack.opcodes.shr_long.jm.T_shr_long_5; + + +public class Test_shr_long extends DxTestCase { + + /** + * @title Arguments = 40000000000l, 3 + */ + public void testN1() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(5000000000l, t.run(40000000000l, 3)); + } + + /** + * @title Arguments = 40000000000l, 1 + */ + public void testN2() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(20000000000l, t.run(40000000000l, 1)); + } + + /** + * @title Arguments = -40000000000l, 1 + */ + public void testN3() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(-20000000000l, t.run(-40000000000l, 1)); + } + + /** + * @title Arguments = 1, -1 + */ + public void testN4() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(0l, t.run(1l, -1)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN5() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(32, t.run(65l, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN6() { + T_shr_long_3 t = new T_shr_long_3(); + assertEquals(32, t.run(65l, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN7() { + T_shr_long_4 t = new T_shr_long_4(); + assertEquals(32, t.run(65, 65)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 64. + */ + public void testN8() { + T_shr_long_5 t = new T_shr_long_5(); + assertEquals(32, t.run(65l, 65)); + } + + /** + * @title Arguments = 0, -1 + */ + public void testB1() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(0l, t.run(0l, -1)); + } + + /** + * @title Arguments = 1, 0 + */ + public void testB2() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(1l, t.run(1l, 0)); + } + + /** + * @title Arguments = Long.MAX_VALUE, 1 + */ + public void testB3() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(0x3FFFFFFFFFFFFFFFl, t.run(Long.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Long.MIN_VALUE, 1 + */ + public void testB4() { + T_shr_long_1 t = new T_shr_long_1(); + assertEquals(0xc000000000000000l, t.run(Long.MIN_VALUE, 1)); + } + + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_1.java b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_1.java new file mode 100644 index 00000000..921b951a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_long.jm; + +public class T_shr_long_1 { + + public long run(long a, int b) { + return a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_3.java b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_3.java new file mode 100644 index 00000000..bf351795 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_long.jm; + +public class T_shr_long_3 { + + public long run(double a, int b) { + return (long)a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_4.java b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_4.java new file mode 100644 index 00000000..69a4c3ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_long.jm; + +public class T_shr_long_4 { + + public long run(int a, int b) { + return a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_5.java b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_5.java new file mode 100644 index 00000000..27e20c13 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.shr_long.jm; + +public class T_shr_long_5 { + + public long run(float a, int b) { + return (long)a >> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sparse_switch/Test_sparse_switch.java b/jack-tests/tests/com/android/jack/opcodes/sparse_switch/Test_sparse_switch.java new file mode 100644 index 00000000..f44b5d18 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sparse_switch/Test_sparse_switch.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sparse_switch; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sparse_switch.jm.T_sparse_switch_1; + + +public class Test_sparse_switch extends DxTestCase { + + /** + * @title normal test + */ + public void testN1() { + T_sparse_switch_1 t = new T_sparse_switch_1(); + assertEquals(2, t.run(-1)); + + assertEquals(-1, t.run(9)); + assertEquals(20, t.run(10)); + assertEquals(-1, t.run(11)); + + assertEquals(-1, t.run(14)); + assertEquals(20, t.run(15)); + assertEquals(-1, t.run(16)); + } + + /** + * @title check Integer.MAX_VALUE + */ + public void testB1() { + T_sparse_switch_1 t = new T_sparse_switch_1(); + assertEquals(-1, t.run(Integer.MAX_VALUE)); + } + + /** + * @title check Integer.MIN_VALUE + */ + public void testB2() { + T_sparse_switch_1 t = new T_sparse_switch_1(); + assertEquals(-1, t.run(Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sparse_switch/jm/T_sparse_switch_1.java b/jack-tests/tests/com/android/jack/opcodes/sparse_switch/jm/T_sparse_switch_1.java new file mode 100644 index 00000000..a435a348 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sparse_switch/jm/T_sparse_switch_1.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sparse_switch.jm; + +public class T_sparse_switch_1 { + + public int run(int i) { + switch (i) { + case -1: + return 2; + case 10: + case 15: + return 20; + default: + return -1; + } + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/sput/TestStubs.java new file mode 100644 index 00000000..551d1936 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/TestStubs.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput; + +public class TestStubs { + // used by testE2 + static int TestStubField = 0; + + // used by testE5 + public static final int TestStubFieldFinal = 0; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/Test_sput.java b/jack-tests/tests/com/android/jack/opcodes/sput/Test_sput.java new file mode 100644 index 00000000..37d031ca --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/Test_sput.java @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sput.jm.T_sput_1; +import com.android.jack.opcodes.sput.jm.T_sput_13; +import com.android.jack.opcodes.sput.jm.T_sput_14; +import com.android.jack.opcodes.sput.jm.T_sput_16; +import com.android.jack.opcodes.sput.jm.T_sput_18; +import com.android.jack.opcodes.sput.jm.T_sput_2; +import com.android.jack.opcodes.sput.jm.T_sput_6; + + +public class Test_sput extends DxTestCase { + + /** + * @title type - int + */ + public void testN1() { + T_sput_1 t = new T_sput_1(); + assertEquals(0, T_sput_1.st_i1); + t.run(); + assertEquals(1000000, T_sput_1.st_i1); + } + + /** + * @title type - double + */ + public void testN2() { + T_sput_2 t = new T_sput_2(); + assertEquals(0d, T_sput_2.st_d1); + t.run(); + assertEquals(1000000d, T_sput_2.st_d1); + } + + /** + * @title modification of protected field from subclass + */ + public void testN4() { + // @uses com.android.jack.opcodes.sput.jm.T_sput_1 + T_sput_14 t = new T_sput_14(); + assertEquals(0, T_sput_14.getProtectedField()); + t.run(); + assertEquals(1000000, T_sput_14.getProtectedField()); + } + + /** + * @title assignment compatible references + */ + public void testN5() { + T_sput_16 t = new T_sput_16(); + assertNull(T_sput_16.o); + t.run(); + assertEquals("", (String) T_sput_16.o); + } + + /** + * @title modification of protected field from subclass + */ + public void testN6() { + T_sput_6 t = new T_sput_6(); + assertEquals(null, T_sput_6.s); + try { + t.run(); + fail ("ClassCastException expected"); + } + catch (ClassCastException e) { + // expected + } + assertEquals(null, T_sput_6.s); + } + + /** + * @title modification of protected field from subclass + */ + public void testN7() { + T_sput_18 t = new T_sput_18(); + assertEquals(0, T_sput_18.v); + t.run(); + assertEquals(3, T_sput_18.v); + } + + /** + * @title initialization of referenced class throws exception + */ + public void testE6() { + // @uses com.android.jack.opcodes.sput.jm.StubInitError + T_sput_13 t = new T_sput_13(); + try { + t.run(); + fail("expected Error"); + } catch (Error e) { + // expected + } + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_1.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_1.java new file mode 100644 index 00000000..3a7dbb35 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_1.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_1 { + public static int st_i1; + protected static int st_p1; + private static int st_pvt1; + + public void run() { + st_i1 = 1000000; + } + + public static int getPvtField() + { + return st_pvt1; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_13.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_13.java new file mode 100644 index 00000000..1dfc6dfe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_13.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_13 { + + public int run() { + return StubInitError.value; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_14.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_14.java new file mode 100644 index 00000000..63edca5d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_14.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_14 extends T_sput_1{ + + public void run() { + T_sput_1.st_p1 = 1000000; + } + + public static int getProtectedField(){ + return T_sput_1.st_p1; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_16.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_16.java new file mode 100644 index 00000000..f34d33e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_16.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_16 { + + public static Object o = null; + + public void run() { + String s = new String(""); + o = s; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_18.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_18.java new file mode 100644 index 00000000..283c19fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_18.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_18 { + + public static int v; + + public void run() { + v = (int)3.14f; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_2.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_2.java new file mode 100644 index 00000000..f2cafe50 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_2.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_2 { + + public static double st_d1; + + public void run() { + st_d1 = 1000000d; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_6.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_6.java new file mode 100644 index 00000000..64f0676d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/T_sput_6.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + +public class T_sput_6 { + + public static String s; + + public void run() { + Object o = new Object(); + s = (String)o; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sput/jm/TestStubs.java b/jack-tests/tests/com/android/jack/opcodes/sput/jm/TestStubs.java new file mode 100644 index 00000000..55ce04da --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sput/jm/TestStubs.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sput.jm; + + +class StubInitError{ + public static int value = 5 / 0; +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_double/Test_sub_double.java b/jack-tests/tests/com/android/jack/opcodes/sub_double/Test_sub_double.java new file mode 100644 index 00000000..78d541df --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_double/Test_sub_double.java @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_double; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sub_double.jm.T_sub_double_1; +import com.android.jack.opcodes.sub_double.jm.T_sub_double_3; +import com.android.jack.opcodes.sub_double.jm.T_sub_double_4; + + +public class Test_sub_double extends DxTestCase { + + /** + * @title Arguments = 2.7d, 3.14d + */ + public void testN1() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(-0.43999999999999995d, t.run(2.7d, 3.14d)); + } + + /** + * @title Arguments = 0, -3.14d + */ + public void testN2() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(3.14d, t.run(0, -3.14d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN3() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(-0.43999999999999995d, t.run(-3.14d, -2.7d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN4() { + T_sub_double_3 t = new T_sub_double_3(); + assertEquals(-0.4400001049041746d, t.run(-3.14f, -2.7d)); + } + + /** + * @title Arguments = -3.14d, -2.7d + */ + public void testN5() { + T_sub_double_4 t = new T_sub_double_4(); + assertEquals(-311.3, t.run(-314l, -2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.NaN + */ + public void testB1() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(Double.NaN, t.run(Double.MAX_VALUE, Double.NaN)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.NEGATIVE_INFINITY + */ + public void testB2() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + Double.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, + * Double.POSITIVE_INFINITY + */ + public void testB3() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(Double.NaN, t.run(Double.POSITIVE_INFINITY, + Double.POSITIVE_INFINITY)); + } + + /** + * @title Arguments = Double.POSITIVE_INFINITY, -2.7d + */ + public void testB4() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(Double.POSITIVE_INFINITY, t.run(Double.POSITIVE_INFINITY, + -2.7d)); + } + + /** + * @title Arguments = +0, -0d + */ + public void testB5() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(+0d, t.run(+0d, -0d)); + } + + /** + * @title Arguments = -0d, -0d + */ + public void testB6() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(0d, t.run(-0d, -0d)); + } + + /** + * @title Arguments = +0d, +0d + */ + public void testB7() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(+0d, t.run(+0d, +0d)); + } + + /** + * @title Arguments = 2.7d, 2.7d + */ + public void testB8() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(0d, t.run(2.7d, 2.7d)); + } + + /** + * @title Arguments = Double.MAX_VALUE, Double.MAX_VALUE + */ + public void testB9() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(0d, t.run(Double.MAX_VALUE, Double.MAX_VALUE)); + } + + /** + * @title Arguments = Double.MIN_VALUE, 4.9E-324 + */ + public void testB10() { + T_sub_double_1 t = new T_sub_double_1(); + assertEquals(0d, t.run(Double.MIN_VALUE, 4.9E-324)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_1.java b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_1.java new file mode 100644 index 00000000..9fc3e6bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_double.jm; + +public class T_sub_double_1 { + + public double run(double a, double b) { + return a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_3.java b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_3.java new file mode 100644 index 00000000..6d46eba2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_double.jm; + +public class T_sub_double_3 { + + public double run(float a, double b) { + return (double)a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_4.java b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_4.java new file mode 100644 index 00000000..ee5a435c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_double.jm; + +public class T_sub_double_4 { + + public double run(long a, double b) { + return (double)a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_float/Test_sub_float.java b/jack-tests/tests/com/android/jack/opcodes/sub_float/Test_sub_float.java new file mode 100644 index 00000000..ce2846dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_float/Test_sub_float.java @@ -0,0 +1,160 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_float; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sub_float.jm.T_sub_float_1; +import com.android.jack.opcodes.sub_float.jm.T_sub_float_3; +import com.android.jack.opcodes.sub_float.jm.T_sub_float_4; + + +public class Test_sub_float extends DxTestCase { + + /** + * @title Arguments = 2.7f, 3.14f + */ + public void testN1() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(-0.44000006f, t.run(2.7f, 3.14f)); + } + + /** + * @title Arguments = 0, -3.14f + */ + public void testN2() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(3.14f, t.run(0, -3.14f)); + } + + /** + * @title Arguments = -3.14f, -2.7f + */ + public void testN3() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(-0.44000006f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -3.14f, -2.7f + */ + public void testN4() { + T_sub_float_3 t = new T_sub_float_3(); + assertEquals(-0.44000006f, t.run(-3.14f, -2.7f)); + } + + /** + * @title Arguments = -3.14f, -2.7f + */ + public void testN5() { + T_sub_float_4 t = new T_sub_float_4(); + assertEquals(-311.3f, t.run(-314l, -2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.NaN + */ + public void testB1() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(Float.NaN, t.run(Float.MAX_VALUE, Float.NaN)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.NEGATIVE_INFINITY + */ + public void testB2() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + Float.NEGATIVE_INFINITY)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, + * Float.POSITIVE_INFINITY + */ + public void testB3() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(Float.NaN, t.run(Float.POSITIVE_INFINITY, + Float.POSITIVE_INFINITY)); + } + + /** + * @title Arguments = Float.POSITIVE_INFINITY, -2.7f + */ + public void testB4() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.POSITIVE_INFINITY, + -2.7f)); + } + + /** + * @title Arguments = +0, -0f + */ + public void testB5() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(+0f, t.run(+0f, -0f)); + } + + /** + * @title Arguments = -0f, -0f + */ + public void testB6() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(0f, t.run(-0f, -0f)); + } + + /** + * @title Arguments = +0f, +0f + */ + public void testB7() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(+0f, t.run(+0f, +0f)); + } + + /** + * @title Arguments = 2.7f, 2.7f + */ + public void testB8() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(0f, t.run(2.7f, 2.7f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, Float.MAX_VALUE + */ + public void testB9() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(0f, t.run(Float.MAX_VALUE, Float.MAX_VALUE)); + } + + /** + * @title Arguments = Float.MIN_VALUE, -1.4E-45f + */ + public void testB10() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(0f, t.run(Float.MIN_VALUE, 1.4E-45f)); + } + + /** + * @title Arguments = Float.MAX_VALUE, -Float.MAX_VALUE + */ + public void testB11() { + T_sub_float_1 t = new T_sub_float_1(); + assertEquals(Float.POSITIVE_INFINITY, t.run(Float.MAX_VALUE, + -3.402823E+38F)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_1.java b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_1.java new file mode 100644 index 00000000..77745b3f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_float.jm; + +public class T_sub_float_1 { + + public float run(float a, float b) { + return a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_3.java b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_3.java new file mode 100644 index 00000000..b2ecb1fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_float.jm; + +public class T_sub_float_3 { + + public float run(float a, double b) { + return a-(float)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_4.java b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_4.java new file mode 100644 index 00000000..ce1a01e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_float.jm; + +public class T_sub_float_4 { + + public float run(long a, float b) { + return (float)a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_int/Test_sub_int.java b/jack-tests/tests/com/android/jack/opcodes/sub_int/Test_sub_int.java new file mode 100644 index 00000000..40d80471 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_int/Test_sub_int.java @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sub_int.jm.T_sub_int_1; +import com.android.jack.opcodes.sub_int.jm.T_sub_int_3; +import com.android.jack.opcodes.sub_int.jm.T_sub_int_4; + + +public class Test_sub_int extends DxTestCase { + + /** + * @title Arguments = 8, 4 + */ + public void testN1() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(4, t.run(8, 4)); + } + + /** + * @title Arguments = 0, 255 + */ + public void testN2() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(-255, t.run(0, 255)); + } + + /** + * @title Arguments = 0, -65536 + */ + public void testN3() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(65536, t.run(0, -65536)); + } + + /** + * @title Arguments = 0, -2147483647 + */ + public void testN4() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(0, -2147483647)); + } + + /** + * @title Arguments = 0, -2147483647 + */ + public void testN5() { + T_sub_int_3 t = new T_sub_int_3(); + assertEquals(Integer.MAX_VALUE, t.run(0, -2147483647)); + } + + /** + * @title Arguments = 0, -2147483647 + */ + public void testN6() { + T_sub_int_4 t = new T_sub_int_4(); + assertEquals(Integer.MAX_VALUE, t.run(0, -2147483647)); + } + + /** + * @title Arguments = 0, Integer.MAX_VALUE + */ + public void testB1() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(-2147483647, t.run(0, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MAX_VALUE + */ + public void testB2() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(0, t.run(Integer.MAX_VALUE, Integer.MAX_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, -1 + */ + public void testB3() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(Integer.MIN_VALUE, t.run(Integer.MAX_VALUE, -1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE, 1 + */ + public void testB4() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(Integer.MAX_VALUE, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 0, 0 + */ + public void testB5() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(0, t.run(0, 0)); + } + + /** + * @title Arguments = 0, -Integer.MIN_VALUE + */ + public void testB6() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(-2147483648, t.run(0, -Integer.MIN_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, 1 + */ + public void testB7() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(2147483646, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = 1, Integer.MIN_VALUE + */ + public void testB8() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(-2147483647, t.run(1, Integer.MIN_VALUE)); + } + + /** + * @title Arguments = Integer.MAX_VALUE, Integer.MIN_VALUE + */ + public void testB9() { + T_sub_int_1 t = new T_sub_int_1(); + assertEquals(-1, t.run(Integer.MAX_VALUE, Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_1.java b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_1.java new file mode 100644 index 00000000..099faa15 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_int.jm; + +public class T_sub_int_1 { + + public int run(int a, int b) { + return a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_3.java b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_3.java new file mode 100644 index 00000000..7ffd5c42 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_int.jm; + +public class T_sub_int_3 { + + public int run(int a, double b) { + return a-(int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_4.java b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_4.java new file mode 100644 index 00000000..e455f86a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_int.jm; + +public class T_sub_int_4 { + + public int run(long a, int b) { + return (int)a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_long/Test_sub_long.java b/jack-tests/tests/com/android/jack/opcodes/sub_long/Test_sub_long.java new file mode 100644 index 00000000..e7aef36d --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_long/Test_sub_long.java @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.sub_long.jm.T_sub_long_1; +import com.android.jack.opcodes.sub_long.jm.T_sub_long_3; +import com.android.jack.opcodes.sub_long.jm.T_sub_long_4; +import com.android.jack.opcodes.sub_long.jm.T_sub_long_5; + + +public class Test_sub_long extends DxTestCase { + + /** + * @title Arguments = 1111127348242l, 11111111114l + */ + public void testN1() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(1100016237128l, t.run(1111127348242l, 11111111114l)); + } + + /** + * @title Arguments = 0, 1111127348242l + */ + public void testN2() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(-1111127348242l, t.run(0, 1111127348242l)); + } + + /** + * @title Arguments = 0, -11111111114l + */ + public void testN3() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(11111111114l, t.run(0, -11111111114l)); + } + + /** + * @title Arguments = 0, -11111111114l + */ + public void testN4() { + T_sub_long_3 t = new T_sub_long_3(); + assertEquals(11111111114l, t.run(0, -11111111114l)); + } + + /** + * @title Arguments = 0, -11111111114l + */ + public void testN5() { + T_sub_long_4 t = new T_sub_long_4(); + assertEquals(11111111114l, t.run(0, -11111111114l)); + } + + /** + * @title Arguments = 0, -11111111114l + */ + public void testN6() { + T_sub_long_5 t = new T_sub_long_5(); + assertEquals(11111110656l, t.run(0, -11111111114l)); + } + + /** + * @title Arguments = 0l, Long.MAX_VALUE + */ + public void testB1() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(-9223372036854775807L, t.run(0l, Long.MAX_VALUE)); + } + /** + * @title Arguments = 9223372036854775807L, Long.MAX_VALUE + */ + public void testB2() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(0l, t.run(9223372036854775807L, Long.MAX_VALUE)); + } + /** + * @title Arguments = Long.MAX_VALUE, -1l + */ + public void testB3() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(-9223372036854775808L, t.run(Long.MAX_VALUE, -1l)); + } + /** + * @title Arguments = Long.MIN_VALUE, 1l + */ + public void testB4() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(9223372036854775807L, t.run(Long.MIN_VALUE, 1l)); + } + /** + * @title Arguments = 0l, 0l + */ + public void testB5() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(0l, t.run(0l, 0l)); + } + /** + * @title Arguments = 0l, -Long.MIN_VALUE + */ + public void testB6() { + T_sub_long_1 t = new T_sub_long_1(); + assertEquals(-9223372036854775808L, t.run(0l, -Long.MIN_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_1.java b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_1.java new file mode 100644 index 00000000..dacc66d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_1.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_long.jm; + +public class T_sub_long_1 { + + public long run(long a, long b) { + return a-b; + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_3.java b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_3.java new file mode 100644 index 00000000..75064c97 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_long.jm; + +public class T_sub_long_3 { + + public long run(long a, double b) { + return (long)(a-b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_4.java b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_4.java new file mode 100644 index 00000000..e9f6b55a --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_long.jm; + +public class T_sub_long_4 { + + public long run(int a, long b) { + return a-b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_5.java b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_5.java new file mode 100644 index 00000000..ce4fed87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.sub_long.jm; + +public class T_sub_long_5 { + + public long run(float a, long b) { + return (long)(a-b); + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/test-opcodes.mk b/jack-tests/tests/com/android/jack/opcodes/test-opcodes.mk new file mode 100644 index 00000000..3d8d47ff --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/test-opcodes.mk @@ -0,0 +1,1181 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### add_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-add_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_double/Test_add_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_double/jm/T_add_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_double/jm/T_add_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_double/jm/T_add_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.add_double.Test_add_double + +include $(JACK_RUN_TEST) + +### float_to_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-float_to_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_long/Test_float_to_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_long/jm/T_float_to_long_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.float_to_long.Test_float_to_long + +include $(JACK_RUN_TEST) + +### array_length ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-array_length +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/array_length/Test_array_length.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/array_length/jm/T_array_length_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/array_length/jm/T_array_length_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.array_length.Test_array_length + +include $(JACK_RUN_TEST) + +### sub_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sub_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_double/Test_sub_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_double/jm/T_sub_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.sub_double.Test_sub_double + +include $(JACK_RUN_TEST) + +### int_to_short ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_short +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_short/Test_int_to_short.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_short/jm/T_int_to_short_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_short.Test_int_to_short + +include $(JACK_RUN_TEST) + +### int_to_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_long/Test_int_to_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_long/jm/T_int_to_long_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_long.Test_int_to_long + +include $(JACK_RUN_TEST) + +### aput ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput/Test_aput.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput/jm/T_aput_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput.Test_aput + +include $(JACK_RUN_TEST) + +### if_gez ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_gez +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gez/Test_if_gez.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_gez/jm/T_if_gez_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_gez.Test_if_gez + +include $(JACK_RUN_TEST) + +### check_cast ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-check_cast +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/check_cast/Test_check_cast.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/check_cast/jm/T_check_cast_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.check_cast.Test_check_cast + +include $(JACK_RUN_TEST) + +### cmpl_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-cmpl_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpl_double/Test_cmpl_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpl_double/jm/T_cmpl_double_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.cmpl_double.Test_cmpl_double + +include $(JACK_RUN_TEST) + +### double_to_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-double_to_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_int/Test_double_to_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_int/jm/T_double_to_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.double_to_int.Test_double_to_int + +include $(JACK_RUN_TEST) + +### int_to_byte ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_byte +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_byte/Test_int_to_byte.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_byte/jm/T_int_to_byte_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_byte.Test_int_to_byte + +include $(JACK_RUN_TEST) + +### shl_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-shl_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shl_int/Test_shl_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/shl_int/jm/T_shl_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.shl_int.Test_shl_int + +include $(JACK_RUN_TEST) + +### long_to_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-long_to_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_double/Test_long_to_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_double/jm/T_long_to_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.long_to_double.Test_long_to_double + +include $(JACK_RUN_TEST) + +### if_ge ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_ge +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ge/Test_if_ge.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_ge/jm/T_if_ge_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_ge.Test_if_ge + +include $(JACK_RUN_TEST) + +### opc_new ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_new +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_new/Test_opc_new.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_new/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_new/jm/T_opc_new_9.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_new.Test_opc_new + +include $(JACK_RUN_TEST) + +### add_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-add_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_float/Test_add_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_float/jm/T_add_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_float/jm/T_add_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_float/jm/T_add_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.add_float.Test_add_float + +include $(JACK_RUN_TEST) + +### cmp_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-cmp_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmp_long/Test_cmp_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmp_long/jm/T_cmp_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.cmp_long.Test_cmp_long + +include $(JACK_RUN_TEST) + +### opc_instanceof ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_instanceof +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_instanceof/Test_opc_instanceof.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_instanceof/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_instanceof/jm/T_opc_instanceof_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_instanceof.Test_opc_instanceof + +include $(JACK_RUN_TEST) + +### int_to_char ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_char +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_char/Test_int_to_char.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_char/jm/T_int_to_char_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_char.Test_int_to_char + +include $(JACK_RUN_TEST) + +### aget_short ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget_short +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_short/Test_aget_short.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_short/jm/T_aget_short_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget_short.Test_aget_short + +include $(JACK_RUN_TEST) + +### and_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-and_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/and_int/Test_and_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/and_int/jm/T_and_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/and_int/jm/T_and_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/and_int/jm/T_and_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.and_int.Test_and_int + +include $(JACK_RUN_TEST) + +### if_eqz ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_eqz +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_eqz/Test_if_eqz.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_eqz/jm/T_if_eqz_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_eqz.Test_if_eqz + +include $(JACK_RUN_TEST) + +### opc_goto ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_goto +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_goto/Test_opc_goto.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_goto/jm/T_opc_goto_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_goto.Test_opc_goto + +include $(JACK_RUN_TEST) + +### if_gtz ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_gtz +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gtz/Test_if_gtz.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_gtz/jm/T_if_gtz_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_gtz.Test_if_gtz + +include $(JACK_RUN_TEST) + +### or_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-or_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/or_int/Test_or_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/or_int/jm/T_or_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/or_int/jm/T_or_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/or_int/jm/T_or_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.or_int.Test_or_int + +include $(JACK_RUN_TEST) + +### int_to_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_double/Test_int_to_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_double/jm/T_int_to_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_double.Test_int_to_double + +include $(JACK_RUN_TEST) + +### xor_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-xor_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/xor_long/Test_xor_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.xor_long.Test_xor_long + +include $(JACK_RUN_TEST) + +### rem_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-rem_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_int/Test_rem_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_int/jm/T_rem_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.rem_int.Test_rem_int + +include $(JACK_RUN_TEST) + +### opc_throw ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_throw +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_throw/Test_opc_throw.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_throw/jm/T_opc_throw_8.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_throw.Test_opc_throw + +include $(JACK_RUN_TEST) + +### shr_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-shr_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shr_long/Test_shr_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/shr_long/jm/T_shr_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.shr_long.Test_shr_long + +include $(JACK_RUN_TEST) + +### cmpg_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-cmpg_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_double/Test_cmpg_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_double/jm/T_cmpg_double_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.cmpg_double.Test_cmpg_double + +include $(JACK_RUN_TEST) + +### mul_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-mul_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_double/Test_mul_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_double/jm/T_mul_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.mul_double.Test_mul_double + +include $(JACK_RUN_TEST) + +### cmpg_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-cmpg_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_float/Test_cmpg_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmpg_float/jm/T_cmpg_float_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.cmpg_float.Test_cmpg_float + +include $(JACK_RUN_TEST) + +### mul_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-mul_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_int/Test_mul_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_int/jm/T_mul_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.mul_int.Test_mul_int + +include $(JACK_RUN_TEST) + +### neg_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-neg_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_float/Test_neg_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_float/jm/T_neg_float_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.neg_float.Test_neg_float + +include $(JACK_RUN_TEST) + +### div_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-div_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_double/Test_div_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_double/jm/T_div_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_double/jm/T_div_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_double/jm/T_div_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.div_double.Test_div_double + +include $(JACK_RUN_TEST) + +### monitor_enter ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-monitor_enter +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/monitor_enter/Test_monitor_enter.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/monitor_enter/jm/T_monitor_enter_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.monitor_enter.Test_monitor_enter + +include $(JACK_RUN_TEST) + +### and_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-and_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/and_long/Test_and_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/and_long/jm/T_and_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/and_long/jm/T_and_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/and_long/jm/T_and_long_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.and_long.Test_and_long + +include $(JACK_RUN_TEST) + +### if_ltz ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_ltz +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ltz/Test_if_ltz.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_ltz/jm/T_if_ltz_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_ltz.Test_if_ltz + +include $(JACK_RUN_TEST) + +### sparse_switch ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sparse_switch +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sparse_switch/Test_sparse_switch.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sparse_switch/jm/T_sparse_switch_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.sparse_switch.Test_sparse_switch + +include $(JACK_RUN_TEST) + +### sget ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sget +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sget/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/Test_sget.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_11.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/sget/jm/T_sget_9.java +JACKTEST_JUNIT := com.android.jack.opcodes.sget.Test_sget + +include $(JACK_RUN_TEST) + +### ushr_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-ushr_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_long/Test_ushr_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.ushr_long.Test_ushr_long + +include $(JACK_RUN_TEST) + +### const_wide ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-const_wide +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/Test_const_wide.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/const_wide/jm/T_const_wide_7.java +JACKTEST_JUNIT := com.android.jack.opcodes.const_wide.Test_const_wide + +include $(JACK_RUN_TEST) + +### aget ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget/Test_aget.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget/jm/T_aget_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget.Test_aget + +include $(JACK_RUN_TEST) + +### iput ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-iput +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/iput/Test_iput.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/TIput.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_16.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_18.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/iput/jm/T_iput_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.iput.Test_iput + +include $(JACK_RUN_TEST) + +### sput ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sput +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sput/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/Test_sput.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_16.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_18.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/sput/jm/T_sput_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.sput.Test_sput + +include $(JACK_RUN_TEST) + +### return_object ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-return_object +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/Test_return_object.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/Runner.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/RunnerGenerator.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_15.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/T_return_object_9.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_object/jm/TetsStubs.java +JACKTEST_JUNIT := com.android.jack.opcodes.return_object.Test_return_object + +include $(JACK_RUN_TEST) + +### invoke_virtual ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-invoke_virtual +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/TProtected.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/Test_invoke_virtual.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/ATest.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_17.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_19.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_22.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_23.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/T_invoke_virtual_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/TPlain.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper2.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_virtual/jm/TSuper.java +JACKTEST_JUNIT := com.android.jack.opcodes.invoke_virtual.Test_invoke_virtual + +include $(JACK_RUN_TEST) + +### aget_object ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget_object +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/Test_aget_object.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_8.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_object/jm/T_aget_object_9.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget_object.Test_aget_object + +include $(JACK_RUN_TEST) + +### neg_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-neg_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_double/Test_neg_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_double/jm/T_neg_double_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.neg_double.Test_neg_double + +include $(JACK_RUN_TEST) + +### int_to_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-int_to_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_float/Test_int_to_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/int_to_float/jm/T_int_to_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.int_to_float.Test_int_to_float + +include $(JACK_RUN_TEST) + +### invoke_static ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-invoke_static +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/Test_invoke_static.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/TestClassAbstract.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/TestClassInitError.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/TestClass.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_15.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_18.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_20.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_static/jm/T_invoke_static_8.java +JACKTEST_JUNIT := com.android.jack.opcodes.invoke_static.Test_invoke_static + +include $(JACK_RUN_TEST) + +### rem_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-rem_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_long/Test_rem_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_long/jm/T_rem_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.rem_long.Test_rem_long + +include $(JACK_RUN_TEST) + +### aget_wide ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget_wide +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/Test_aget_wide.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aget_wide/jm/T_aget_wide_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget_wide.Test_aget_wide + +include $(JACK_RUN_TEST) + +### float_to_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-float_to_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_double/Test_float_to_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_double/jm/T_float_to_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.float_to_double.Test_float_to_double + +include $(JACK_RUN_TEST) + +### if_lt ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_lt +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_lt/Test_if_lt.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_lt/jm/T_if_lt_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_lt.Test_if_lt + +include $(JACK_RUN_TEST) + +### double_to_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-double_to_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_float/Test_double_to_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_float/jm/T_double_to_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.double_to_float.Test_double_to_float + +include $(JACK_RUN_TEST) + +### double_to_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-double_to_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_long/Test_double_to_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/double_to_long/jm/T_double_to_long_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.double_to_long.Test_double_to_long + +include $(JACK_RUN_TEST) + +### return_wide ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-return_wide +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/Test_return_wide.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_8.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_9.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_10.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_11.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/return_wide/jm/T_return_wide_14.java +JACKTEST_JUNIT := com.android.jack.opcodes.return_wide.Test_return_wide + +include $(JACK_RUN_TEST) + +### add_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-add_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_long/Test_add_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_long/jm/T_add_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_long/jm/T_add_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_long/jm/T_add_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_long/jm/T_add_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.add_long.Test_add_long + +include $(JACK_RUN_TEST) + +### sub_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sub_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_long/Test_sub_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_long/jm/T_sub_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.sub_long.Test_sub_long + +include $(JACK_RUN_TEST) + +### shl_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-shl_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shl_long/Test_shl_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/shl_long/jm/T_shl_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.shl_long.Test_shl_long + +include $(JACK_RUN_TEST) + +### aput_byte ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput_byte +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_byte/Test_aput_byte.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_byte/jm/T_aput_byte_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput_byte.Test_aput_byte + +include $(JACK_RUN_TEST) + +### aget_char ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget_char +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_char/Test_aget_char.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_char/jm/T_aget_char_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget_char.Test_aget_char + +include $(JACK_RUN_TEST) + +### const4_16 ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-const4_16 +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/Test_const4_16.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_8.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_9.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_10.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_11.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_15.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_16.java $(JACK_PATH)/tests/com/android/jack/opcodes/const4_16/jm/T_const4_16_17.java +JACKTEST_JUNIT := com.android.jack.opcodes.const4_16.Test_const4_16 + +include $(JACK_RUN_TEST) + +### sub_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sub_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_int/Test_sub_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_int/jm/T_sub_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.sub_int.Test_sub_int + +include $(JACK_RUN_TEST) + +### neg_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-neg_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/Test_neg_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/neg_long/jm/T_neg_long_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.neg_long.Test_neg_long + +include $(JACK_RUN_TEST) + +### opc_return ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_return +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/Test_opc_return.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_8.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_9.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_10.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_11.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_13.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_return/jm/T_opc_return_15.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_return.Test_opc_return + +include $(JACK_RUN_TEST) + +### long_to_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-long_to_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_float/Test_long_to_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_float/jm/T_long_to_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.long_to_float.Test_long_to_float + +include $(JACK_RUN_TEST) + +### if_le ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_le +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_le/Test_if_le.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_le/jm/T_if_le_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_le/jm/T_if_le_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_le.Test_if_le + +include $(JACK_RUN_TEST) + +### aget_byte ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aget_byte +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_byte/Test_aget_byte.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aget_byte/jm/T_aget_byte_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.aget_byte.Test_aget_byte + +include $(JACK_RUN_TEST) + +### iget ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-iget +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/iget/Test_iget.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/TestStubs.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_11.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_15.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/iget/jm/T_iget_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.iget.Test_iget + +include $(JACK_RUN_TEST) + +### aput_char ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput_char +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_char/Test_aput_char.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_char/jm/T_aput_char_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput_char.Test_aput_char + +include $(JACK_RUN_TEST) + +### div_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-div_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_float/Test_div_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_float/jm/T_div_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_float/jm/T_div_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_float/jm/T_div_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.div_float.Test_div_float + +include $(JACK_RUN_TEST) + +### if_nez ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_nez +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_nez/Test_if_nez.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_nez/jm/T_if_nez_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_nez.Test_if_nez + +include $(JACK_RUN_TEST) + +### div_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-div_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_int/Test_div_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_int/jm/T_div_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_int/jm/T_div_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_int/jm/T_div_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.div_int.Test_div_int + +include $(JACK_RUN_TEST) + +### float_to_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-float_to_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_int/Test_float_to_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/float_to_int/jm/T_float_to_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.float_to_int.Test_float_to_int + +include $(JACK_RUN_TEST) + +### long_to_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-long_to_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_int/Test_long_to_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/long_to_int/jm/T_long_to_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.long_to_int.Test_long_to_int + +include $(JACK_RUN_TEST) + +### cmpl_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-cmpl_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpl_float/Test_cmpl_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/cmpl_float/jm/T_cmpl_float_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.cmpl_float.Test_cmpl_float + +include $(JACK_RUN_TEST) + +### shr_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-shr_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shr_int/Test_shr_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/shr_int/jm/T_shr_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.shr_int.Test_shr_int + +include $(JACK_RUN_TEST) + +### if_eq ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_eq +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_eq/Test_if_eq.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_eq/jm/T_if_eq_3.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_eq.Test_if_eq + +include $(JACK_RUN_TEST) + +### add_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-add_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/Test_add_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_6.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_7.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_8.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_9.java $(JACK_PATH)/tests/com/android/jack/opcodes/add_int/jm/T_add_int_10.java +JACKTEST_JUNIT := com.android.jack.opcodes.add_int.Test_add_int + +include $(JACK_RUN_TEST) + +### or_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-or_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/or_long/Test_or_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/or_long/jm/T_or_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/or_long/jm/T_or_long_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/or_long/jm/T_or_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/or_long/jm/T_or_long_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.or_long.Test_or_long + +include $(JACK_RUN_TEST) + +### mul_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-mul_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_long/Test_mul_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_long/jm/T_mul_long_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.mul_long.Test_mul_long + +include $(JACK_RUN_TEST) + +### if_lez ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_lez +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_lez/Test_if_lez.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_lez/jm/T_if_lez_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_lez.Test_if_lez + +include $(JACK_RUN_TEST) + +### sub_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-sub_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_float/Test_sub_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/sub_float/jm/T_sub_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.sub_float.Test_sub_float + +include $(JACK_RUN_TEST) + +### rem_double ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-rem_double +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_double/Test_rem_double.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_double/jm/T_rem_double_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.rem_double.Test_rem_double + +include $(JACK_RUN_TEST) + +### neg_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-neg_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_int/Test_neg_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/neg_int/jm/T_neg_int_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.neg_int.Test_neg_int + +include $(JACK_RUN_TEST) + +### aput_wide ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput_wide +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_wide/Test_aput_wide.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_wide/jm/T_aput_wide_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput_wide.Test_aput_wide + +include $(JACK_RUN_TEST) + +### div_long ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-div_long +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_long/Test_div_long.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/div_long/jm/T_div_long_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_long/jm/T_div_long_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_long/jm/T_div_long_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/div_long/jm/T_div_long_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.div_long.Test_div_long + +include $(JACK_RUN_TEST) + +### xor_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-xor_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/xor_int/Test_xor_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.xor_int.Test_xor_int + +include $(JACK_RUN_TEST) + +### aput_object ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput_object +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_object/Test_aput_object.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_10.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_object/jm/T_aput_object_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput_object.Test_aput_object + +include $(JACK_RUN_TEST) + +### new_array ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-new_array +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/Test_new_array.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_5.java $(JACK_PATH)/tests/com/android/jack/opcodes/new_array/jm/T_new_array_6.java +JACKTEST_JUNIT := com.android.jack.opcodes.new_array.Test_new_array + +include $(JACK_RUN_TEST) + +### aput_short ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-aput_short +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_short/Test_aput_short.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_4.java $(JACK_PATH)/tests/com/android/jack/opcodes/aput_short/jm/T_aput_short_5.java +JACKTEST_JUNIT := com.android.jack.opcodes.aput_short.Test_aput_short + +include $(JACK_RUN_TEST) + + +### if_ne ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_ne +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ne/Test_if_ne.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_ne/jm/T_if_ne_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_ne.Test_if_ne + +include $(JACK_RUN_TEST) + +### rem_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-rem_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_float/Test_rem_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/rem_float/jm/T_rem_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.rem_float.Test_rem_float + +include $(JACK_RUN_TEST) + +### ushr_int ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-ushr_int +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_int/Test_ushr_int.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.ushr_int.Test_ushr_int + +include $(JACK_RUN_TEST) + +### invoke_interface ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-invoke_interface +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/Test_invoke_interface.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImplAbstract.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/ITestImpl.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/ITest.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_12.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_17.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_19.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_23.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_interface/jm/T_invoke_interface_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.invoke_interface.Test_invoke_interface + +include $(JACK_RUN_TEST) + +### mul_float ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-mul_float +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_float/Test_mul_float.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_3.java $(JACK_PATH)/tests/com/android/jack/opcodes/mul_float/jm/T_mul_float_4.java +JACKTEST_JUNIT := com.android.jack.opcodes.mul_float.Test_mul_float + +include $(JACK_RUN_TEST) + +### if_gt ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-if_gt +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gt/Test_if_gt.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/if_gt/jm/T_if_gt_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.if_gt.Test_if_gt + +include $(JACK_RUN_TEST) + +### packed_switch ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-packed_switch +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/packed_switch/Test_packed_switch.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/packed_switch/jm/T_packed_switch_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.packed_switch.Test_packed_switch + +include $(JACK_RUN_TEST) + +### const_string ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-const_string +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const_string/Test_const_string.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/const_string/jm/T_const_string_1.java +JACKTEST_JUNIT := com.android.jack.opcodes.const_string.Test_const_string + +include $(JACK_RUN_TEST) + +### opc_const ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-opc_const +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_const/Test_opc_const.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/opc_const/jm/T_opc_const_2.java +JACKTEST_JUNIT := com.android.jack.opcodes.opc_const.Test_opc_const + +include $(JACK_RUN_TEST) + +### invoke_super ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-invoke_super +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/Test_invoke_super.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_1.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_14.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_15.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_18.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_19.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/T_invoke_super_26.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/TSuper2.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_super/jm/TSuper.java +JACKTEST_JUNIT := com.android.jack.opcodes.invoke_super.Test_invoke_super + +include $(JACK_RUN_TEST) + +### invoke_direct ### + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := opcode-invoke_direct +JACKTEST_WITHDX_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_direct/Test_invoke_direct.java $(JACK_PATH)/src/com/android/jack/DxTestCase.java +JACKTEST_WITHJACK_SRC := $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_2.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_direct/jm/T_invoke_direct_21.java $(JACK_PATH)/tests/com/android/jack/opcodes/invoke_direct/jm/TSuper.java +JACKTEST_JUNIT := com.android.jack.opcodes.invoke_direct.Test_invoke_direct + +include $(JACK_RUN_TEST) + diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_int/Test_ushr_int.java b/jack-tests/tests/com/android/jack/opcodes/ushr_int/Test_ushr_int.java new file mode 100644 index 00000000..32d184d0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_int/Test_ushr_int.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.ushr_int.jm.T_ushr_int_1; +import com.android.jack.opcodes.ushr_int.jm.T_ushr_int_3; +import com.android.jack.opcodes.ushr_int.jm.T_ushr_int_4; + + +public class Test_ushr_int extends DxTestCase { + + /** + * @title 15 >> 1 + */ + public void testN1() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(7, t.run(15, 1)); + } + + /** + * @title 33 >> 2 + */ + public void testN2() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(8, t.run(33, 2)); + } + + /** + * @title -15 >> 1 + */ + public void testN3() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(0x7FFFFFF8, t.run(-15, 1)); + } + + /** + * @title Arguments = 1 & -1 + */ + public void testN4() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(0, t.run(1, -1)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN5() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN6() { + T_ushr_int_3 t = new T_ushr_int_3(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Verify that shift distance is actually in range 0 to 32. + */ + public void testN7() { + T_ushr_int_4 t = new T_ushr_int_4(); + assertEquals(16, t.run(33, 33)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(0, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & 1 + */ + public void testB2() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(0x3FFFFFFF, t.run(Integer.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Integer.MIN_VALUE & 1 + */ + public void testB3() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(0x40000000, t.run(Integer.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 1 & 0 + */ + public void testB4() { + T_ushr_int_1 t = new T_ushr_int_1(); + assertEquals(1, t.run(1, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_1.java b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_1.java new file mode 100644 index 00000000..b5f4f85e --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_int.jm; + +public class T_ushr_int_1 { + + public int run(int a, int b) { + return a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_3.java b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_3.java new file mode 100644 index 00000000..ae65dc6f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_int.jm; + +public class T_ushr_int_3 { + + public int run(double a, int b) { + return (int)a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_4.java b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_4.java new file mode 100644 index 00000000..139be9dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_int/jm/T_ushr_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_int.jm; + +public class T_ushr_int_4 { + + public int run(int a, long b) { + return a >>> (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_long/Test_ushr_long.java b/jack-tests/tests/com/android/jack/opcodes/ushr_long/Test_ushr_long.java new file mode 100644 index 00000000..27c60e51 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_long/Test_ushr_long.java @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.ushr_long.jm.T_ushr_long_1; +import com.android.jack.opcodes.ushr_long.jm.T_ushr_long_3; +import com.android.jack.opcodes.ushr_long.jm.T_ushr_long_4; +import com.android.jack.opcodes.ushr_long.jm.T_ushr_long_5; + + +public class Test_ushr_long extends DxTestCase { + + /** + * @title Arguments = 40000000000l, 3 + */ + public void testN1() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(5000000000l, t.run(40000000000l, 3)); + } + + /** + * @title Arguments = 40000000000l, 1 + */ + public void testN2() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(20000000000l, t.run(40000000000l, 1)); + } + + /** + * @title Arguments = -123456789l, 1 + */ + public void testN3() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0x7FFFFFFFFC521975l, t.run(-123456789l, 1)); + } + + /** + * @title Arguments = 1, -1 + */ + public void testN4() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0l, t.run(1l, -1)); + } + + /** + * @title Arguments = 123456789l, 64 + */ + public void testN5() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(123456789l, t.run(123456789l, 64)); + } + + /** + * @title Arguments = 123456789l, 63 + */ + public void testN6() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0l, t.run(123456789l, 63)); + } + + /** + * @title Arguments = 123456789l, 63 + */ + public void testN7() { + T_ushr_long_3 t = new T_ushr_long_3(); + assertEquals(0l, t.run(123456789l, 63)); + } + + /** + * @title Arguments = 123456789l, 63 + */ + public void testN8() { + T_ushr_long_4 t = new T_ushr_long_4(); + assertEquals(0l, t.run(123456789, 63)); + } + + /** + * @title Arguments = 123456789l, 63 + */ + public void testN9() { + T_ushr_long_5 t = new T_ushr_long_5(); + assertEquals(0l, t.run(123456789l, 63)); + } + + /** + * @title Arguments = 0, -1 + */ + public void testB1() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0l, t.run(0l, -1)); + } + + /** + * @title Arguments = Long.MAX_VALUE, 1 + */ + public void testB2() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0x3FFFFFFFFFFFFFFFl, t.run(Long.MAX_VALUE, 1)); + } + + /** + * @title Arguments = Long.MIN_VALUE, 1 + */ + public void testB3() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(0x4000000000000000l, t.run(Long.MIN_VALUE, 1)); + } + + /** + * @title Arguments = 1, 0 + */ + public void testB4() { + T_ushr_long_1 t = new T_ushr_long_1(); + assertEquals(1l, t.run(1l, 0)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_1.java b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_1.java new file mode 100644 index 00000000..079509b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_long.jm; + +public class T_ushr_long_1 { + + public long run(long a, int b) { + return a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_3.java b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_3.java new file mode 100644 index 00000000..d2b4a3b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_long.jm; + +public class T_ushr_long_3 { + + public long run(double a, int b) { + return (long)a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_4.java b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_4.java new file mode 100644 index 00000000..37ed7374 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_long.jm; + +public class T_ushr_long_4 { + + public long run(int a, int b) { + return a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_5.java b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_5.java new file mode 100644 index 00000000..44461ecf --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/ushr_long/jm/T_ushr_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.ushr_long.jm; + +public class T_ushr_long_5 { + + public long run(float a, int b) { + return (long)a >>> b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_int/Test_xor_int.java b/jack-tests/tests/com/android/jack/opcodes/xor_int/Test_xor_int.java new file mode 100644 index 00000000..aa56f219 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_int/Test_xor_int.java @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_int; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.xor_int.jm.T_xor_int_1; +import com.android.jack.opcodes.xor_int.jm.T_xor_int_3; +import com.android.jack.opcodes.xor_int.jm.T_xor_int_4; + + +public class Test_xor_int extends DxTestCase { + + /** + * @title Arguments = 15, 8 + */ + public void testN1() { + T_xor_int_1 t = new T_xor_int_1(); + assertEquals(7, t.run(15, 8)); + } + + /** + * @title Arguments = 0xfffffff8, 0xfffffff1 + */ + public void testN2() { + T_xor_int_1 t = new T_xor_int_1(); + assertEquals(9, t.run(0xfffffff8, 0xfffffff1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN3() { + T_xor_int_1 t = new T_xor_int_1(); + assertEquals(0xFFFF3501, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN4() { + T_xor_int_3 t = new T_xor_int_3(); + assertEquals(0xFFFF3501, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0xcafe & -1 + */ + public void testN5() { + T_xor_int_4 t = new T_xor_int_4(); + assertEquals(0xFFFF3501, t.run(0xcafe, -1)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_xor_int_1 t = new T_xor_int_1(); + assertEquals(-1, t.run(0, -1)); + } + + /** + * @title Arguments = Integer.MAX_VALUE & Integer.MIN_VALUE + */ + public void testB2() { + T_xor_int_1 t = new T_xor_int_1(); + assertEquals(0xffffffff, t.run(Integer.MAX_VALUE, Integer.MIN_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_1.java b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_1.java new file mode 100644 index 00000000..6cd1ba09 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_int.jm; + +public class T_xor_int_1 { + + public int run(int a, int b) { + return a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_3.java b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_3.java new file mode 100644 index 00000000..101a9878 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_int.jm; + +public class T_xor_int_3 { + + public int run(double a, int b) { + return (int)a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_4.java b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_4.java new file mode 100644 index 00000000..b1753e5c --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_int/jm/T_xor_int_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_int.jm; + +public class T_xor_int_4 { + + public int run(int a, long b) { + return a ^ (int)b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_long/Test_xor_long.java b/jack-tests/tests/com/android/jack/opcodes/xor_long/Test_xor_long.java new file mode 100644 index 00000000..f6245ab0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_long/Test_xor_long.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_long; + +import com.android.jack.DxTestCase; +import com.android.jack.opcodes.xor_long.jm.T_xor_long_1; +import com.android.jack.opcodes.xor_long.jm.T_xor_long_3; +import com.android.jack.opcodes.xor_long.jm.T_xor_long_4; +import com.android.jack.opcodes.xor_long.jm.T_xor_long_5; + + +public class Test_xor_long extends DxTestCase { + + /** + * @title Arguments = 23423432423777l, 23423432423778l + */ + public void testN1() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(3, t.run(23423432423777l, 23423432423778l)); + } + + /** + * @title Arguments = 0xfffffff5, 0xfffffff1 + */ + public void testN2() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(4, t.run(0xfffffff5, 0xfffffff1)); + } + + /** + * @title Arguments = 0xABCDEFAB & -1 + */ + public void testN3() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(0x54321054, t.run(0xABCDEFAB, -1l)); + } + + /** + * @title Arguments = 0xABCDEFAB & -1 + */ + public void testN4() { + T_xor_long_3 t = new T_xor_long_3(); + assertEquals(0x54321054, t.run(0xABCDEFAB, -1l)); + } + + /** + * @title Arguments = 0xABCDEFAB & -1 + */ + public void testN5() { + T_xor_long_4 t = new T_xor_long_4(); + assertEquals(0x54321054, t.run(0xABCDEFAB, -1l)); + } + + /** + * @title Arguments = 0xABCDEFAB & -1 + */ + public void testN6() { + T_xor_long_5 t = new T_xor_long_5(); + assertEquals(0x5432107F, t.run(0xABCDEFAB, -1l)); + } + + /** + * @title Arguments = 0 & -1 + */ + public void testB1() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(-1l, t.run(0l, -1l)); + } + + /** + * @title Arguments = Long.MAX_VALUE & Long.MIN_VALUE + */ + public void testB2() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(0xffffffff, t.run(Long.MAX_VALUE, Long.MIN_VALUE)); + } + + /** + * @title Arguments = Long.MAX_VALUE & Long.MAX_VALUE + */ + public void testB3() { + T_xor_long_1 t = new T_xor_long_1(); + assertEquals(0l, t.run(Long.MAX_VALUE, Long.MAX_VALUE)); + } + +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_1.java b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_1.java new file mode 100644 index 00000000..5603cc2f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_1.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_long.jm; + +public class T_xor_long_1 { + + public long run(long a, long b) { + return a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_3.java b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_3.java new file mode 100644 index 00000000..e7c15afa --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_3.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_long.jm; + +public class T_xor_long_3 { + + public long run(double a, long b) { + return (long)a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_4.java b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_4.java new file mode 100644 index 00000000..326124b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_4.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_long.jm; + +public class T_xor_long_4 { + + public long run(int a, long b) { + return a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_5.java b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_5.java new file mode 100644 index 00000000..32feea6f --- /dev/null +++ b/jack-tests/tests/com/android/jack/opcodes/xor_long/jm/T_xor_long_5.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.opcodes.xor_long.jm; + +public class T_xor_long_5 { + + public long run(float a, long b) { + return (long)a ^ b; + } +} diff --git a/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/dx/Tests.java new file mode 100644 index 00000000..a454a91a --- /dev/null +++ b/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/dx/Tests.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.optimizations.exprsimplifier.test001.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.optimizations.exprsimplifier.test001.jack.ExprSimplifier; + +public class Tests { + + //Check runtime when param == true is simplify to param + @Test + public void test001() { + Assert.assertEquals(1, ExprSimplifier.test001(true)); + Assert.assertEquals(2, ExprSimplifier.test001(false)); + } + + // Check runtime when param == false is simplify to !param + @Test + public void test002() { + Assert.assertEquals(2, ExprSimplifier.test002(true)); + Assert.assertEquals(1, ExprSimplifier.test002(false)); + } +} diff --git a/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/jack/ExprSimplifier.java b/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/jack/ExprSimplifier.java new file mode 100644 index 00000000..fddfdbd2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/optimizations/exprsimplifier/test001/jack/ExprSimplifier.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.optimizations.exprsimplifier.test001.jack; + +public class ExprSimplifier { + + public static int test001(boolean param) { + // Check runtime when param == true is simplify to param + if (param == true) { + return 1; + } else { + return 2; + } + } + + public static int test002(boolean param) { + // Check runtime when param == false is simplify to !param + if (param == false) { + return 1; + } else { + return 2; + } + } +} diff --git a/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/dx/Tests.java new file mode 100644 index 00000000..e4027e85 --- /dev/null +++ b/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/dx/Tests.java @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.optimizations.notsimplifier.test001.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.optimizations.notsimplifier.test001.jack.NotSimplifier; + +public class Tests { + + //Check that expression is replaced by i1 != i2 + @Test + public void test001() { + Assert.assertFalse(NotSimplifier.test001(1, 2)); + Assert.assertFalse(NotSimplifier.test001(2, 1)); + Assert.assertTrue(NotSimplifier.test001(2, 2)); + } + + // Check that expression is replaced by i1 >= i2 + @Test + public void test002() { + Assert.assertFalse(NotSimplifier.test002(1, 2)); + Assert.assertTrue(NotSimplifier.test002(2, 1)); + Assert.assertTrue(NotSimplifier.test002(2, 2)); + } + + //Check that expression is replaced by i1 >= i2 || i3 == i4 + @Test + public void test003() { + Assert.assertTrue(NotSimplifier.test003(1, 2, 3, 3)); + Assert.assertFalse(NotSimplifier.test003(1, 2, 3, 4)); + Assert.assertTrue(NotSimplifier.test003(2, 2, 3, 4)); + } + + // Check that expression is replaced by i1 >= i2 || b + @Test + public void test004() { + Assert.assertTrue(NotSimplifier.test004(1, 2, true)); + Assert.assertFalse(NotSimplifier.test004(1, 2, false)); + Assert.assertTrue(NotSimplifier.test004(2, 1, false)); + Assert.assertTrue(NotSimplifier.test004(2, 1, true)); + } + + // Check that expression is replaced by i1 >= i2 || i3 != i4 + @Test + public void test005() { + Assert.assertFalse(NotSimplifier.test005(1, 2, 3, 3)); + Assert.assertTrue(NotSimplifier.test005(1, 2, 3, 4)); + Assert.assertTrue(NotSimplifier.test005(2, 2, 3, 4)); + Assert.assertTrue(NotSimplifier.test005(2, 2, 3, 3)); + } + + // Check that expression is not replaced by !getBoolean() || b + @Test + public void test006() { + Assert.assertTrue(NotSimplifier.test006(1, 2)); + Assert.assertFalse(NotSimplifier.test006(2, 2)); + } + + // Check that expression is replaced by getBoolean && i1 != i2 + @Test + public void test007() { + Assert.assertTrue(NotSimplifier.test007(1, 2)); + Assert.assertFalse(NotSimplifier.test007(2, 2)); + } + + // // Check that expression is replaced by getBoolean() || getBoolean() || i1 == i2 + @Test + public void test008() { + Assert.assertTrue(NotSimplifier.test008(1, 2)); + Assert.assertTrue(NotSimplifier.test008(2, 2)); + } + + //Check that expression is replaced by !getBoolean() || i1 == i2 || i3 == i4 + @Test + public void test009() { + Assert.assertFalse(NotSimplifier.test009(1, 2, 3, 4)); + Assert.assertTrue(NotSimplifier.test009(1, 2, 3, 3)); + Assert.assertTrue(NotSimplifier.test009(2, 2, 3, 4)); + Assert.assertTrue(NotSimplifier.test009(2, 2, 3, 3)); + } + + @Test + public void test010() { + Assert.assertFalse(NotSimplifier.test010(true)); + Assert.assertTrue(NotSimplifier.test010(false)); + } + + //Check that expression !(b1 | b2) is not replaced + @Test + public void test011() { + Assert.assertFalse(NotSimplifier.test011(true, true)); + Assert.assertFalse(NotSimplifier.test011(true, false)); + Assert.assertFalse(NotSimplifier.test011(false, true)); + Assert.assertTrue(NotSimplifier.test011(false, false)); + } + + // Check that expression !(b1 & b2) is not replaced + @Test + public void test012() { + Assert.assertFalse(NotSimplifier.test012(true, true)); + Assert.assertTrue(NotSimplifier.test012(true, false)); + Assert.assertTrue(NotSimplifier.test012(false, true)); + Assert.assertTrue(NotSimplifier.test012(false, false)); + } + + //Check that expression !(b1 ^ b2) is not replaced + @Test + public void test013() { + Assert.assertTrue(NotSimplifier.test013(true, true)); + Assert.assertTrue(NotSimplifier.test013(false, false)); + Assert.assertFalse(NotSimplifier.test013(false, true)); + Assert.assertFalse(NotSimplifier.test013(true, false)); + } + + // Check that expression is replaced by !b1 | b2 + @Test + public void test014() { + Assert.assertTrue(NotSimplifier.test014(true, true)); + Assert.assertTrue(NotSimplifier.test014(false, false)); + Assert.assertTrue(NotSimplifier.test014(false, true)); + Assert.assertFalse(NotSimplifier.test014(true, false)); + } + + // Check that expression is replaced by b1 & !b2 + @Test + public void test015() { + Assert.assertFalse(NotSimplifier.test015(true, true)); + Assert.assertFalse(NotSimplifier.test015(false, false)); + Assert.assertFalse(NotSimplifier.test015(false, true)); + Assert.assertTrue(NotSimplifier.test015(true, false)); + } +} diff --git a/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/jack/NotSimplifier.java b/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/jack/NotSimplifier.java new file mode 100644 index 00000000..0a39a33c --- /dev/null +++ b/jack-tests/tests/com/android/jack/optimizations/notsimplifier/test001/jack/NotSimplifier.java @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.optimizations.notsimplifier.test001.jack; + +public class NotSimplifier { + + public static boolean test001(int i1, int i2) { + // Check that expression is replaced by i1 != i2 + if (!(i1 == i2)) { + return false; + } else { + return true; + } + } + + public static boolean test002(int i1, int i2) { + // Check that expression is replaced by i1 >= i2 + if (! (i1 < i2)) { + return true; + } else { + return false; + } + } + + public static boolean test003(int i1, int i2, int i3, int i4) { + // Check that expression is replaced by i1 >= i2 || i3 == i4 + if (!(i1 < i2 && i3 != i4)) { + return true; + } else { + return false; + } + } + + public static boolean test004(int i1, int i2, boolean b1) { + // Check that expression is replaced by i1 >= i2 || b + if (!(i1 < i2 && !b1)) { + return true; + } else { + return false; + } + } + + public static boolean test005(int i1, int i2, int i3, int i4) { + // Check that expression is replaced by i1 >= i2 || i3 != i4 + if (!(i1 < i2 && !(i3 != i4))) { + return true; + } else { + return false; + } + } + + private static boolean getBoolean() { + return true; + } + + public static boolean test006(int i1, int i2) { + // Check that expression is not replaced by !getBoolean() || i1 != i2 + if (!(getBoolean() && i1 == i2)) { + return true; + } else { + return false; + } + } + + public static boolean test007(int i1, int i2) { + // Check that expression is replaced by getBoolean() && i1 != i2 + if (getBoolean() && !(i1 == i2)) { + return true; + } else { + return false; + } + } + + public static boolean test008(int i1, int i2) { + // Check that expression is replaced by getBoolean() || getBoolean() || i1 == i2 + if (!(!getBoolean() && !getBoolean() && !(i1 == i2))) { + return true; + } else { + return false; + } + } + + public static boolean test009(int i1, int i2, int i3, int i4) { + // Check that expression is replaced by !getBoolean() || i1 == i2 || i3 == i4 + if (!(getBoolean() && !(i1 == i2) && !(i3 == i4))) { + return true; + } else { + return false; + } + } + + public static boolean test010(boolean b) { + // Check that expression is not replaced + boolean a; + return !(a = b); + } + + public static boolean test011(boolean b1, boolean b2) { + // Check that expression !(b1 | b2) is not replaced + return !(b1 | b2); + } + + public static boolean test012(boolean b1, boolean b2) { + // Check that expression !(b1 & b2) is not replaced + return !(b1 & b2); + } + + public static boolean test013(boolean b1, boolean b2) { + // Check that expression !(b1 ^ b2) is not replaced + return !(b1 ^ b2); + } + + public static boolean test014(boolean b1, boolean b2) { + // Check that expression is replaced by !b1 | b2 + return !(b1 & !b2); + } + + public static boolean test015(boolean b1, boolean b2) { + // Check that expression is replaced by b1 & !b2 + return !(!b1 | b2); + } +} diff --git a/jack-tests/tests/com/android/jack/optimizations/uselesscopy/test001/jack/Test001.java b/jack-tests/tests/com/android/jack/optimizations/uselesscopy/test001/jack/Test001.java new file mode 100644 index 00000000..58beaf55 --- /dev/null +++ b/jack-tests/tests/com/android/jack/optimizations/uselesscopy/test001/jack/Test001.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.optimizations.uselesscopy.test001.jack; + +public class Test001 { + + public boolean test(Object o) { + return this == o; + } + +} diff --git a/jack-tests/tests/com/android/jack/order/dx/Tests.java b/jack-tests/tests/com/android/jack/order/dx/Tests.java new file mode 100644 index 00000000..4c2243bf --- /dev/null +++ b/jack-tests/tests/com/android/jack/order/dx/Tests.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.order.dx; + +import com.android.jack.order.jack.Order; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Evaluation order test. + */ +public class Tests { + + @Test + public void getValue1() { + Assert.assertEquals(11, Order.getValue1(5,6)); + } + + @Test + public void getValue2() { + Assert.assertEquals(1, Order.getValue2(5,6)); + } + + @Test + public void getValue3() { + Assert.assertEquals(11, Order.getValue3()); + } + + @Test + public void getValue4() { + Assert.assertEquals(1, Order.getValue4()); + } + + @Test + public void getValue5() { + Assert.assertEquals(1, Order.getValue5(5)); + } + + @Test + public void getValue6() { + Assert.assertEquals(18, Order.getValue6()); + } +} diff --git a/jack-tests/tests/com/android/jack/order/jack/Order.java b/jack-tests/tests/com/android/jack/order/jack/Order.java new file mode 100644 index 00000000..47ee620f --- /dev/null +++ b/jack-tests/tests/com/android/jack/order/jack/Order.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.order.jack; + +/** + * Evaluation order test. + */ +public class Order { + + public static int sum(int a, int b) { + return a + b; + } + + public static int sum(int a, int b, int c) { + return a + b + c; + } + + public static int getValue1(int a, int b) { + return sum(a, a = b); + } + + public static int getValue2(int a, int b) { + if (a != (a = b)) { + return 1; + } + return 2; + } + + public static int getValue3() { + int a = 5; + int b = 6; + return sum(a, a = b); + } + + public static int getValue4() { + int a = 5; + int b = 6; + if (a != (a = b)) { + return 1; + } + return 2; + } + + public static int getValue5(int a) { + int result = 0; + for (int i = 0; i < (i = a); i++) { + result++; + } + return result; + } + + public static int getValue6() { + int a = 5; + int b = 6; + int c = 7; + return sum(a, a = b, b = c); + } +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/return001/jack/Return.java b/jack-tests/tests/com/android/jack/returnstatement/return001/jack/Return.java new file mode 100644 index 00000000..4fe6a5ca --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/return001/jack/Return.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.return001.jack; + +public class Return { + + public static int testRegManager(int val) { + return val; + } + + public static int testRegManager(int val1, int val2 ) { + return (val1 + val2); + } +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/returns/dx/Tests.java b/jack-tests/tests/com/android/jack/returnstatement/returns/dx/Tests.java new file mode 100644 index 00000000..3a807ee6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/returns/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.returns.dx; + +import com.android.jack.returnstatement.returns.jack.MultipleReturn; +import com.android.jack.returnstatement.returns.jack.ReturnVoid; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + ReturnVoid.set(); + } + + @Test + public void test2() { + Assert.assertEquals(1, MultipleReturn.getValue(0)); + Assert.assertEquals(2, MultipleReturn.getValue(1)); + } + +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/returns/jack/MultipleReturn.java b/jack-tests/tests/com/android/jack/returnstatement/returns/jack/MultipleReturn.java new file mode 100644 index 00000000..8f08af80 --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/returns/jack/MultipleReturn.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.returns.jack; + +/** + * Multiple return test. + */ +public class MultipleReturn { + + public static int getValue(int i) { + if (i == 0) { + return 1; + } + return 2; + } +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/returns/jack/ReturnVoid.java b/jack-tests/tests/com/android/jack/returnstatement/returns/jack/ReturnVoid.java new file mode 100644 index 00000000..6c12178c --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/returns/jack/ReturnVoid.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.returns.jack; + +/** + * Return void test. + */ +public class ReturnVoid { + + public static void set() { + return; + } +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/returnvoid/dx/Tests.java b/jack-tests/tests/com/android/jack/returnstatement/returnvoid/dx/Tests.java new file mode 100644 index 00000000..4fbf9a7d --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/returnvoid/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.returnvoid.dx; + +import com.android.jack.returnstatement.returnvoid.jack.ReturnVoid; + +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + ReturnVoid.set(); + } + +} diff --git a/jack-tests/tests/com/android/jack/returnstatement/returnvoid/jack/ReturnVoid.java b/jack-tests/tests/com/android/jack/returnstatement/returnvoid/jack/ReturnVoid.java new file mode 100644 index 00000000..018a0b53 --- /dev/null +++ b/jack-tests/tests/com/android/jack/returnstatement/returnvoid/jack/ReturnVoid.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.returnstatement.returnvoid.jack; + +/** + * Return void test. + */ +public class ReturnVoid { + + public static void set() { + return; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/dontobfuscate.flags b/jack-tests/tests/com/android/jack/shrob/dontobfuscate.flags new file mode 100644 index 00000000..0674e774 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/dontobfuscate.flags @@ -0,0 +1 @@ +-dontobfuscate \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/keepAllAttributes.flags b/jack-tests/tests/com/android/jack/shrob/keepAllAttributes.flags new file mode 100644 index 00000000..95f0faed --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/keepAllAttributes.flags @@ -0,0 +1 @@ +-keepattributes \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/keepDebugInfo.flags b/jack-tests/tests/com/android/jack/shrob/keepDebugInfo.flags new file mode 100644 index 00000000..447a2186 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/keepDebugInfo.flags @@ -0,0 +1 @@ +-keepattributes LineNumberTable \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/keepPackageName.flags b/jack-tests/tests/com/android/jack/shrob/keepPackageName.flags new file mode 100644 index 00000000..4b993487 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/keepPackageName.flags @@ -0,0 +1 @@ +-keeppackagenames com.android.jack \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/printmapping.flags b/jack-tests/tests/com/android/jack/shrob/printmapping.flags new file mode 100644 index 00000000..b283f365 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/printmapping.flags @@ -0,0 +1 @@ +-printmapping \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/repackageClasses.flags b/jack-tests/tests/com/android/jack/shrob/repackageClasses.flags new file mode 100644 index 00000000..fe17e0bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/repackageClasses.flags @@ -0,0 +1 @@ +-repackageclasses \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/A.java new file mode 100644 index 00000000..dcd79891 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/A.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class A { + A() { + + } + + A(int i) { + + } + + static { + C.m(); + } + + void m() { + + } + + @SuppressWarnings("unused") + private void privateFunc() { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/B.java new file mode 100644 index 00000000..478d2ac5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/B.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class B { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/C.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/C.java new file mode 100644 index 00000000..424cebb4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/C.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class C { + + static void f() { + + } + + static void m() { + } + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/D.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/D.java new file mode 100644 index 00000000..528fe832 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/D.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class D { + public void keep() { + System.out.println(); + } + + public static void main(String[] args) { + D d = new E(); + d.keep(); + } + + public static void main2(String[] args) { + D d = new D(); + d.keep(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/E.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/E.java new file mode 100644 index 00000000..15472090 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/E.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class E extends D { + @Override + public void keep() { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/F.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/F.java new file mode 100644 index 00000000..b64053fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/F.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class F extends E { + @Override + public void keep() { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/G.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/G.java new file mode 100644 index 00000000..2e33b9ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/G.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class G implements H { + + @Override + public void m() { + } + + public static void main(String[] args) { + H i = new G(); + i.m(); + } + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/H.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/H.java new file mode 100644 index 00000000..c4aa0f58 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/H.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public interface H extends I { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/I.java new file mode 100644 index 00000000..5649d9fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public interface I { + void m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/J.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/J.java new file mode 100644 index 00000000..19ba766c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/J.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class J { + + int[][][] m5(int a, boolean b, long c) { + return null; + } + + int[][][] m3() { + return null; + } + + int[][] m2() { + return null; + } + + int[] m1() { + return null; + } + + int m0() { + return 0; + } + + int[][][] m() { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/K.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/K.java new file mode 100644 index 00000000..be436f46 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/K.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class K { + private int i; + private int h; + private final int i2 = 7; + private static int j; + private final static int i3 = 7; + + private static final Object o = "TAG"; + private static final String TAG = "TAG"; + private final String TAG2 = "TAG"; + + static { + j = 6; + } + + { + i = 6; + } + + void keep() { + h = 7; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/L.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/L.java new file mode 100644 index 00000000..ef825f42 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/L.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class L { + private static final String TAG = "TAG"; + + void onReceive() { + System.out.println(TAG); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect.java new file mode 100644 index 00000000..0b6196e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect.java @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import java.util.concurrent.atomic.AtomicLongFieldUpdater; +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; + +public class Reflect { + + void keep() throws ClassNotFoundException { + Class.forName("com.android.jack.shrob.test001.jack.Reflect2"); + Class.forName("ClassThatDoesNotExists"); + } + + void keep2() throws NoSuchFieldException, SecurityException { + Reflect2.class.getField("fieldPublic"); +// Reflect2.class.getField("fieldPrivate"); + } + + void keep3() throws NoSuchFieldException, SecurityException { + Reflect2.class.getDeclaredField("fieldPublic"); +// Reflect2.class.getDeclaredField("fieldPrivate"); + } + + void keep4() throws SecurityException, NoSuchMethodException { + Reflect2.class.getMethod( + "m", new Class[] {com.android.jack.shrob.test001.jack.Reflect2.A.class}); + Reflect2.class.getMethod( + "m", new Class[] {com.android.jack.shrob.test001.jack.Reflect2.B.class}); + Reflect2.class.getMethod("methodThatDoesNotExist", + new Class[] {com.android.jack.shrob.test001.jack.Reflect2.A.class}); + } + + void keep5() throws SecurityException, NoSuchMethodException { + Reflect2.class.getDeclaredMethod( + "m", new Class[] {com.android.jack.shrob.test001.jack.Reflect2.A.class}); + Reflect2.class.getDeclaredMethod( + "m", new Class[] {com.android.jack.shrob.test001.jack.Reflect2.B.class}); + } + + void keep6() throws SecurityException { + AtomicIntegerFieldUpdater.newUpdater(Reflect2.class, "fieldPublic"); +// AtomicIntegerFieldUpdater.newUpdater(Reflect2.class, "fieldLong"); + } + + void keep7() throws SecurityException { +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldPublic"); + AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong"); + AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong2"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong3"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong4"); + } + + void keep8() throws SecurityException { + AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Reflect2.A.class, "a"); + AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Reflect2.A.class, "b"); + AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Object.class, "c"); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect2.java b/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect2.java new file mode 100644 index 00000000..5e12b32f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/jack/Reflect2.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test001.jack; + +public class Reflect2 { + public volatile int fieldPublic; + + private volatile int fieldPrivate; + + public volatile long fieldLong; + + private volatile long fieldLong2; + + volatile long fieldLong3; + + protected volatile long fieldLong4; + + public volatile A a; + + public volatile B b; + + private volatile Object c; + + private void calledMethod() { + + } + + public void m(A a) { + + } + + private void privateMethod(B b) { + + } + + class A { + + } + + class B { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001 new file mode 100644 index 00000000..6c3eb374 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001 @@ -0,0 +1 @@ +-keep class com.android.jack.shrob.test001.jack.A \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001.mapping new file mode 100644 index 00000000..21fc0d4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags001.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002 new file mode 100644 index 00000000..89050493 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002 @@ -0,0 +1,3 @@ +-keep !final public class com.android.jack.shrob.test001.jack.A { + private ; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002.mapping new file mode 100644 index 00000000..df84b161 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void privateFunc() -> privateFunc +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003 new file mode 100644 index 00000000..f2853565 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003 @@ -0,0 +1,3 @@ +-keep !final public class com.android.jack.shrob.test001.jack.A { + !private ; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003.mapping new file mode 100644 index 00000000..535ddb9e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags003.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void m() -> m +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004 new file mode 100644 index 00000000..0269e4db --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.D { + public static void main2(java.lang.String[]); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004.mapping new file mode 100644 index 00000000..cc3053b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags004.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void keep() -> a + void main2(java.lang.String[]) -> main2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005 new file mode 100644 index 00000000..e51920bd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.D { + public static void main(...); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping new file mode 100644 index 00000000..5a4f4627 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void keep() -> a + void main(java.lang.String[]) -> main +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.a: + void keep() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping002 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping002 new file mode 100644 index 00000000..5a4f4627 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping002 @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void keep() -> a + void main(java.lang.String[]) -> main +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.a: + void keep() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping003 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping003 new file mode 100644 index 00000000..5a4f4627 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags005.mapping003 @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void keep() -> a + void main(java.lang.String[]) -> main +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.a: + void keep() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006 new file mode 100644 index 00000000..b0741279 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.G { + static void main(...); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006.mapping new file mode 100644 index 00000000..97230860 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags006.mapping @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.G: + void m() -> a + void main(java.lang.String[]) -> main +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.a: +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.b: + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007 new file mode 100644 index 00000000..7db93822 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.J { + int[][][] m?(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007.mapping new file mode 100644 index 00000000..d1fc58b0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags007.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.J: + int[][][] m3() -> m3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008 new file mode 100644 index 00000000..20b36ced --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008.mapping new file mode 100644 index 00000000..52aad70b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags008.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep() -> keep +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009 new file mode 100644 index 00000000..54adbe9e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep2(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009.mapping new file mode 100644 index 00000000..e2fa379c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags009.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep2() -> keep2 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + int fieldPrivate -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010 new file mode 100644 index 00000000..39049159 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep3(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010.mapping new file mode 100644 index 00000000..35708425 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags010.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep3() -> keep3 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + int fieldPrivate -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011 new file mode 100644 index 00000000..24cd11b3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep4(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011.mapping new file mode 100644 index 00000000..5d902a5e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags011.mapping @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep4() -> keep4 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012 new file mode 100644 index 00000000..b70d599b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep5(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012.mapping new file mode 100644 index 00000000..b474da03 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags012.mapping @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep5() -> keep5 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013 new file mode 100644 index 00000000..ca903092 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013 @@ -0,0 +1,2 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect2$A { +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013.mapping new file mode 100644 index 00000000..822a5dd4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags013.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014 new file mode 100644 index 00000000..2f896a07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep6(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014.mapping new file mode 100644 index 00000000..73c80ea0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags014.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep6() -> keep6 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + long fieldLong -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015 new file mode 100644 index 00000000..f512145d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep7(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015.mapping new file mode 100644 index 00000000..33be3006 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags015.mapping @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep7() -> keep7 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + long fieldLong -> b + long fieldLong3 -> c + long fieldLong4 -> d diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016 new file mode 100644 index 00000000..7a9ca8a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.Reflect { + *** keep8(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016.mapping new file mode 100644 index 00000000..32dea388 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags016.mapping @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void keep8() -> keep8 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017 new file mode 100644 index 00000000..b881e2ac --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test001.jack.K { + void keep(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017.mapping new file mode 100644 index 00000000..84e1c9b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags017.mapping @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> a + int h -> b + int i2 -> c + int j -> d + java.lang.Object o -> e + java.lang.String TAG2 -> f + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018 new file mode 100644 index 00000000..b754033f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018 @@ -0,0 +1,6 @@ +-keep class com.android.jack.shrob.test001.jack.L { (...); } + +-keepclasseswithmembers class * { + *** on*(...); +} + diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018.mapping new file mode 100644 index 00000000..52fca621 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags018.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019 new file mode 100644 index 00000000..5f6cd0f8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019 @@ -0,0 +1,5 @@ +-keepclasseswithmembers class * { + * ; + *; +} + diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019.mapping new file mode 100644 index 00000000..14d06cd0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags019.mapping @@ -0,0 +1,30 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void keep() -> keep +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020 new file mode 100644 index 00000000..75468b77 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020 @@ -0,0 +1,4 @@ +-keepclasseswithmembers class * { + ; +} + diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020.mapping new file mode 100644 index 00000000..1ba7b926 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags020.mapping @@ -0,0 +1,25 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021 new file mode 100644 index 00000000..0913f94e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021 @@ -0,0 +1,6 @@ +-keepclasseswithmembers class * { + ; +} + +-dontshrink + diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021.mapping new file mode 100644 index 00000000..48a2db6e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags021.mapping @@ -0,0 +1,67 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.a: + void m() -> a + void privateFunc() -> b +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.c: + void f() -> a + void m() -> b +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.d: + void keep() -> a + void main(java.lang.String[]) -> a + void main2(java.lang.String[]) -> b +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.e: + void keep() -> a +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.f: + void keep() -> a +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.g: + void m() -> a + void main(java.lang.String[]) -> a +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.h: +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.i: + void m() -> a +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.j: + int[][][] m5(int,boolean,long) -> a + int[][][] m3() -> a + int[][] m2() -> b + int[] m1() -> c + int m0() -> d + int[][][] m() -> e +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void keep() -> a +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void onReceive() -> a +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.k: + void keep() -> a + void keep2() -> b + void keep3() -> c + void keep4() -> d + void keep5() -> e + void keep6() -> f + void keep7() -> g + void keep8() -> h +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void calledMethod() -> a + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022 b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022 new file mode 100644 index 00000000..dc33de0d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022 @@ -0,0 +1,6 @@ +-keepclasseswithmembers class * { + *; +} + +-dontshrink + diff --git a/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022.mapping b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022.mapping new file mode 100644 index 00000000..44c10d6e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/proguard.flags022.mapping @@ -0,0 +1,67 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.a: + void m() -> a + void privateFunc() -> b +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.c: + void f() -> a + void m() -> b +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.d: + void keep() -> a + void main(java.lang.String[]) -> a + void main2(java.lang.String[]) -> b +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.e: + void keep() -> a +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.f: + void keep() -> a +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.g: + void m() -> a + void main(java.lang.String[]) -> a +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.h: +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.i: + void m() -> a +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.j: + int[][][] m5(int,boolean,long) -> a + int[][][] m3() -> a + int[][] m2() -> b + int[] m1() -> c + int m0() -> d + int[][][] m() -> e +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void keep() -> keep +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.k: + void keep() -> a + void keep2() -> b + void keep3() -> c + void keep4() -> d + void keep5() -> e + void keep6() -> f + void keep7() -> g + void keep8() -> h +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..cf97a9d1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..d0de19e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void privateFunc() -> privateFunc + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..fd33a622 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-003.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void (int) -> + void m() -> m + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-004.txt new file mode 100644 index 00000000..1e8816cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main2(java.lang.String[]) -> main2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-005.txt new file mode 100644 index 00000000..f1662242 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-005.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-006.txt new file mode 100644 index 00000000..7fe0a2b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-006.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.G: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-007.txt new file mode 100644 index 00000000..0d7b7248 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-007.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.J: + void () -> + int[][][] m3() -> m3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-008.txt new file mode 100644 index 00000000..9d672e7e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-008.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep() -> keep +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-009.txt new file mode 100644 index 00000000..5ac88564 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-009.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep2() -> keep2 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-010.txt new file mode 100644 index 00000000..02b3720c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-010.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep3() -> keep3 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-011.txt new file mode 100644 index 00000000..cb9f0cf9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-011.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-012.txt new file mode 100644 index 00000000..45fedd60 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-012.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep5() -> keep5 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-013.txt new file mode 100644 index 00000000..c8fb20bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-013.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-014.txt new file mode 100644 index 00000000..04fc2ace --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-014.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep6() -> keep6 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-015.txt new file mode 100644 index 00000000..808e3fe5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-015.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep7() -> keep7 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + long fieldLong -> svryqYcbt:W + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-016.txt new file mode 100644 index 00000000..7998221f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-016.txt @@ -0,0 +1,9 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep8() -> keep8 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> n:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B; + com.android.jack.shrob.test001.jack.Reflect2$B b -> o:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$C; + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-017.txt new file mode 100644 index 00000000..3dc14b07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-017.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + java.lang.String TAG2 -> HNT2:Ywnjn/ynbt/Ghfvbt; + int h -> u:V + int i -> v:V + int i2 -> v2:V + int j -> w:V + java.lang.Object o -> c:Ywnjn/ynbt/Cowrph; + void () -> + void keep() -> keep + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-018.txt new file mode 100644 index 00000000..902eab8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-018.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + void () -> + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-019.txt new file mode 100644 index 00000000..345010d9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-019.txt @@ -0,0 +1,36 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + int fieldPrivate -> fieldPrivate + int fieldPublic -> fieldPublic + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + int h -> h + int i -> i + int i2 -> i2 + int i3 -> i3 + int j -> j + java.lang.Object o -> o + void () -> + void keep() -> keep + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-020.txt new file mode 100644 index 00000000..3123550f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-020.txt @@ -0,0 +1,29 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + int fieldPrivate -> fieldPrivate + int fieldPublic -> fieldPublic + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + int h -> h + int i -> i + int i2 -> i2 + int i3 -> i3 + int j -> j + java.lang.Object o -> o + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-021.txt new file mode 100644 index 00000000..77fa700a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-021.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.W: + void () -> + int[][][] m() -> z__ + int m0() -> z0__ + int[] m1() -> z1__ + int[][] m2() -> z2__ + int[][][] m3() -> z3__ + int[][][] m5(int,boolean,long) -> z5_VNW_ +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.O: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.N: + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ + void () -> +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + int fieldPrivate -> fieldPrivate + int fieldPublic -> fieldPublic + void () -> + void calledMethod() -> pnyyrqZrhucq__ + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$N;_ + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> dfvjnhrZrhucq_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$O;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> cbFrprvjr__ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + int h -> h + int i -> i + int i2 -> i2 + int i3 -> i3 + int j -> j + java.lang.Object o -> o + void () -> + void keep() -> xrrd__ + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-022.txt new file mode 100644 index 00000000..6ac275c6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsFlattenPackage/expected-022.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.W: + void () -> + int[][][] m() -> z__ + int m0() -> z0__ + int[] m1() -> z1__ + int[][] m2() -> z2__ + int[][][] m3() -> z3__ + int[][][] m5(int,boolean,long) -> z5_VNW_ +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.O: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.N: + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ + void () -> +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + int fieldPrivate -> fieldPrivate + int fieldPublic -> fieldPublic + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + int h -> h + int i -> i + int i2 -> i2 + int i3 -> i3 + int j -> j + java.lang.Object o -> o + void () -> + void keep() -> keep + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..51f1db29 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void () -> + void m() -> a +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..b0049fe8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void () -> + void m() -> a +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void privateFunc() -> privateFunc diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..acbe6d5f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.a: + void () -> + void m() -> a +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void (int) -> + void m() -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-004.txt new file mode 100644 index 00000000..952f08dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> a + void main2(java.lang.String[]) -> main2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-005.txt new file mode 100644 index 00000000..9882dfab --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-005.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.a: + void () -> + void keep() -> a +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> a + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-006.txt new file mode 100644 index 00000000..8c2943a4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-006.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.b: + void m() -> a +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.a: +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.G: + void () -> + void m() -> a + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-007.txt new file mode 100644 index 00000000..0d7b7248 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-007.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.J: + void () -> + int[][][] m3() -> m3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-008.txt new file mode 100644 index 00000000..09655677 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-008.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep() -> keep +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-009.txt new file mode 100644 index 00000000..23e40119 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-009.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep2() -> keep2 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-010.txt new file mode 100644 index 00000000..28402c5f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-010.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep3() -> keep3 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-011.txt new file mode 100644 index 00000000..0287a94c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-011.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-012.txt new file mode 100644 index 00000000..c95a0354 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-012.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep5() -> keep5 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-013.txt new file mode 100644 index 00000000..c8fb20bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-013.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-014.txt new file mode 100644 index 00000000..2967038c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-014.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep6() -> keep6 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + int fieldPublic -> a + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-015.txt new file mode 100644 index 00000000..154a6656 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-015.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep7() -> keep7 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + long fieldLong -> b + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-016.txt new file mode 100644 index 00000000..5ad9d9c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-016.txt @@ -0,0 +1,9 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep8() -> keep8 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.a: + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.b: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-017.txt new file mode 100644 index 00000000..ccfdc41f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-017.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> a + int h -> b + int i2 -> c + int j -> d + java.lang.Object o -> e + java.lang.String TAG2 -> f + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-018.txt new file mode 100644 index 00000000..902eab8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-018.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + void () -> + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-019.txt new file mode 100644 index 00000000..93a7c097 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-019.txt @@ -0,0 +1,36 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-020.txt new file mode 100644 index 00000000..a68d6091 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-020.txt @@ -0,0 +1,29 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-021.txt new file mode 100644 index 00000000..350f38ae --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-021.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.e: + void () -> + void keep() -> a +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.i: + void m() -> a +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.h: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.j: + void () -> + int[][][] m5(int,boolean,long) -> a + int[][][] m3() -> a + int[][] m2() -> b + int[] m1() -> c + int m0() -> d + int[][][] m() -> e +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.f: + void () -> + void keep() -> a +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.b: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.d: + void () -> + void keep() -> a + void main(java.lang.String[]) -> a + void main2(java.lang.String[]) -> b +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.g: + void () -> + void m() -> a + void main(java.lang.String[]) -> a +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.k: + void () -> + void keep() -> a + void keep2() -> b + void keep3() -> c + void keep4() -> d + void keep5() -> e + void keep6() -> f + void keep7() -> g + void keep8() -> h +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.c: + void () -> + void f() -> a + void m() -> b +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.a: + void () -> + void () -> + void (int) -> + void m() -> a + void privateFunc() -> b +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> a + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> a + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> a +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> a +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-022.txt new file mode 100644 index 00000000..5f9de20c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithMapping/expected-022.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.e: + void () -> + void keep() -> a +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.i: + void m() -> a +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.h: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.j: + void () -> + int[][][] m5(int,boolean,long) -> a + int[][][] m3() -> a + int[][] m2() -> b + int[] m1() -> c + int m0() -> d + int[][][] m() -> e +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.f: + void () -> + void keep() -> a +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.b: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.d: + void () -> + void keep() -> a + void main(java.lang.String[]) -> a + void main2(java.lang.String[]) -> b +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.g: + void () -> + void m() -> a + void main(java.lang.String[]) -> a +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.k: + void () -> + void keep() -> a + void keep2() -> b + void keep3() -> c + void keep4() -> d + void keep5() -> e + void keep6() -> f + void keep7() -> g + void keep8() -> h +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.c: + void () -> + void f() -> a + void m() -> b +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.a: + void () -> + void () -> + void (int) -> + void m() -> a + void privateFunc() -> b +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..c835fbfc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..d9a37d27 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void privateFunc() -> privateFunc diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..3657083e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void (int) -> + void m() -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-004.txt new file mode 100644 index 00000000..1e8816cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main2(java.lang.String[]) -> main2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-005.txt new file mode 100644 index 00000000..f1662242 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-005.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-006.txt new file mode 100644 index 00000000..7fe0a2b7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-006.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.G: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-007.txt new file mode 100644 index 00000000..0d7b7248 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-007.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.J: + void () -> + int[][][] m3() -> m3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-008.txt new file mode 100644 index 00000000..9d672e7e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-008.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep() -> keep +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-009.txt new file mode 100644 index 00000000..5ac88564 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-009.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep2() -> keep2 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-010.txt new file mode 100644 index 00000000..02b3720c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-010.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep3() -> keep3 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-011.txt new file mode 100644 index 00000000..cb9f0cf9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-011.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-012.txt new file mode 100644 index 00000000..45fedd60 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-012.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep5() -> keep5 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-013.txt new file mode 100644 index 00000000..c8fb20bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-013.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-014.txt new file mode 100644 index 00000000..04fc2ace --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-014.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep6() -> keep6 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-015.txt new file mode 100644 index 00000000..808e3fe5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-015.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep7() -> keep7 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + long fieldLong -> svryqYcbt:W + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-016.txt new file mode 100644 index 00000000..7998221f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-016.txt @@ -0,0 +1,9 @@ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep8() -> keep8 +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Frsyrph2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> n:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B; + com.android.jack.shrob.test001.jack.Reflect2$B b -> o:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$C; + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-017.txt new file mode 100644 index 00000000..992513cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-017.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> v:V + int h -> u:V + int i2 -> v2:V + int j -> w:V + java.lang.Object o -> c:Ywnjn/ynbt/Cowrph; + java.lang.String TAG2 -> HNT2:Ywnjn/ynbt/Ghfvbt; + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-018.txt new file mode 100644 index 00000000..902eab8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-018.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + void () -> + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-019.txt new file mode 100644 index 00000000..93a7c097 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-019.txt @@ -0,0 +1,36 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-020.txt new file mode 100644 index 00000000..a68d6091 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-020.txt @@ -0,0 +1,29 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-021.txt new file mode 100644 index 00000000..4d57298a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-021.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.W: + void () -> + int[][][] m5(int,boolean,long) -> z5_VNW_ + int[][][] m3() -> z3__ + int[][] m2() -> z2__ + int[] m1() -> z1__ + int m0() -> z0__ + int[][][] m() -> z__ +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.O: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.N: + void () -> + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> pnyyrqZrhucq__ + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$N;_ + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> dfvjnhrZrhucq_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$O;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> cbFrprvjr__ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> xrrd__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-022.txt new file mode 100644 index 00000000..57e921e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsObfuscationWithoutMapping/expected-022.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.E -> com.android.jack.shrob.test001.jack.R: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> com.android.jack.shrob.test001.jack.V: + void m() -> z__ +com.android.jack.shrob.test001.jack.H -> com.android.jack.shrob.test001.jack.U: +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.W: + void () -> + int[][][] m5(int,boolean,long) -> z5_VNW_ + int[][][] m3() -> z3__ + int[][] m2() -> z2__ + int[] m1() -> z1__ + int m0() -> z0__ + int[][][] m() -> z__ +com.android.jack.shrob.test001.jack.F -> com.android.jack.shrob.test001.jack.S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.B -> com.android.jack.shrob.test001.jack.O: + void () -> +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.C -> com.android.jack.shrob.test001.jack.P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.N: + void () -> + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..a292fff6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> +com.android.jack.shrob.test001.jack.C -> P: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..1a4311b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void privateFunc() -> privateFunc +com.android.jack.shrob.test001.jack.C -> P: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..418cc837 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-003.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.A -> com.android.jack.shrob.test001.jack.A: + void () -> + void () -> + void (int) -> + void m() -> m +com.android.jack.shrob.test001.jack.C -> P: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-004.txt new file mode 100644 index 00000000..1e8816cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main2(java.lang.String[]) -> main2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-005.txt new file mode 100644 index 00000000..2f36aa05 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-005.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.D -> com.android.jack.shrob.test001.jack.D: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> main +com.android.jack.shrob.test001.jack.E -> R: + void () -> + void keep() -> xrrd__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-006.txt new file mode 100644 index 00000000..ac2be5f9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-006.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test001.jack.H -> U: +com.android.jack.shrob.test001.jack.I -> V: + void m() -> z__ +com.android.jack.shrob.test001.jack.G -> com.android.jack.shrob.test001.jack.G: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> main diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-007.txt new file mode 100644 index 00000000..0d7b7248 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-007.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.J -> com.android.jack.shrob.test001.jack.J: + void () -> + int[][][] m3() -> m3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-008.txt new file mode 100644 index 00000000..bc75f2ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-008.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + void () -> +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-009.txt new file mode 100644 index 00000000..78461575 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-009.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep2() -> keep2 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-010.txt new file mode 100644 index 00000000..8949a93d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-010.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep3() -> keep3 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-011.txt new file mode 100644 index 00000000..ec1917dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-011.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> Frsyrph2$O: +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep4() -> keep4 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-012.txt new file mode 100644 index 00000000..4689a9ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-012.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + void () -> + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> Frsyrph2$O: +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep5() -> keep5 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-013.txt new file mode 100644 index 00000000..c8fb20bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-013.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-014.txt new file mode 100644 index 00000000..c3ce2f61 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-014.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + int fieldPublic -> svryqDioyvp:V + void () -> +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep6() -> keep6 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-015.txt new file mode 100644 index 00000000..b84ed97e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-015.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + long fieldLong -> svryqYcbt:W + void () -> +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep7() -> keep7 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-016.txt new file mode 100644 index 00000000..fd7ad528 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-016.txt @@ -0,0 +1,9 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> Frsyrph2: + com.android.jack.shrob.test001.jack.Reflect2$A a -> n:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$B; + com.android.jack.shrob.test001.jack.Reflect2$B b -> o:Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Sfgmfdu2$C; + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> Frsyrph2$N: +com.android.jack.shrob.test001.jack.Reflect2$B -> Frsyrph2$O: +com.android.jack.shrob.test001.jack.Reflect -> com.android.jack.shrob.test001.jack.Reflect: + void () -> + void keep8() -> keep8 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-017.txt new file mode 100644 index 00000000..992513cf --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-017.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> v:V + int h -> u:V + int i2 -> v2:V + int j -> w:V + java.lang.Object o -> c:Ywnjn/ynbt/Cowrph; + java.lang.String TAG2 -> HNT2:Ywnjn/ynbt/Ghfvbt; + void () -> + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-018.txt new file mode 100644 index 00000000..902eab8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-018.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + void () -> + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-019.txt new file mode 100644 index 00000000..b66ca154 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-019.txt @@ -0,0 +1,36 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-020.txt new file mode 100644 index 00000000..37a750cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-020.txt @@ -0,0 +1,29 @@ +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-021.txt new file mode 100644 index 00000000..21169099 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-021.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.A -> N: + void () -> + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ +com.android.jack.shrob.test001.jack.B -> O: + void () -> +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> pnyyrqZrhucq__ + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$N;_ + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> dfvjnhrZrhucq_Ypcz/nbqfcvq/wnpx/gufco/hrgh001/wnpx/Frsyrph2$O;_ +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.J -> W: + void () -> + int[][][] m5(int,boolean,long) -> z5_VNW_ + int[][][] m3() -> z3__ + int[][] m2() -> z2__ + int[] m1() -> z1__ + int m0() -> z0__ + int[][][] m() -> z__ +com.android.jack.shrob.test001.jack.H -> U: +com.android.jack.shrob.test001.jack.Reflect -> Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.F -> S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> V: + void m() -> z__ +com.android.jack.shrob.test001.jack.G -> T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.D -> Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.C -> P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> cbFrprvjr__ +com.android.jack.shrob.test001.jack.E -> R: + void () -> + void keep() -> xrrd__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-022.txt new file mode 100644 index 00000000..8ef8b83e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsRepackageClasses/expected-022.txt @@ -0,0 +1,84 @@ +com.android.jack.shrob.test001.jack.A -> N: + void () -> + void () -> + void (int) -> + void m() -> z__ + void privateFunc() -> dfvjnhrSibp__ +com.android.jack.shrob.test001.jack.B -> O: + void () -> +com.android.jack.shrob.test001.jack.Reflect2 -> com.android.jack.shrob.test001.jack.Reflect2: + int fieldPublic -> fieldPublic + int fieldPrivate -> fieldPrivate + long fieldLong -> fieldLong + long fieldLong2 -> fieldLong2 + long fieldLong3 -> fieldLong3 + long fieldLong4 -> fieldLong4 + com.android.jack.shrob.test001.jack.Reflect2$A a -> a + com.android.jack.shrob.test001.jack.Reflect2$B b -> b + java.lang.Object c -> c + void () -> + void calledMethod() -> calledMethod + void m(com.android.jack.shrob.test001.jack.Reflect2$A) -> m + void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) -> privateMethod +com.android.jack.shrob.test001.jack.Reflect2$A -> com.android.jack.shrob.test001.jack.Reflect2$A: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.Reflect2$B -> com.android.jack.shrob.test001.jack.Reflect2$B: + com.android.jack.shrob.test001.jack.Reflect2 this$0 -> this$0 + void (com.android.jack.shrob.test001.jack.Reflect2) -> +com.android.jack.shrob.test001.jack.K -> com.android.jack.shrob.test001.jack.K: + int i -> i + int h -> h + int i2 -> i2 + int j -> j + int i3 -> i3 + java.lang.Object o -> o + java.lang.String TAG -> TAG + java.lang.String TAG2 -> TAG2 + void () -> + void () -> + void keep() -> keep +com.android.jack.shrob.test001.jack.J -> W: + void () -> + int[][][] m5(int,boolean,long) -> z5_VNW_ + int[][][] m3() -> z3__ + int[][] m2() -> z2__ + int[] m1() -> z1__ + int m0() -> z0__ + int[][][] m() -> z__ +com.android.jack.shrob.test001.jack.H -> U: +com.android.jack.shrob.test001.jack.Reflect -> Frsyrph: + void () -> + void keep() -> xrrd__ + void keep2() -> xrrd2__ + void keep3() -> xrrd3__ + void keep4() -> xrrd4__ + void keep5() -> xrrd5__ + void keep6() -> xrrd6__ + void keep7() -> xrrd7__ + void keep8() -> xrrd8__ +com.android.jack.shrob.test001.jack.F -> S: + void () -> + void keep() -> xrrd__ +com.android.jack.shrob.test001.jack.I -> V: + void m() -> z__ +com.android.jack.shrob.test001.jack.G -> T: + void () -> + void m() -> z__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.D -> Q: + void () -> + void keep() -> xrrd__ + void main(java.lang.String[]) -> znvb_[Ywnjn/ynbt/Ghfvbt;_ + void main2(java.lang.String[]) -> znvb2_[Ywnjn/ynbt/Ghfvbt;_ +com.android.jack.shrob.test001.jack.C -> P: + void () -> + void f() -> s__ + void m() -> z__ +com.android.jack.shrob.test001.jack.L -> com.android.jack.shrob.test001.jack.L: + java.lang.String TAG -> TAG + void () -> + void onReceive() -> onReceive +com.android.jack.shrob.test001.jack.E -> R: + void () -> + void keep() -> xrrd__ diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-001.txt new file mode 100644 index 00000000..5fa78a7b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-001.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.A diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-002.txt new file mode 100644 index 00000000..592705e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.A +com.android.jack.shrob.test001.jack.A: void privateFunc() +com.android.jack.shrob.test001.jack.A: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-003.txt new file mode 100644 index 00000000..09f93bb8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-003.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test001.jack.A +com.android.jack.shrob.test001.jack.A: void () +com.android.jack.shrob.test001.jack.A: A() +com.android.jack.shrob.test001.jack.A: A(int) +com.android.jack.shrob.test001.jack.A: void m() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-004.txt new file mode 100644 index 00000000..d78079c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-004.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.D +com.android.jack.shrob.test001.jack.D: void main2(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-005.txt new file mode 100644 index 00000000..6f275bdb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-005.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.D +com.android.jack.shrob.test001.jack.D: void main(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-006.txt new file mode 100644 index 00000000..390d8379 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-006.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.G +com.android.jack.shrob.test001.jack.G: void main(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-007.txt new file mode 100644 index 00000000..94c06e10 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.J +com.android.jack.shrob.test001.jack.J: int[][][] m3() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-008.txt new file mode 100644 index 00000000..826b160b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-008.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-009.txt new file mode 100644 index 00000000..5edc4d57 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-009.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep2() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-010.txt new file mode 100644 index 00000000..55ec9084 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-010.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep3() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-011.txt new file mode 100644 index 00000000..91625ebe --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-011.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep4() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-012.txt new file mode 100644 index 00000000..e770499e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-012.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep5() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-013.txt new file mode 100644 index 00000000..6eff7926 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-013.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test001.jack.Reflect2$A diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-014.txt new file mode 100644 index 00000000..e8f2754d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-014.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep6() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-015.txt new file mode 100644 index 00000000..20661b2f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-015.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep7() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-016.txt new file mode 100644 index 00000000..b9e83cb0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-016.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.Reflect +com.android.jack.shrob.test001.jack.Reflect: void keep8() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-017.txt new file mode 100644 index 00000000..f120809e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-017.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test001.jack.K +com.android.jack.shrob.test001.jack.K: void keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-018.txt new file mode 100644 index 00000000..c92314de --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-018.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test001.jack.L +com.android.jack.shrob.test001.jack.L: L() +com.android.jack.shrob.test001.jack.L: void onReceive() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-019.txt new file mode 100644 index 00000000..c30313ae --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-019.txt @@ -0,0 +1,45 @@ +com.android.jack.shrob.test001.jack.K +com.android.jack.shrob.test001.jack.K: int i +com.android.jack.shrob.test001.jack.K: int h +com.android.jack.shrob.test001.jack.K: int i2 +com.android.jack.shrob.test001.jack.K: int j +com.android.jack.shrob.test001.jack.K: int i3 +com.android.jack.shrob.test001.jack.K: java.lang.Object o +com.android.jack.shrob.test001.jack.K: java.lang.String TAG +com.android.jack.shrob.test001.jack.K: java.lang.String TAG2 +com.android.jack.shrob.test001.jack.K: void () +com.android.jack.shrob.test001.jack.K: void $init() +com.android.jack.shrob.test001.jack.K: K() +com.android.jack.shrob.test001.jack.K: void keep() +com.android.jack.shrob.test001.jack.L +com.android.jack.shrob.test001.jack.L: java.lang.String TAG +com.android.jack.shrob.test001.jack.L: L() +com.android.jack.shrob.test001.jack.L: void onReceive() +com.android.jack.shrob.test001.jack.L: void () +com.android.jack.shrob.test001.jack.L: void $init() +com.android.jack.shrob.test001.jack.Reflect2 +com.android.jack.shrob.test001.jack.Reflect2: int fieldPublic +com.android.jack.shrob.test001.jack.Reflect2: int fieldPrivate +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong2 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong3 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong4 +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$A a +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$B b +com.android.jack.shrob.test001.jack.Reflect2: java.lang.Object c +com.android.jack.shrob.test001.jack.Reflect2: Reflect2() +com.android.jack.shrob.test001.jack.Reflect2: void calledMethod() +com.android.jack.shrob.test001.jack.Reflect2: void m(com.android.jack.shrob.test001.jack.Reflect2$A) +com.android.jack.shrob.test001.jack.Reflect2: void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) +com.android.jack.shrob.test001.jack.Reflect2: void () +com.android.jack.shrob.test001.jack.Reflect2: void $init() +com.android.jack.shrob.test001.jack.Reflect2$A +com.android.jack.shrob.test001.jack.Reflect2$A: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$A: Reflect2$A(com.android.jack.shrob.test001.jack.Reflect2) +com.android.jack.shrob.test001.jack.Reflect2$A: void () +com.android.jack.shrob.test001.jack.Reflect2$A: void $init() +com.android.jack.shrob.test001.jack.Reflect2$B +com.android.jack.shrob.test001.jack.Reflect2$B: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$B: Reflect2$B(com.android.jack.shrob.test001.jack.Reflect2) +com.android.jack.shrob.test001.jack.Reflect2$B: void () +com.android.jack.shrob.test001.jack.Reflect2$B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-020.txt new file mode 100644 index 00000000..7ada3330 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-020.txt @@ -0,0 +1,25 @@ +com.android.jack.shrob.test001.jack.K +com.android.jack.shrob.test001.jack.K: int i +com.android.jack.shrob.test001.jack.K: int h +com.android.jack.shrob.test001.jack.K: int i2 +com.android.jack.shrob.test001.jack.K: int j +com.android.jack.shrob.test001.jack.K: int i3 +com.android.jack.shrob.test001.jack.K: java.lang.Object o +com.android.jack.shrob.test001.jack.K: java.lang.String TAG +com.android.jack.shrob.test001.jack.K: java.lang.String TAG2 +com.android.jack.shrob.test001.jack.L +com.android.jack.shrob.test001.jack.L: java.lang.String TAG +com.android.jack.shrob.test001.jack.Reflect2 +com.android.jack.shrob.test001.jack.Reflect2: int fieldPublic +com.android.jack.shrob.test001.jack.Reflect2: int fieldPrivate +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong2 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong3 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong4 +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$A a +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$B b +com.android.jack.shrob.test001.jack.Reflect2: java.lang.Object c +com.android.jack.shrob.test001.jack.Reflect2$A +com.android.jack.shrob.test001.jack.Reflect2$A: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$B +com.android.jack.shrob.test001.jack.Reflect2$B: com.android.jack.shrob.test001.jack.Reflect2 this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-021.txt new file mode 100644 index 00000000..7ada3330 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-021.txt @@ -0,0 +1,25 @@ +com.android.jack.shrob.test001.jack.K +com.android.jack.shrob.test001.jack.K: int i +com.android.jack.shrob.test001.jack.K: int h +com.android.jack.shrob.test001.jack.K: int i2 +com.android.jack.shrob.test001.jack.K: int j +com.android.jack.shrob.test001.jack.K: int i3 +com.android.jack.shrob.test001.jack.K: java.lang.Object o +com.android.jack.shrob.test001.jack.K: java.lang.String TAG +com.android.jack.shrob.test001.jack.K: java.lang.String TAG2 +com.android.jack.shrob.test001.jack.L +com.android.jack.shrob.test001.jack.L: java.lang.String TAG +com.android.jack.shrob.test001.jack.Reflect2 +com.android.jack.shrob.test001.jack.Reflect2: int fieldPublic +com.android.jack.shrob.test001.jack.Reflect2: int fieldPrivate +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong2 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong3 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong4 +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$A a +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$B b +com.android.jack.shrob.test001.jack.Reflect2: java.lang.Object c +com.android.jack.shrob.test001.jack.Reflect2$A +com.android.jack.shrob.test001.jack.Reflect2$A: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$B +com.android.jack.shrob.test001.jack.Reflect2$B: com.android.jack.shrob.test001.jack.Reflect2 this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-022.txt new file mode 100644 index 00000000..b675c0f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsSeed/expected-022.txt @@ -0,0 +1,45 @@ +com.android.jack.shrob.test001.jack.K +com.android.jack.shrob.test001.jack.K: int i +com.android.jack.shrob.test001.jack.K: int h +com.android.jack.shrob.test001.jack.K: int i2 +com.android.jack.shrob.test001.jack.K: int j +com.android.jack.shrob.test001.jack.K: int i3 +com.android.jack.shrob.test001.jack.K: java.lang.Object o +com.android.jack.shrob.test001.jack.K: java.lang.String TAG +com.android.jack.shrob.test001.jack.K: java.lang.String TAG2 +com.android.jack.shrob.test001.jack.K: K() +com.android.jack.shrob.test001.jack.K: void keep() +com.android.jack.shrob.test001.jack.K: void () +com.android.jack.shrob.test001.jack.K: void $init() +com.android.jack.shrob.test001.jack.L +com.android.jack.shrob.test001.jack.L: java.lang.String TAG +com.android.jack.shrob.test001.jack.L: L() +com.android.jack.shrob.test001.jack.L: void onReceive() +com.android.jack.shrob.test001.jack.L: void () +com.android.jack.shrob.test001.jack.L: void $init() +com.android.jack.shrob.test001.jack.Reflect2 +com.android.jack.shrob.test001.jack.Reflect2: int fieldPublic +com.android.jack.shrob.test001.jack.Reflect2: int fieldPrivate +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong2 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong3 +com.android.jack.shrob.test001.jack.Reflect2: long fieldLong4 +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$A a +com.android.jack.shrob.test001.jack.Reflect2: com.android.jack.shrob.test001.jack.Reflect2$B b +com.android.jack.shrob.test001.jack.Reflect2: java.lang.Object c +com.android.jack.shrob.test001.jack.Reflect2: Reflect2() +com.android.jack.shrob.test001.jack.Reflect2: void calledMethod() +com.android.jack.shrob.test001.jack.Reflect2: void m(com.android.jack.shrob.test001.jack.Reflect2$A) +com.android.jack.shrob.test001.jack.Reflect2: void privateMethod(com.android.jack.shrob.test001.jack.Reflect2$B) +com.android.jack.shrob.test001.jack.Reflect2: void () +com.android.jack.shrob.test001.jack.Reflect2: void $init() +com.android.jack.shrob.test001.jack.Reflect2$A +com.android.jack.shrob.test001.jack.Reflect2$A: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$A: Reflect2$A(com.android.jack.shrob.test001.jack.Reflect2) +com.android.jack.shrob.test001.jack.Reflect2$A: void () +com.android.jack.shrob.test001.jack.Reflect2$A: void $init() +com.android.jack.shrob.test001.jack.Reflect2$B +com.android.jack.shrob.test001.jack.Reflect2$B: com.android.jack.shrob.test001.jack.Reflect2 this$0 +com.android.jack.shrob.test001.jack.Reflect2$B: Reflect2$B(com.android.jack.shrob.test001.jack.Reflect2) +com.android.jack.shrob.test001.jack.Reflect2$B: void () +com.android.jack.shrob.test001.jack.Reflect2$B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-001.txt new file mode 100644 index 00000000..983bd4b2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-001.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test001/jack/C;: +()V +m()V +Lcom/android/jack/shrob/test001/jack/A;: +()V +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-002.txt new file mode 100644 index 00000000..806e04e4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-002.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test001/jack/C;: +()V +m()V +Lcom/android/jack/shrob/test001/jack/A;: +()V +()V +privateFunc()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-003.txt new file mode 100644 index 00000000..95f73fac --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-003.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test001/jack/C;: +()V +m()V +Lcom/android/jack/shrob/test001/jack/A;: +()V +()V +(I)V +m()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-004.txt new file mode 100644 index 00000000..8399cefa --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-004.txt @@ -0,0 +1,4 @@ +Lcom/android/jack/shrob/test001/jack/D;: +()V +keep()V +main2([Ljava/lang/String;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-005.txt new file mode 100644 index 00000000..620bc476 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-005.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test001/jack/D;: +()V +keep()V +main([Ljava/lang/String;)V +Lcom/android/jack/shrob/test001/jack/E;: +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-006.txt new file mode 100644 index 00000000..23b5c4e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-006.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test001/jack/I;: +m()V +Lcom/android/jack/shrob/test001/jack/H;: +Lcom/android/jack/shrob/test001/jack/G;: +()V +m()V +main([Ljava/lang/String;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-007.txt new file mode 100644 index 00000000..0d444f23 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-007.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test001/jack/J;: +()V +m3()[[[I diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-008.txt new file mode 100644 index 00000000..e8ab11c5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-008.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +()V +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-009.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-009.txt new file mode 100644 index 00000000..baf5c676 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-009.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +()V +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep2()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-010.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-010.txt new file mode 100644 index 00000000..f7e0fa03 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-010.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +()V +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep3()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-011.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-011.txt new file mode 100644 index 00000000..1bb030cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-011.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +()V +m(Lcom/android/jack/shrob/test001/jack/Reflect2$A;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep4()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-012.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-012.txt new file mode 100644 index 00000000..f0552582 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-012.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +()V +m(Lcom/android/jack/shrob/test001/jack/Reflect2$A;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep5()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-013.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-013.txt new file mode 100644 index 00000000..d997d6e6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-013.txt @@ -0,0 +1 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-014.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-014.txt new file mode 100644 index 00000000..3bbf12a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-014.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +()V +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep6()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-015.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-015.txt new file mode 100644 index 00000000..32728056 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-015.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +J fieldLong +()V +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep7()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-016.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-016.txt new file mode 100644 index 00000000..24c3d5b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-016.txt @@ -0,0 +1,9 @@ +Lcom/android/jack/shrob/test001/jack/Reflect2;: +Lcom/android/jack/shrob/test001/jack/Reflect2$A; a +Lcom/android/jack/shrob/test001/jack/Reflect2$B; b +()V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep8()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-017.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-017.txt new file mode 100644 index 00000000..870d92b1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-017.txt @@ -0,0 +1,10 @@ +Lcom/android/jack/shrob/test001/jack/K;: +I i +I h +I i2 +I j +Ljava/lang/Object; o +Ljava/lang/String; TAG2 +()V +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-018.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-018.txt new file mode 100644 index 00000000..58070d5d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-018.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test001/jack/L;: +()V +onReceive()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-019.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-019.txt new file mode 100644 index 00000000..f3e68db3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-019.txt @@ -0,0 +1,36 @@ +Lcom/android/jack/shrob/test001/jack/L;: +Ljava/lang/String; TAG +()V +onReceive()V +Lcom/android/jack/shrob/test001/jack/K;: +I i +I h +I i2 +I j +I i3 +Ljava/lang/Object; o +Ljava/lang/String; TAG +Ljava/lang/String; TAG2 +()V +()V +keep()V +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +I fieldPrivate +J fieldLong +J fieldLong2 +J fieldLong3 +J fieldLong4 +Lcom/android/jack/shrob/test001/jack/Reflect2$A; a +Lcom/android/jack/shrob/test001/jack/Reflect2$B; b +Ljava/lang/Object; c +()V +calledMethod()V +m(Lcom/android/jack/shrob/test001/jack/Reflect2$A;)V +privateMethod(Lcom/android/jack/shrob/test001/jack/Reflect2$B;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-020.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-020.txt new file mode 100644 index 00000000..fe4a5440 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-020.txt @@ -0,0 +1,29 @@ +Lcom/android/jack/shrob/test001/jack/L;: +Ljava/lang/String; TAG +()V +Lcom/android/jack/shrob/test001/jack/K;: +I i +I h +I i2 +I j +I i3 +Ljava/lang/Object; o +Ljava/lang/String; TAG +Ljava/lang/String; TAG2 +()V +()V +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +I fieldPrivate +J fieldLong +J fieldLong2 +J fieldLong3 +J fieldLong4 +Lcom/android/jack/shrob/test001/jack/Reflect2$A; a +Lcom/android/jack/shrob/test001/jack/Reflect2$B; b +Ljava/lang/Object; c +()V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-021.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-021.txt new file mode 100644 index 00000000..696499c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-021.txt @@ -0,0 +1,84 @@ +Lcom/android/jack/shrob/test001/jack/L;: +Ljava/lang/String; TAG +()V +onReceive()V +Lcom/android/jack/shrob/test001/jack/D;: +()V +keep()V +main([Ljava/lang/String;)V +main2([Ljava/lang/String;)V +Lcom/android/jack/shrob/test001/jack/C;: +()V +f()V +m()V +Lcom/android/jack/shrob/test001/jack/K;: +I i +I h +I i2 +I j +I i3 +Ljava/lang/Object; o +Ljava/lang/String; TAG +Ljava/lang/String; TAG2 +()V +()V +keep()V +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +I fieldPrivate +J fieldLong +J fieldLong2 +J fieldLong3 +J fieldLong4 +Lcom/android/jack/shrob/test001/jack/Reflect2$A; a +Lcom/android/jack/shrob/test001/jack/Reflect2$B; b +Ljava/lang/Object; c +()V +calledMethod()V +m(Lcom/android/jack/shrob/test001/jack/Reflect2$A;)V +privateMethod(Lcom/android/jack/shrob/test001/jack/Reflect2$B;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V +Lcom/android/jack/shrob/test001/jack/J;: +()V +m5(IZJ)[[[I +m3()[[[I +m2()[[I +m1()[I +m0()I +m()[[[I +Lcom/android/jack/shrob/test001/jack/I;: +m()V +Lcom/android/jack/shrob/test001/jack/A;: +()V +()V +(I)V +m()V +privateFunc()V +Lcom/android/jack/shrob/test001/jack/H;: +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep()V +keep2()V +keep3()V +keep4()V +keep5()V +keep6()V +keep7()V +keep8()V +Lcom/android/jack/shrob/test001/jack/G;: +()V +m()V +main([Ljava/lang/String;)V +Lcom/android/jack/shrob/test001/jack/E;: +()V +keep()V +Lcom/android/jack/shrob/test001/jack/B;: +()V +Lcom/android/jack/shrob/test001/jack/F;: +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-022.txt b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-022.txt new file mode 100644 index 00000000..696499c9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test001/refsShrinking/expected-022.txt @@ -0,0 +1,84 @@ +Lcom/android/jack/shrob/test001/jack/L;: +Ljava/lang/String; TAG +()V +onReceive()V +Lcom/android/jack/shrob/test001/jack/D;: +()V +keep()V +main([Ljava/lang/String;)V +main2([Ljava/lang/String;)V +Lcom/android/jack/shrob/test001/jack/C;: +()V +f()V +m()V +Lcom/android/jack/shrob/test001/jack/K;: +I i +I h +I i2 +I j +I i3 +Ljava/lang/Object; o +Ljava/lang/String; TAG +Ljava/lang/String; TAG2 +()V +()V +keep()V +Lcom/android/jack/shrob/test001/jack/Reflect2;: +I fieldPublic +I fieldPrivate +J fieldLong +J fieldLong2 +J fieldLong3 +J fieldLong4 +Lcom/android/jack/shrob/test001/jack/Reflect2$A; a +Lcom/android/jack/shrob/test001/jack/Reflect2$B; b +Ljava/lang/Object; c +()V +calledMethod()V +m(Lcom/android/jack/shrob/test001/jack/Reflect2$A;)V +privateMethod(Lcom/android/jack/shrob/test001/jack/Reflect2$B;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$A;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V +Lcom/android/jack/shrob/test001/jack/Reflect2$B;: +Lcom/android/jack/shrob/test001/jack/Reflect2; this$0 +(Lcom/android/jack/shrob/test001/jack/Reflect2;)V +Lcom/android/jack/shrob/test001/jack/J;: +()V +m5(IZJ)[[[I +m3()[[[I +m2()[[I +m1()[I +m0()I +m()[[[I +Lcom/android/jack/shrob/test001/jack/I;: +m()V +Lcom/android/jack/shrob/test001/jack/A;: +()V +()V +(I)V +m()V +privateFunc()V +Lcom/android/jack/shrob/test001/jack/H;: +Lcom/android/jack/shrob/test001/jack/Reflect;: +()V +keep()V +keep2()V +keep3()V +keep4()V +keep5()V +keep6()V +keep7()V +keep8()V +Lcom/android/jack/shrob/test001/jack/G;: +()V +m()V +main([Ljava/lang/String;)V +Lcom/android/jack/shrob/test001/jack/E;: +()V +keep()V +Lcom/android/jack/shrob/test001/jack/B;: +()V +Lcom/android/jack/shrob/test001/jack/F;: +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test002/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test002/jack/A.java new file mode 100644 index 00000000..76b4fdd8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/jack/A.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test002.jack; + +public class A { + @Override + public String toString() { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test002/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test002/jack/B.java new file mode 100644 index 00000000..5601a131 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test002.jack; + +public class B { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags001 new file mode 100644 index 00000000..a18b4d89 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags001 @@ -0,0 +1 @@ +-keep class com.android.jack.shrob.test002.jack.A \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002 new file mode 100644 index 00000000..19a9b412 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002 @@ -0,0 +1,5 @@ +-keep class java.lang.Object { + java.lang.String toString(); +} + +-keep class com.android.jack.shrob.test002.jack.B \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002.mapping new file mode 100644 index 00000000..d184e76e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags002.mapping @@ -0,0 +1 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: diff --git a/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003 new file mode 100644 index 00000000..6b3afd01 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003 @@ -0,0 +1 @@ +-keep class com.android.jack.shrob.test002.jack.B \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003.mapping new file mode 100644 index 00000000..d184e76e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/proguard.flags003.mapping @@ -0,0 +1 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..8dfebe77 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test002.jack.A -> com.android.jack.shrob.test002.jack.A: + void () -> + java.lang.String toString() -> toString diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsFlattenPackage/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..8dfebe77 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test002.jack.A -> com.android.jack.shrob.test002.jack.A: + void () -> + java.lang.String toString() -> toString diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..8dfebe77 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test002.jack.A -> com.android.jack.shrob.test002.jack.A: + void () -> + java.lang.String toString() -> toString diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..8dfebe77 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test002.jack.A -> com.android.jack.shrob.test002.jack.A: + void () -> + java.lang.String toString() -> toString diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..401c6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsRepackageClasses/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test002.jack.B -> com.android.jack.shrob.test002.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-001.txt new file mode 100644 index 00000000..df3c1d97 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-001.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test002.jack.A diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-002.txt new file mode 100644 index 00000000..3c2dea27 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-002.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test002.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-003.txt new file mode 100644 index 00000000..3c2dea27 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsSeed/expected-003.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test002.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-001.txt new file mode 100644 index 00000000..0ebb1564 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test002/jack/A;: +()V +toString()Ljava/lang/String; diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-002.txt new file mode 100644 index 00000000..6164464a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-002.txt @@ -0,0 +1,2 @@ +Lcom/android/jack/shrob/test002/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-003.txt new file mode 100644 index 00000000..6164464a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test002/refsShrinking/expected-003.txt @@ -0,0 +1,2 @@ +Lcom/android/jack/shrob/test002/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test003/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test003/jack/A.java new file mode 100644 index 00000000..a6792eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test003.jack; + +public class A { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test003/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test003/jack/B.java new file mode 100644 index 00000000..9de47cc9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test003.jack; + +public class B { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test003/lib/Test.java b/jack-tests/tests/com/android/jack/shrob/test003/lib/Test.java new file mode 100644 index 00000000..71228c70 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/lib/Test.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test003.lib; + +public class Test { + void keep() throws ClassNotFoundException { + Class.forName("com.android.jack.shrob.test003.jack.A"); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001 new file mode 100644 index 00000000..474bf63c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001 @@ -0,0 +1,6 @@ +-keep class com.android.jack.shrob.test003.lib.Test { + void keep(); +} + +# to avoid empty result +-keep class com.android.jack.shrob.test003.jack.B \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001.mapping new file mode 100644 index 00000000..f6b7dd6d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/proguard.flags001.mapping @@ -0,0 +1 @@ +com.android.jack.shrob.test003.jack.B -> com.android.jack.shrob.test003.jack.B: diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..f2319881 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsFlattenPackage/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test003.jack.B -> com.android.jack.shrob.test003.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..f2319881 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test003.jack.B -> com.android.jack.shrob.test003.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..f2319881 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test003.jack.B -> com.android.jack.shrob.test003.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..f2319881 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsRepackageClasses/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test003.jack.B -> com.android.jack.shrob.test003.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsSeed/expected-001.txt new file mode 100644 index 00000000..90b2f3e5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsSeed/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test003.jack.B +com.android.jack.shrob.test003.lib.Test +com.android.jack.shrob.test003.lib.Test: void keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test003/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test003/refsShrinking/expected-001.txt new file mode 100644 index 00000000..9d54783c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test003/refsShrinking/expected-001.txt @@ -0,0 +1,2 @@ +Lcom/android/jack/shrob/test003/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test003/test.jar b/jack-tests/tests/com/android/jack/shrob/test003/test.jar new file mode 100644 index 00000000..c05fa6b0 Binary files /dev/null and b/jack-tests/tests/com/android/jack/shrob/test003/test.jar differ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test004/jack/A.java new file mode 100644 index 00000000..1716314f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/jack/A.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test004.jack; + +public class A { + A() { + m(); + } + + A(int i) { + m2(); + } + + void m() { + + } + + void m2() { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001 new file mode 100644 index 00000000..f33610ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001 @@ -0,0 +1 @@ +-keep class com.android.jack.shrob.test004.jack.A \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001.mapping new file mode 100644 index 00000000..95418dc1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002 new file mode 100644 index 00000000..75dc4f4d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test004.jack.A { + A(int); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002.mapping new file mode 100644 index 00000000..8441b1f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags002.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void m() -> a + void m2() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003 new file mode 100644 index 00000000..e9b9d473 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test004.jack.A { + com.android.jack.shrob.test004.jack.A(int); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003.mapping new file mode 100644 index 00000000..8441b1f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/proguard.flags003.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void m() -> a + void m2() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..44911939 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsFlattenPackage/expected-003.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..3695723f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..6dd9c9bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> a + void m2() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..6dd9c9bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> a + void m2() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..44911939 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..44911939 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..4ea122d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsRepackageClasses/expected-003.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test004.jack.A -> com.android.jack.shrob.test004.jack.A: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-001.txt new file mode 100644 index 00000000..82768331 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-001.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test004.jack.A diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-002.txt new file mode 100644 index 00000000..680c46ca --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test004.jack.A +com.android.jack.shrob.test004.jack.A: A(int) diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-003.txt new file mode 100644 index 00000000..680c46ca --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test004.jack.A +com.android.jack.shrob.test004.jack.A: A(int) diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-001.txt new file mode 100644 index 00000000..7d448db2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test004/jack/A;: +()V +m()V diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-002.txt new file mode 100644 index 00000000..9b0cc8d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-002.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test004/jack/A;: +()V +(I)V +m()V +m2()V diff --git a/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-003.txt new file mode 100644 index 00000000..9b0cc8d6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test004/refsShrinking/expected-003.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test004/jack/A;: +()V +(I)V +m()V +m2()V diff --git a/jack-tests/tests/com/android/jack/shrob/test005/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test005/jack/A.java new file mode 100644 index 00000000..926515f4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/jack/A.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test005.jack; + +@Annot +@Annot2 +public class A { + +} + +@Annot +class B { + +} + +@Annot2 +class C { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot.java b/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot.java new file mode 100644 index 00000000..97dd8520 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test005.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot { + int intValue() default 42; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot2.java b/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot2.java new file mode 100644 index 00000000..9d88304a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/jack/Annot2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test005.jack; + +public @interface Annot2 { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test005/jack/E.java b/jack-tests/tests/com/android/jack/shrob/test005/jack/E.java new file mode 100644 index 00000000..6c42f3f3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/jack/E.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test005.jack; + +public enum E { + A,B,C +} diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001 new file mode 100644 index 00000000..f80e427e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001 @@ -0,0 +1 @@ +-keep,allowobfuscation @com.android.jack.shrob.test005.jack.Annot class com.android.jack.shrob.test005.jack.* \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001.mapping new file mode 100644 index 00000000..d1ece21f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags001.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002 new file mode 100644 index 00000000..93566489 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002 @@ -0,0 +1 @@ +-keep,allowobfuscation @com.android.jack.shrob.test005.jack.A?not class ** \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002.mapping new file mode 100644 index 00000000..ef906502 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003 new file mode 100644 index 00000000..93566489 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003 @@ -0,0 +1 @@ +-keep,allowobfuscation @com.android.jack.shrob.test005.jack.A?not class ** \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003.mapping new file mode 100644 index 00000000..d1ece21f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags003.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004 new file mode 100644 index 00000000..eb2c6a07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004 @@ -0,0 +1 @@ +-keep interface com.android.jack.shrob.test005.jack.A?not \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004.mapping new file mode 100644 index 00000000..a01062be --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags004.mapping @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005 new file mode 100644 index 00000000..e02614c8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005 @@ -0,0 +1 @@ +-dontshrink \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005.mapping new file mode 100644 index 00000000..83f2fad1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags005.mapping @@ -0,0 +1,13 @@ +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.b: + int intValue() -> a +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.d: +com.android.jack.shrob.test005.jack.C -> a.a.a.a.a.a.e: +com.android.jack.shrob.test005.jack.E -> a.a.a.a.a.a.f: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> d + com.android.jack.shrob.test005.jack.E valueOf(java.lang.String) -> a + com.android.jack.shrob.test005.jack.E[] values() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006 new file mode 100644 index 00000000..03ad11cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006 @@ -0,0 +1 @@ +-keep class com.android.jack.shrob.test005.jack.* \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006.mapping new file mode 100644 index 00000000..2fe0e725 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags006.mapping @@ -0,0 +1,10 @@ +com.android.jack.shrob.test005.jack.A -> com.android.jack.shrob.test005.jack.A: +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: +com.android.jack.shrob.test005.jack.B -> com.android.jack.shrob.test005.jack.B: +com.android.jack.shrob.test005.jack.C -> com.android.jack.shrob.test005.jack.C: +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> e diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007 new file mode 100644 index 00000000..b20f81fd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007 @@ -0,0 +1 @@ +-keep interface com.android.jack.shrob.test005.jack.* \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007.mapping new file mode 100644 index 00000000..8692631c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags007.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008 b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008 new file mode 100644 index 00000000..8f63eca2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008 @@ -0,0 +1 @@ +-keep enum com.android.jack.shrob.test005.jack.* \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008.mapping b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008.mapping new file mode 100644 index 00000000..48080550 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/proguard.flags008.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> e diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..227d1905 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> flatpackage.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> flatpackage.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> flatpackage.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> flatpackage.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..227d1905 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> flatpackage.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> flatpackage.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> flatpackage.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> flatpackage.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..227d1905 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> flatpackage.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> flatpackage.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> flatpackage.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> flatpackage.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-004.txt new file mode 100644 index 00000000..a01062be --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-004.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-005.txt new file mode 100644 index 00000000..8542e1db --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-005.txt @@ -0,0 +1,18 @@ +com.android.jack.shrob.test005.jack.Annot -> flatpackage.wnpx.Nbbch: + int intValue() -> vbhJnyir__ +com.android.jack.shrob.test005.jack.E -> flatpackage.wnpx.R: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/tispc/uftu005/kbdl/F; + void (java.lang.String,int) -> + com.android.jack.shrob.test005.jack.E valueOf(java.lang.String) -> jnyirCs_Ywnjn/ynbt/Ghfvbt;_ + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> +com.android.jack.shrob.test005.jack.A -> flatpackage.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> flatpackage.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.C -> flatpackage.wnpx.P: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> flatpackage.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-006.txt new file mode 100644 index 00000000..14df30cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-006.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + void (java.lang.String,int) -> + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> +com.android.jack.shrob.test005.jack.A -> com.android.jack.shrob.test005.jack.A: + void () -> +com.android.jack.shrob.test005.jack.B -> com.android.jack.shrob.test005.jack.B: + void () -> +com.android.jack.shrob.test005.jack.C -> com.android.jack.shrob.test005.jack.C: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-007.txt new file mode 100644 index 00000000..8692631c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-008.txt new file mode 100644 index 00000000..0ad5545e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsFlattenPackage/expected-008.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + void (java.lang.String,int) -> + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..d31f1cf5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: + void () -> +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..d31f1cf5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: + void () -> +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..d31f1cf5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.c: +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: + void () -> +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.b: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.d: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-004.txt new file mode 100644 index 00000000..a01062be --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-004.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-005.txt new file mode 100644 index 00000000..38f03805 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-005.txt @@ -0,0 +1,18 @@ +com.android.jack.shrob.test005.jack.Annot -> a.a.a.a.a.a.b: + int intValue() -> a +com.android.jack.shrob.test005.jack.E -> a.a.a.a.a.a.f: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> d + void () -> + com.android.jack.shrob.test005.jack.E valueOf(java.lang.String) -> a + com.android.jack.shrob.test005.jack.E[] values() -> b + void (java.lang.String,int) -> +com.android.jack.shrob.test005.jack.A -> a.a.a.a.a.a.a: + void () -> +com.android.jack.shrob.test005.jack.B -> a.a.a.a.a.a.d: + void () -> +com.android.jack.shrob.test005.jack.C -> a.a.a.a.a.a.e: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> a.a.a.a.a.a.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-006.txt new file mode 100644 index 00000000..35a7a05d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-006.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> e + com.android.jack.shrob.test005.jack.E[] values() -> a + void () -> + void (java.lang.String,int) -> +com.android.jack.shrob.test005.jack.A -> com.android.jack.shrob.test005.jack.A: + void () -> +com.android.jack.shrob.test005.jack.B -> com.android.jack.shrob.test005.jack.B: + void () -> +com.android.jack.shrob.test005.jack.C -> com.android.jack.shrob.test005.jack.C: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-007.txt new file mode 100644 index 00000000..8692631c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-008.txt new file mode 100644 index 00000000..723de198 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithMapping/expected-008.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> a + com.android.jack.shrob.test005.jack.E B -> b + com.android.jack.shrob.test005.jack.E C -> c + com.android.jack.shrob.test005.jack.E[] $VALUES -> e + com.android.jack.shrob.test005.jack.E[] values() -> a + void () -> + void (java.lang.String,int) -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..55e04f2e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..55e04f2e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..55e04f2e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.Annot -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch: +com.android.jack.shrob.test005.jack.A -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-004.txt new file mode 100644 index 00000000..a01062be --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-004.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-005.txt new file mode 100644 index 00000000..0cae3868 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-005.txt @@ -0,0 +1,18 @@ +com.android.jack.shrob.test005.jack.Annot -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch: + int intValue() -> vbhJnyir__ +com.android.jack.shrob.test005.jack.E -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.R: + com.android.jack.shrob.test005.jack.E A -> N:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E B -> O:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E C -> P:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + void () -> + com.android.jack.shrob.test005.jack.E valueOf(java.lang.String) -> jnyirCs_Ywnjn/ynbt/Ghfvbt;_ + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void (java.lang.String,int) -> +com.android.jack.shrob.test005.jack.A -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.N: + void () -> +com.android.jack.shrob.test005.jack.B -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.O: + void () -> +com.android.jack.shrob.test005.jack.C -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.P: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> pcz.nbqfcvq.wnpx.gufco.hrgh005.wnpx.Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-006.txt new file mode 100644 index 00000000..ec804ab7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-006.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> + void (java.lang.String,int) -> +com.android.jack.shrob.test005.jack.A -> com.android.jack.shrob.test005.jack.A: + void () -> +com.android.jack.shrob.test005.jack.B -> com.android.jack.shrob.test005.jack.B: + void () -> +com.android.jack.shrob.test005.jack.C -> com.android.jack.shrob.test005.jack.C: + void () -> +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-007.txt new file mode 100644 index 00000000..8692631c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-008.txt new file mode 100644 index 00000000..ab7a2bac --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsObfuscationWithoutMapping/expected-008.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> + void (java.lang.String,int) -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..9890ce87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.A -> N: + void () -> +com.android.jack.shrob.test005.jack.B -> O: + void () -> +com.android.jack.shrob.test005.jack.Annot -> Nbbch: +com.android.jack.shrob.test005.jack.Annot2 -> Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..9890ce87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.A -> N: + void () -> +com.android.jack.shrob.test005.jack.B -> O: + void () -> +com.android.jack.shrob.test005.jack.Annot -> Nbbch: +com.android.jack.shrob.test005.jack.Annot2 -> Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..9890ce87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.A -> N: + void () -> +com.android.jack.shrob.test005.jack.B -> O: + void () -> +com.android.jack.shrob.test005.jack.Annot -> Nbbch: +com.android.jack.shrob.test005.jack.Annot2 -> Nbbch2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-004.txt new file mode 100644 index 00000000..a01062be --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-004.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-005.txt new file mode 100644 index 00000000..426878c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-005.txt @@ -0,0 +1,18 @@ +com.android.jack.shrob.test005.jack.A -> N: + void () -> +com.android.jack.shrob.test005.jack.B -> O: + void () -> +com.android.jack.shrob.test005.jack.C -> P: + void () -> +com.android.jack.shrob.test005.jack.Annot -> Nbbch: + int intValue() -> vbhJnyir__ +com.android.jack.shrob.test005.jack.Annot2 -> Nbbch2: +com.android.jack.shrob.test005.jack.E -> R: + com.android.jack.shrob.test005.jack.E A -> N:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E B -> O:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E C -> P:Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ydpn/boespje/kbdl/tispc/uftu005/kbdl/F; + void () -> + com.android.jack.shrob.test005.jack.E valueOf(java.lang.String) -> jnyirCs_Ywnjn/ynbt/Ghfvbt;_ + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void (java.lang.String,int) -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-006.txt new file mode 100644 index 00000000..36844bf6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-006.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test005.jack.A -> com.android.jack.shrob.test005.jack.A: + void () -> +com.android.jack.shrob.test005.jack.B -> com.android.jack.shrob.test005.jack.B: + void () -> +com.android.jack.shrob.test005.jack.C -> com.android.jack.shrob.test005.jack.C: + void () -> +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> + void (java.lang.String,int) -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-007.txt new file mode 100644 index 00000000..8692631c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot -> com.android.jack.shrob.test005.jack.Annot: +com.android.jack.shrob.test005.jack.Annot2 -> com.android.jack.shrob.test005.jack.Annot2: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-008.txt new file mode 100644 index 00000000..ab7a2bac --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsRepackageClasses/expected-008.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test005.jack.E -> com.android.jack.shrob.test005.jack.E: + com.android.jack.shrob.test005.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh005/wnpx/R; + com.android.jack.shrob.test005.jack.E[] values() -> jnyirg__ + void () -> + void (java.lang.String,int) -> diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-001.txt new file mode 100644 index 00000000..d335f866 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.A +com.android.jack.shrob.test005.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-002.txt new file mode 100644 index 00000000..d335f866 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.A +com.android.jack.shrob.test005.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-003.txt new file mode 100644 index 00000000..d335f866 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.A +com.android.jack.shrob.test005.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-004.txt new file mode 100644 index 00000000..fc5ca45d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-004.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.Annot diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-006.txt new file mode 100644 index 00000000..b215c15a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test005.jack.A +com.android.jack.shrob.test005.jack.Annot +com.android.jack.shrob.test005.jack.Annot2 +com.android.jack.shrob.test005.jack.B +com.android.jack.shrob.test005.jack.C +com.android.jack.shrob.test005.jack.E diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-007.txt new file mode 100644 index 00000000..7491a70a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-007.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test005.jack.Annot +com.android.jack.shrob.test005.jack.Annot2 diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-008.txt new file mode 100644 index 00000000..9589582f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsSeed/expected-008.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test005.jack.E diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-001.txt new file mode 100644 index 00000000..1405ad0f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-001.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/A;: +()V +Lcom/android/jack/shrob/test005/jack/B;: +()V +Lcom/android/jack/shrob/test005/jack/Annot;: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-002.txt new file mode 100644 index 00000000..1405ad0f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-002.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/A;: +()V +Lcom/android/jack/shrob/test005/jack/B;: +()V +Lcom/android/jack/shrob/test005/jack/Annot;: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-003.txt new file mode 100644 index 00000000..1405ad0f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-003.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/A;: +()V +Lcom/android/jack/shrob/test005/jack/B;: +()V +Lcom/android/jack/shrob/test005/jack/Annot;: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-004.txt new file mode 100644 index 00000000..14f45bc7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-004.txt @@ -0,0 +1 @@ +Lcom/android/jack/shrob/test005/jack/Annot;: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-005.txt new file mode 100644 index 00000000..0c7ac117 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-005.txt @@ -0,0 +1,18 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/A;: +()V +Lcom/android/jack/shrob/test005/jack/B;: +()V +Lcom/android/jack/shrob/test005/jack/C;: +()V +Lcom/android/jack/shrob/test005/jack/Annot;: +intValue()I +Lcom/android/jack/shrob/test005/jack/E;: +Lcom/android/jack/shrob/test005/jack/E; A +Lcom/android/jack/shrob/test005/jack/E; B +Lcom/android/jack/shrob/test005/jack/E; C +[Lcom/android/jack/shrob/test005/jack/E; $VALUES +()V +valueOf(Ljava/lang/String;)Lcom/android/jack/shrob/test005/jack/E; +values()[Lcom/android/jack/shrob/test005/jack/E; +(Ljava/lang/String;I)V diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-006.txt new file mode 100644 index 00000000..27243b9e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-006.txt @@ -0,0 +1,16 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/A;: +()V +Lcom/android/jack/shrob/test005/jack/B;: +()V +Lcom/android/jack/shrob/test005/jack/C;: +()V +Lcom/android/jack/shrob/test005/jack/Annot;: +Lcom/android/jack/shrob/test005/jack/E;: +Lcom/android/jack/shrob/test005/jack/E; A +Lcom/android/jack/shrob/test005/jack/E; B +Lcom/android/jack/shrob/test005/jack/E; C +[Lcom/android/jack/shrob/test005/jack/E; $VALUES +values()[Lcom/android/jack/shrob/test005/jack/E; +()V +(Ljava/lang/String;I)V diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-007.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-007.txt new file mode 100644 index 00000000..0951da91 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-007.txt @@ -0,0 +1,2 @@ +Lcom/android/jack/shrob/test005/jack/Annot2;: +Lcom/android/jack/shrob/test005/jack/Annot;: diff --git a/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-008.txt b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-008.txt new file mode 100644 index 00000000..ede42b21 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test005/refsShrinking/expected-008.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test005/jack/E;: +Lcom/android/jack/shrob/test005/jack/E; A +Lcom/android/jack/shrob/test005/jack/E; B +Lcom/android/jack/shrob/test005/jack/E; C +[Lcom/android/jack/shrob/test005/jack/E; $VALUES +values()[Lcom/android/jack/shrob/test005/jack/E; +()V +(Ljava/lang/String;I)V diff --git a/jack-tests/tests/com/android/jack/shrob/test006/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test006/jack/A.java new file mode 100644 index 00000000..fcad0e94 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/jack/A.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test006.jack; + +public abstract class A { + void m() {} + public void m1() {} + protected void m2() {} + static public void m3() {} + public abstract void m4(); + public abstract void m5(String... args); + static void m6() {} + @SuppressWarnings("unused") + private static void m7() {} + int m8() { return 0;} +} diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001 new file mode 100644 index 00000000..c9d05fc5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + public !static *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001.mapping new file mode 100644 index 00000000..2be876c1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags001.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m1() -> m1 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002 new file mode 100644 index 00000000..ff0c9408 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + !public !static *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002.mapping new file mode 100644 index 00000000..542bff44 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m() -> m + void m2() -> m2 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003 new file mode 100644 index 00000000..919ae79b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + !private varargs *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003.mapping new file mode 100644 index 00000000..4aff1a6d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags003.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004 new file mode 100644 index 00000000..20d29ba1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + !public static *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004.mapping new file mode 100644 index 00000000..d7ecf533 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags004.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m6() -> m6 + void m7() -> m7 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005 new file mode 100644 index 00000000..b5d5090f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + !public !private *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005.mapping new file mode 100644 index 00000000..e215817c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags005.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m() -> m + void m2() -> m2 + void m6() -> m6 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006 b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006 new file mode 100644 index 00000000..af717f1a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test006.jack.* { + public !private *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006.mapping b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006.mapping new file mode 100644 index 00000000..96b4c9da --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/proguard.flags006.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void m1() -> m1 + void m3() -> m3 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..cd7582a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..35c3bb5b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..ac71a21e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-004.txt new file mode 100644 index 00000000..06ffa6c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m6() -> m6 + void m7() -> m7 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-005.txt new file mode 100644 index 00000000..9b231410 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-005.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + void m6() -> m6 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-006.txt new file mode 100644 index 00000000..118f599b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsFlattenPackage/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m3() -> m3 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..cd7582a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..35c3bb5b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..ac71a21e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-004.txt new file mode 100644 index 00000000..06ffa6c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m6() -> m6 + void m7() -> m7 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-005.txt new file mode 100644 index 00000000..9b231410 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-005.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + void m6() -> m6 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-006.txt new file mode 100644 index 00000000..118f599b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithMapping/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m3() -> m3 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..cd7582a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..35c3bb5b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..ac71a21e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-004.txt new file mode 100644 index 00000000..06ffa6c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m6() -> m6 + void m7() -> m7 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-005.txt new file mode 100644 index 00000000..9b231410 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-005.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + void m6() -> m6 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-006.txt new file mode 100644 index 00000000..118f599b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsObfuscationWithoutMapping/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m3() -> m3 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..cd7582a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..35c3bb5b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..ac71a21e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-004.txt new file mode 100644 index 00000000..06ffa6c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m6() -> m6 + void m7() -> m7 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-005.txt new file mode 100644 index 00000000..9b231410 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-005.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m() -> m + void m2() -> m2 + void m6() -> m6 + int m8() -> m8 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-006.txt new file mode 100644 index 00000000..118f599b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsRepackageClasses/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A -> com.android.jack.shrob.test006.jack.A: + void () -> + void m1() -> m1 + void m3() -> m3 + void m4() -> m4 + void m5(java.lang.String[]) -> m5 diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-001.txt new file mode 100644 index 00000000..2df34e16 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: A() +com.android.jack.shrob.test006.jack.A: void m1() +com.android.jack.shrob.test006.jack.A: void m4() +com.android.jack.shrob.test006.jack.A: void m5(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-002.txt new file mode 100644 index 00000000..8728d66d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: void m() +com.android.jack.shrob.test006.jack.A: void m2() +com.android.jack.shrob.test006.jack.A: int m8() +com.android.jack.shrob.test006.jack.A: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-003.txt new file mode 100644 index 00000000..c2bcfe1e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: void m5(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-004.txt new file mode 100644 index 00000000..f9f0c5ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-004.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: void m6() +com.android.jack.shrob.test006.jack.A: void m7() +com.android.jack.shrob.test006.jack.A: void () diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-005.txt new file mode 100644 index 00000000..2041249f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-005.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: void m() +com.android.jack.shrob.test006.jack.A: void m2() +com.android.jack.shrob.test006.jack.A: void m6() +com.android.jack.shrob.test006.jack.A: int m8() +com.android.jack.shrob.test006.jack.A: void () diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-006.txt new file mode 100644 index 00000000..452e0a49 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsSeed/expected-006.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test006.jack.A +com.android.jack.shrob.test006.jack.A: A() +com.android.jack.shrob.test006.jack.A: void m1() +com.android.jack.shrob.test006.jack.A: void m3() +com.android.jack.shrob.test006.jack.A: void m4() +com.android.jack.shrob.test006.jack.A: void m5(java.lang.String[]) diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-001.txt new file mode 100644 index 00000000..103550e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m1()V +m4()V +m5([Ljava/lang/String;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-002.txt new file mode 100644 index 00000000..dcb99658 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-002.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m()V +m2()V +m8()I diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-003.txt new file mode 100644 index 00000000..b624f881 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-003.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m5([Ljava/lang/String;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-004.txt new file mode 100644 index 00000000..822fbea6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-004.txt @@ -0,0 +1,4 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m6()V +m7()V diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-005.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-005.txt new file mode 100644 index 00000000..e2064d75 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-005.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m()V +m2()V +m6()V +m8()I diff --git a/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-006.txt b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-006.txt new file mode 100644 index 00000000..0c556458 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test006/refsShrinking/expected-006.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test006/jack/A;: +()V +m1()V +m3()V +m4()V +m5([Ljava/lang/String;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test007/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test007/jack/A.java new file mode 100644 index 00000000..3dfedea9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/jack/A.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test007.jack; + +public class A { + java.lang.Object getObject() { + return null; + } + + float getFloat() { + return 0; + } + + java.lang.Object[] getObjects() { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001 new file mode 100644 index 00000000..b0b86287 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class ** { + ** get*(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001.mapping new file mode 100644 index 00000000..a420b6ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + java.lang.Object getObject() -> getObject diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002 new file mode 100644 index 00000000..a0480199 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002 @@ -0,0 +1,3 @@ +-keep class ** { + *** get*(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002.mapping new file mode 100644 index 00000000..d0a31d46 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + java.lang.Object getObject() -> getObject + float getFloat() -> getFloat + java.lang.Object[] getObjects() -> getObjects diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003 new file mode 100644 index 00000000..43e5155d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003 @@ -0,0 +1,4 @@ +-keep class ** { + F get*(); + float get*(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003.mapping new file mode 100644 index 00000000..b01ae591 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/proguard.flags003.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + float getFloat() -> getFloat diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..9dbe09fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..12bf2671 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + float getFloat() -> getFloat + java.lang.Object getObject() -> getObject + java.lang.Object[] getObjects() -> getObjects diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..cc2ab937 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsFlattenPackage/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + float getFloat() -> getFloat diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..9dbe09fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..03e309fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject + float getFloat() -> getFloat + java.lang.Object[] getObjects() -> getObjects diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..cc2ab937 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + float getFloat() -> getFloat diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..9dbe09fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..03e309fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject + float getFloat() -> getFloat + java.lang.Object[] getObjects() -> getObjects diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..cc2ab937 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + float getFloat() -> getFloat diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..9dbe09fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..03e309fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-002.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + java.lang.Object getObject() -> getObject + float getFloat() -> getFloat + java.lang.Object[] getObjects() -> getObjects diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..cc2ab937 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsRepackageClasses/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test007.jack.A -> com.android.jack.shrob.test007.jack.A: + void () -> + float getFloat() -> getFloat diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-001.txt new file mode 100644 index 00000000..f31ce4a7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test007.jack.A +com.android.jack.shrob.test007.jack.A: java.lang.Object getObject() diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-002.txt new file mode 100644 index 00000000..e2946d54 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-002.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test007.jack.A +com.android.jack.shrob.test007.jack.A: java.lang.Object getObject() +com.android.jack.shrob.test007.jack.A: float getFloat() +com.android.jack.shrob.test007.jack.A: java.lang.Object[] getObjects() diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-003.txt new file mode 100644 index 00000000..fd1841c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test007.jack.A +com.android.jack.shrob.test007.jack.A: float getFloat() diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-001.txt new file mode 100644 index 00000000..4e29d832 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test007/jack/A;: +()V +getObject()Ljava/lang/Object; diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-002.txt new file mode 100644 index 00000000..f138021c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-002.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test007/jack/A;: +()V +getObject()Ljava/lang/Object; +getFloat()F +getObjects()[Ljava/lang/Object; diff --git a/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-003.txt new file mode 100644 index 00000000..d36bf010 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test007/refsShrinking/expected-003.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test007/jack/A;: +()V +getFloat()F diff --git a/jack-tests/tests/com/android/jack/shrob/test008/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test008/jack/A.java new file mode 100644 index 00000000..1cf37269 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/jack/A.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test008.jack; + +public class A { + void m() { + + } + + void keep() { + try { + m(); + } catch(MyException me) { + + } + } + + void keep2() { + try { + m(); + } catch(MyException me) { + System.out.println(me); + } + } + + void keep3() { + try { + m(); + } catch(MyException me) { + me.printStackTrace(); + } + } + + void keep4() throws MyException { + + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException.java b/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException.java new file mode 100644 index 00000000..45c56197 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test008.jack; + +public class MyException extends RuntimeException { + + private static final long serialVersionUID = 1L; + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException2.java b/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException2.java new file mode 100644 index 00000000..a1741a21 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/jack/MyException2.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test008.jack; + +public class MyException2 extends MyException { + + @Override + public void printStackTrace() { + super.printStackTrace(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001 new file mode 100644 index 00000000..b75e2197 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001 @@ -0,0 +1,3 @@ +-keepclasseswithmembers class ** { + void keep(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001.mapping new file mode 100644 index 00000000..2b328856 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags001.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void m() -> a + void keep() -> keep +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002 new file mode 100644 index 00000000..831b6eec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002 @@ -0,0 +1,3 @@ +-keepclasseswithmembers class ** { + void keep2(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002.mapping new file mode 100644 index 00000000..a10fae76 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void m() -> a + void keep2() -> keep2 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003 new file mode 100644 index 00000000..49dc4f85 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003 @@ -0,0 +1,3 @@ +-keepclasseswithmembers class ** { + void keep3(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003.mapping new file mode 100644 index 00000000..b8617a4a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags003.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void m() -> a + void keep3() -> keep3 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004 b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004 new file mode 100644 index 00000000..90b30dfa --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004 @@ -0,0 +1,3 @@ +-keepclasseswithmembers class ** { + void keep4(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004.mapping b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004.mapping new file mode 100644 index 00000000..c2a969ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/proguard.flags004.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void keep4() -> keep4 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..2d8154d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep() -> keep + void m() -> z__ +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..c4ce6947 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep2() -> keep2 + void m() -> z__ +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..bad6e801 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep3() -> keep3 + void m() -> z__ +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-004.txt new file mode 100644 index 00000000..1616a388 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsFlattenPackage/expected-004.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..d4eae97d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> a + void keep() -> keep +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..6fc69ba8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> a + void keep2() -> keep2 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..d9bde3b9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> a + void keep3() -> keep3 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-004.txt new file mode 100644 index 00000000..8f3f5345 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithMapping/expected-004.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..7fbbe32e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep() -> keep +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..27d85519 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep2() -> keep2 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..fb4763c8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep3() -> keep3 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-004.txt new file mode 100644 index 00000000..1616a388 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsObfuscationWithoutMapping/expected-004.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test008.jack.MyException -> com.android.jack.shrob.test008.jack.ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..5184146f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep() -> keep +com.android.jack.shrob.test008.jack.MyException -> ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..02145223 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep2() -> keep2 +com.android.jack.shrob.test008.jack.MyException -> ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..8cbab972 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void m() -> z__ + void keep3() -> keep3 +com.android.jack.shrob.test008.jack.MyException -> ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-004.txt new file mode 100644 index 00000000..1a2ccd8a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsRepackageClasses/expected-004.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test008.jack.A -> com.android.jack.shrob.test008.jack.A: + void () -> + void keep4() -> keep4 +com.android.jack.shrob.test008.jack.MyException -> ZmRlprdhvcb: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-001.txt new file mode 100644 index 00000000..23a68cec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test008.jack.A +com.android.jack.shrob.test008.jack.A: void keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-002.txt new file mode 100644 index 00000000..656a81f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test008.jack.A +com.android.jack.shrob.test008.jack.A: void keep2() diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-003.txt new file mode 100644 index 00000000..1d01bc7a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test008.jack.A +com.android.jack.shrob.test008.jack.A: void keep3() diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-004.txt new file mode 100644 index 00000000..39fa7a51 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsSeed/expected-004.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test008.jack.A +com.android.jack.shrob.test008.jack.A: void keep4() diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-001.txt new file mode 100644 index 00000000..15b84bc2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-001.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test008/jack/A;: +()V +m()V +keep()V +Lcom/android/jack/shrob/test008/jack/MyException;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-002.txt new file mode 100644 index 00000000..f549815b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-002.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test008/jack/A;: +()V +m()V +keep2()V +Lcom/android/jack/shrob/test008/jack/MyException;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-003.txt new file mode 100644 index 00000000..720b378b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-003.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test008/jack/A;: +()V +m()V +keep3()V +Lcom/android/jack/shrob/test008/jack/MyException;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-004.txt b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-004.txt new file mode 100644 index 00000000..554d540f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test008/refsShrinking/expected-004.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test008/jack/A;: +()V +keep4()V +Lcom/android/jack/shrob/test008/jack/MyException;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test009/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test009/jack/A.java new file mode 100644 index 00000000..7298f4e7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test009.jack; + +public class A { + void m(int i, boolean b, float f, long l) {} +} diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001 new file mode 100644 index 00000000..7cd4d046 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class ** { + void m(int, ...); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001.mapping new file mode 100644 index 00000000..900362c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002 new file mode 100644 index 00000000..e6ff9dfe --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002 @@ -0,0 +1,3 @@ +-keep class ** { + void m(int,...,long); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002.mapping new file mode 100644 index 00000000..900362c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags002.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003 new file mode 100644 index 00000000..fc2359ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003 @@ -0,0 +1,3 @@ +-keep class ** { + void m(int,...,long,...); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003.mapping new file mode 100644 index 00000000..900362c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/proguard.flags003.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsFlattenPackage/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..e487502b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsRepackageClasses/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test009.jack.A -> com.android.jack.shrob.test009.jack.A: + void () -> + void m(int,boolean,float,long) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-001.txt new file mode 100644 index 00000000..e002fcec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A +com.android.jack.shrob.test009.jack.A: void m(int,boolean,float,long) diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-002.txt new file mode 100644 index 00000000..e002fcec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A +com.android.jack.shrob.test009.jack.A: void m(int,boolean,float,long) diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-003.txt new file mode 100644 index 00000000..e002fcec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsSeed/expected-003.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test009.jack.A +com.android.jack.shrob.test009.jack.A: void m(int,boolean,float,long) diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-001.txt new file mode 100644 index 00000000..b348fa4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test009/jack/A;: +()V +m(IZFJ)V diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-002.txt new file mode 100644 index 00000000..b348fa4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-002.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test009/jack/A;: +()V +m(IZFJ)V diff --git a/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-003.txt new file mode 100644 index 00000000..b348fa4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test009/refsShrinking/expected-003.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test009/jack/A;: +()V +m(IZFJ)V diff --git a/jack-tests/tests/com/android/jack/shrob/test010/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test010/jack/A.java new file mode 100644 index 00000000..fb3cf8cd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/jack/A.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test010.jack; + +public class A { + T get() { + return null; + } + + void set(T t) { + + } + + void f(T t, U u) { + + } + + void set(U u) { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test010/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test010/jack/B.java new file mode 100644 index 00000000..fe0b41b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/jack/B.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test010.jack; + + +public class B { + void keep() { + A a = null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test010/jack/C.java b/jack-tests/tests/com/android/jack/shrob/test010/jack/C.java new file mode 100644 index 00000000..7f9ba0b2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/jack/C.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test010.jack; + +public class C { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001 new file mode 100644 index 00000000..85f6230c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.B { + void keep(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001.mapping new file mode 100644 index 00000000..fb83ecd3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test010.jack.B -> com.android.jack.shrob.test010.jack.B: + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002 new file mode 100644 index 00000000..009b1e7e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002 @@ -0,0 +1,4 @@ +-keep class **.A { + java.lang.Object get(); + void set(java.lang.Object); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002.mapping new file mode 100644 index 00000000..c66dc7a6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags002.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + java.lang.Object get() -> get + void set(java.lang.Object) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003 b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003 new file mode 100644 index 00000000..112ef426 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003 @@ -0,0 +1,4 @@ +-keep class **.A { + java.lang.Object get(); + void set(**.C); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003.mapping b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003.mapping new file mode 100644 index 00000000..6829e585 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/proguard.flags003.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + java.lang.Object get() -> get + void set(com.android.jack.shrob.test010.jack.C) -> set +com.android.jack.shrob.test010.jack.C -> com.android.jack.shrob.test010.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..32c91390 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test010.jack.B -> com.android.jack.shrob.test010.jack.B: + void () -> + void keep() -> keep +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..3dc5f5ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-002.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(java.lang.Object) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-003.txt new file mode 100644 index 00000000..8086f054 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsFlattenPackage/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test010.jack.C -> com.android.jack.shrob.test010.jack.P: + void () -> +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(com.android.jack.shrob.test010.jack.C) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..370e43e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test010.jack.B -> com.android.jack.shrob.test010.jack.B: + void () -> + void keep() -> keep +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..3dc5f5ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(java.lang.Object) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-003.txt new file mode 100644 index 00000000..415214df --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test010.jack.C -> com.android.jack.shrob.test010.jack.a: + void () -> +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(com.android.jack.shrob.test010.jack.C) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..32c91390 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test010.jack.B -> com.android.jack.shrob.test010.jack.B: + void () -> + void keep() -> keep +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..3dc5f5ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(java.lang.Object) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-003.txt new file mode 100644 index 00000000..8086f054 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsObfuscationWithoutMapping/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test010.jack.C -> com.android.jack.shrob.test010.jack.P: + void () -> +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(com.android.jack.shrob.test010.jack.C) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..99fb5774 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test010.jack.A -> N: + void () -> +com.android.jack.shrob.test010.jack.B -> com.android.jack.shrob.test010.jack.B: + void () -> + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..3dc5f5ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-002.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(java.lang.Object) -> set diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-003.txt new file mode 100644 index 00000000..ec41c26f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsRepackageClasses/expected-003.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test010.jack.A -> com.android.jack.shrob.test010.jack.A: + void () -> + java.lang.Object get() -> get + void set(com.android.jack.shrob.test010.jack.C) -> set +com.android.jack.shrob.test010.jack.C -> P: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-001.txt new file mode 100644 index 00000000..da5a6c99 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test010.jack.B +com.android.jack.shrob.test010.jack.B: void keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-002.txt new file mode 100644 index 00000000..9ad293b4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-002.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test010.jack.A +com.android.jack.shrob.test010.jack.A: java.lang.Object get() +com.android.jack.shrob.test010.jack.A: void set(java.lang.Object) diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-003.txt new file mode 100644 index 00000000..83be8b49 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsSeed/expected-003.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test010.jack.A +com.android.jack.shrob.test010.jack.A: java.lang.Object get() +com.android.jack.shrob.test010.jack.A: void set(com.android.jack.shrob.test010.jack.C) diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-001.txt new file mode 100644 index 00000000..fa9cb5f9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test010/jack/A;: +()V +Lcom/android/jack/shrob/test010/jack/B;: +()V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-002.txt new file mode 100644 index 00000000..9555a1c1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-002.txt @@ -0,0 +1,4 @@ +Lcom/android/jack/shrob/test010/jack/A;: +()V +get()Ljava/lang/Object; +set(Ljava/lang/Object;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-003.txt b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-003.txt new file mode 100644 index 00000000..f83c084c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test010/refsShrinking/expected-003.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test010/jack/C;: +()V +Lcom/android/jack/shrob/test010/jack/A;: +()V +get()Ljava/lang/Object; +set(Lcom/android/jack/shrob/test010/jack/C;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests.java new file mode 100644 index 00000000..42419483 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test011.dx; + +import com.android.jack.shrob.test011.jack.A; +import com.android.jack.shrob.test011.jack.B; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +public class Tests { + + @Test + @Ignore("Bug 10795183") + public void test() throws ClassNotFoundException, IllegalAccessException, + IllegalArgumentException, SecurityException, InstantiationException { + Assert.assertEquals(B.class, A.keep1().getClass()); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests2.java b/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests2.java new file mode 100644 index 00000000..716cd9b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/dx/Tests2.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test011.dx; + +import com.android.jack.shrob.test011.jack.A; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.InvocationTargetException; + +public class Tests2 { + + @Test + public void test() throws IllegalAccessException, + IllegalArgumentException, SecurityException, InstantiationException, InvocationTargetException, + NoSuchMethodException { + Assert.assertEquals(42, A.keep2()); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test011/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test011/jack/A.java new file mode 100644 index 00000000..c424112d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/jack/A.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test011.jack; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class A { + public static Object keep1() throws ClassNotFoundException, IllegalAccessException, IllegalArgumentException, + SecurityException, InstantiationException { + Class bClass = Class.forName("com.android.jack.shrob.test011.jack.B"); + Object o = bClass.newInstance(); + + try { + String cName = "com.android.jack.shrob.test011.jack.C"; + Class cClass = Class.forName(cName); + throw new RuntimeException(); + } catch (ClassNotFoundException e) { + // expected (used to verify the code has been shrunk) + } + return o; + } + + public static int keep2() throws IllegalAccessException, IllegalArgumentException, + InvocationTargetException, NoSuchMethodException, SecurityException, InstantiationException { + Object o = B.class.newInstance(); + Method m = B.class.getMethod("value"); + return ((Integer) m.invoke(o, (Object[]) null)).intValue(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test011/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test011/jack/B.java new file mode 100644 index 00000000..8cf561d0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test011.jack; + +public class B { + public int value() { + return 42; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test011/jack/C.java b/jack-tests/tests/com/android/jack/shrob/test011/jack/C.java new file mode 100644 index 00000000..173c6a8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/jack/C.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test011.jack; + +public class C { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001 new file mode 100644 index 00000000..1788d458 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test011.jack.A { + java.lang.Object keep1(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001.mapping new file mode 100644 index 00000000..20cd8cd1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags001.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + java.lang.Object keep1() -> keep1 +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.a: diff --git a/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002 new file mode 100644 index 00000000..71b1bc53 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test011.jack.A { + % keep2(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002.mapping new file mode 100644 index 00000000..b4d6638c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/proguard.flags002.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + int keep2() -> keep2 +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.a: + int value() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..18850206 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.O: + void () -> +com.android.jack.shrob.test011.jack.C -> com.android.jack.shrob.test011.jack.P: + void () -> +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + java.lang.Object keep1() -> keep1 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..5c78b004 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsFlattenPackage/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.O: + void () -> + int value() -> jnyir__ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + int keep2() -> keep2 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..4b930bf2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.a: + void () -> +com.android.jack.shrob.test011.jack.C -> com.android.jack.shrob.test011.jack.b: + void () -> +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + java.lang.Object keep1() -> keep1 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..a1dd7bc4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.a: + void () -> + int value() -> a +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + int keep2() -> keep2 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..18850206 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.O: + void () -> +com.android.jack.shrob.test011.jack.C -> com.android.jack.shrob.test011.jack.P: + void () -> +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + java.lang.Object keep1() -> keep1 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..5c78b004 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test011.jack.B -> com.android.jack.shrob.test011.jack.O: + void () -> + int value() -> jnyir__ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + int keep2() -> keep2 diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..12716733 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + java.lang.Object keep1() -> keep1 +com.android.jack.shrob.test011.jack.B -> O: + void () -> +com.android.jack.shrob.test011.jack.C -> P: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..cdf78527 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsRepackageClasses/expected-002.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test011.jack.A -> com.android.jack.shrob.test011.jack.A: + void () -> + int keep2() -> keep2 +com.android.jack.shrob.test011.jack.B -> O: + void () -> + int value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-001.txt new file mode 100644 index 00000000..5054890c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test011.jack.A +com.android.jack.shrob.test011.jack.A: java.lang.Object keep1() diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-002.txt new file mode 100644 index 00000000..9857ef12 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsSeed/expected-002.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test011.jack.A +com.android.jack.shrob.test011.jack.A: int keep2() diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-001.txt new file mode 100644 index 00000000..6480ca9f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-001.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test011/jack/C;: +()V +Lcom/android/jack/shrob/test011/jack/A;: +()V +keep1()Ljava/lang/Object; +Lcom/android/jack/shrob/test011/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-002.txt new file mode 100644 index 00000000..2d05e6f3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/refsShrinking/expected-002.txt @@ -0,0 +1,6 @@ +Lcom/android/jack/shrob/test011/jack/A;: +()V +keep2()I +Lcom/android/jack/shrob/test011/jack/B;: +()V +value()I diff --git a/jack-tests/tests/com/android/jack/shrob/test011/test.mk b/jack-tests/tests/com/android/jack/shrob/test011/test.mk new file mode 100644 index 00000000..77f13917 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := shrob/test011 +JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags001 --proguard-flags $(private_path)/../dontobfuscate.flags +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests.java +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/shrob/test011/test2.mk b/jack-tests/tests/com/android/jack/shrob/test011/test2.mk new file mode 100644 index 00000000..457cb059 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test011/test2.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := shrob/test011_2 +JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags002 +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests2.java +JACKTEST_JUNIT := com.android.jack.shrob.test011.dx.Tests2 + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/shrob/test012/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test012/jack/A.java new file mode 100644 index 00000000..643aff78 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/jack/A.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test012.jack; + +public class A { + public T m() { + return null; + } + + public void m(A a) { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test012/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test012/jack/B.java new file mode 100644 index 00000000..852ea57b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test012.jack; + +public class B { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001 new file mode 100644 index 00000000..640e2661 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test012.jack.A { + void m(com.android.jack.shrob.test012.jack.A); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001.mapping new file mode 100644 index 00000000..904d8128 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test012.jack.A -> com.android.jack.shrob.test012.jack.A: + void m(com.android.jack.shrob.test012.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..8840b684 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test012.jack.A -> com.android.jack.shrob.test012.jack.A: + void () -> + void m(com.android.jack.shrob.test012.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..8840b684 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test012.jack.A -> com.android.jack.shrob.test012.jack.A: + void () -> + void m(com.android.jack.shrob.test012.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..8840b684 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test012.jack.A -> com.android.jack.shrob.test012.jack.A: + void () -> + void m(com.android.jack.shrob.test012.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..8840b684 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test012.jack.A -> com.android.jack.shrob.test012.jack.A: + void () -> + void m(com.android.jack.shrob.test012.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsSeed/expected-001.txt new file mode 100644 index 00000000..69365058 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test012.jack.A +com.android.jack.shrob.test012.jack.A: void m(com.android.jack.shrob.test012.jack.A) diff --git a/jack-tests/tests/com/android/jack/shrob/test012/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test012/refsShrinking/expected-001.txt new file mode 100644 index 00000000..1252b8a6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test012/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test012/jack/A;: +()V +m(Lcom/android/jack/shrob/test012/jack/A;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test013/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test013/jack/A.java new file mode 100644 index 00000000..6fd335e0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/jack/A.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test013.jack; + +public class A { + public T m() { + return null; + } + + public void m(A a) { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test013/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test013/jack/B.java new file mode 100644 index 00000000..bea81e30 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test013.jack; + +public class B { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001 new file mode 100644 index 00000000..258e6bc1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test013.jack.A { + void m(com.android.jack.shrob.test013.jack.A); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001.mapping new file mode 100644 index 00000000..053e592b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/proguard.flags001.mapping @@ -0,0 +1,2 @@ +com.android.jack.shrob.test013.jack.A -> com.android.jack.shrob.test013.jack.A: + 26:26:void m(com.android.jack.shrob.test013.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..b4152a71 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsFlattenPackage/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test013.jack.A -> com.android.jack.shrob.test013.jack.A: + void () -> + void m(com.android.jack.shrob.test013.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b4152a71 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test013.jack.A -> com.android.jack.shrob.test013.jack.A: + void () -> + void m(com.android.jack.shrob.test013.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..b4152a71 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test013.jack.A -> com.android.jack.shrob.test013.jack.A: + void () -> + void m(com.android.jack.shrob.test013.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..b4152a71 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsRepackageClasses/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test013.jack.A -> com.android.jack.shrob.test013.jack.A: + void () -> + void m(com.android.jack.shrob.test013.jack.A) -> m diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsSeed/expected-001.txt new file mode 100644 index 00000000..2c9a5687 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test013.jack.A +com.android.jack.shrob.test013.jack.A: void m(com.android.jack.shrob.test013.jack.A) diff --git a/jack-tests/tests/com/android/jack/shrob/test013/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test013/refsShrinking/expected-001.txt new file mode 100644 index 00000000..e189557a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test013/refsShrinking/expected-001.txt @@ -0,0 +1,3 @@ +Lcom/android/jack/shrob/test013/jack/A;: +()V +m(Lcom/android/jack/shrob/test013/jack/A;)V diff --git a/jack-tests/tests/com/android/jack/shrob/test014/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test014/jack/A.java new file mode 100644 index 00000000..85916a74 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/jack/A.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test014.jack; + +public class A { + + int a; + + int m; + + boolean b; + + void m() { + + } + + void f() {} + + void m(int i) { + + } + + void g() { + + } + + void keep() { + a++; + m++; + b = false; + m(); + f(); + m(5); + g(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test014/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test014/jack/B.java new file mode 100644 index 00000000..b7e61cee --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/jack/B.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test014.jack; + +public class B { + void a() { + + } + + char c; + + boolean m; + + void r() { + + } + + void m() { + + } + + void l() { + + } + + void m(int i) { + + } + + void keep() { + a(); + c = 'c'; + m = true; + r(); + m(); + l(); + m(5); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001 new file mode 100644 index 00000000..4398bd80 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001 @@ -0,0 +1,9 @@ +-keep class ** { + void keep(); +} + +-keepclassmembernames class com.android.jack.shrob.test014.jack.B { + void a(); +} + +-useuniqueclassmembernames \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001.mapping new file mode 100644 index 00000000..9cede769 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/proguard.flags001.mapping @@ -0,0 +1,18 @@ +com.android.jack.shrob.test014.jack.A -> com.android.jack.shrob.test014.jack.A: + int a -> a + int m -> b + boolean b -> c + void m() -> b + void f() -> c + void m(int) -> a + void g() -> d + void keep() -> keep +com.android.jack.shrob.test014.jack.B -> com.android.jack.shrob.test014.jack.B: + char c -> d + boolean m -> e + void a() -> a + void r() -> e + void m() -> b + void l() -> f + void m(int) -> a + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..6deac50e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsFlattenPackage/expected-001.txt @@ -0,0 +1,20 @@ +com.android.jack.shrob.test014.jack.B -> com.android.jack.shrob.test014.jack.B: + char c -> p:P + boolean m -> z:N + void () -> + void a() -> a + void keep() -> keep + void l() -> y__ + void m() -> z__ + void m(int) -> z_V_ + void r() -> f__ +com.android.jack.shrob.test014.jack.A -> com.android.jack.shrob.test014.jack.A: + int a -> n:V + boolean b -> o:N + int m -> z:V + void () -> + void f() -> s__ + void g() -> t__ + void keep() -> keep + void m() -> z__ + void m(int) -> z_V_ diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..1572c2de --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,20 @@ +com.android.jack.shrob.test014.jack.B -> com.android.jack.shrob.test014.jack.B: + char c -> d + boolean m -> e + void () -> + void a() -> a + void r() -> e + void m() -> b + void l() -> f + void m(int) -> a + void keep() -> keep +com.android.jack.shrob.test014.jack.A -> com.android.jack.shrob.test014.jack.A: + int a -> a + int m -> b + boolean b -> c + void () -> + void m() -> b + void f() -> c + void m(int) -> a + void g() -> d + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..20d404c5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,20 @@ +com.android.jack.shrob.test014.jack.B -> com.android.jack.shrob.test014.jack.B: + char c -> p:P + boolean m -> z:N + void () -> + void a() -> a + void r() -> f__ + void m() -> z__ + void l() -> y__ + void m(int) -> z_V_ + void keep() -> keep +com.android.jack.shrob.test014.jack.A -> com.android.jack.shrob.test014.jack.A: + int a -> n:V + int m -> z:V + boolean b -> o:N + void () -> + void m() -> z__ + void f() -> s__ + void m(int) -> z_V_ + void g() -> t__ + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..ae7f9fab --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsRepackageClasses/expected-001.txt @@ -0,0 +1,20 @@ +com.android.jack.shrob.test014.jack.A -> com.android.jack.shrob.test014.jack.A: + int a -> n:V + int m -> z:V + boolean b -> o:N + void () -> + void m() -> z__ + void f() -> s__ + void m(int) -> z_V_ + void g() -> t__ + void keep() -> keep +com.android.jack.shrob.test014.jack.B -> com.android.jack.shrob.test014.jack.B: + char c -> p:P + boolean m -> z:N + void () -> + void a() -> a + void r() -> f__ + void m() -> z__ + void l() -> y__ + void m(int) -> z_V_ + void keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsSeed/expected-001.txt new file mode 100644 index 00000000..6df92359 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test014.jack.A +com.android.jack.shrob.test014.jack.A: void keep() +com.android.jack.shrob.test014.jack.B +com.android.jack.shrob.test014.jack.B: void a() +com.android.jack.shrob.test014.jack.B: void keep() \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test014/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test014/refsShrinking/expected-001.txt new file mode 100644 index 00000000..70820a86 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test014/refsShrinking/expected-001.txt @@ -0,0 +1,20 @@ +Lcom/android/jack/shrob/test014/jack/A;: +I a +I m +Z b +()V +m()V +f()V +m(I)V +g()V +keep()V +Lcom/android/jack/shrob/test014/jack/B;: +C c +Z m +()V +a()V +r()V +m()V +l()V +m(I)V +keep()V diff --git a/jack-tests/tests/com/android/jack/shrob/test015/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test015/jack/A.java new file mode 100644 index 00000000..470d5b84 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/jack/A.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test015.jack; + +public class A { + + + public T m() { + return null; + } + + public void m(A a) { + + } + + private interface I { + + } + + private interface J { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test015/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test015/jack/B.java new file mode 100644 index 00000000..4c78d067 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test015.jack; + +public class B { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001 new file mode 100644 index 00000000..e6dacfb3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001 @@ -0,0 +1,4 @@ +-keep,allowobfuscation class ** { + ; + ; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001.mapping new file mode 100644 index 00000000..83bfd4a9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/proguard.flags001.mapping @@ -0,0 +1,6 @@ +com.android.jack.shrob.test015.jack.A -> a.a.a.a.a.a.a: + 23:23:com.android.jack.shrob.test015.jack.B m() -> a + 28:28:void m(com.android.jack.shrob.test015.jack.A) -> a +com.android.jack.shrob.test015.jack.A$I -> a.a.a.a.a.a.a$a: +com.android.jack.shrob.test015.jack.A$J -> a.a.a.a.a.a.a$b: +com.android.jack.shrob.test015.jack.B -> a.a.a.a.a.a.b: diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..4944036a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsFlattenPackage/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test015.jack.B -> flatpackage.wnpx.O: + void () -> +com.android.jack.shrob.test015.jack.A -> flatpackage.wnpx.N: + void () -> + com.android.jack.shrob.test015.jack.B m() -> z__ + void m(com.android.jack.shrob.test015.jack.A) -> z_Ypcz/nbqfcvq/wnpx/tispc/uftu015/kbdl/B;_ +com.android.jack.shrob.test015.jack.A$I -> flatpackage.wnpx.N$V: +com.android.jack.shrob.test015.jack.A$J -> flatpackage.wnpx.N$W: diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..41f353e8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test015.jack.B -> a.a.a.a.a.a.b: + void () -> +com.android.jack.shrob.test015.jack.A -> a.a.a.a.a.a.a: + void () -> + com.android.jack.shrob.test015.jack.B m() -> a + void m(com.android.jack.shrob.test015.jack.A) -> a +com.android.jack.shrob.test015.jack.A$I -> a.a.a.a.a.a.a$a: +com.android.jack.shrob.test015.jack.A$J -> a.a.a.a.a.a.a$b: diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..5f27719f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test015.jack.B -> pcz.nbqfcvq.wnpx.gufco.hrgh015.wnpx.O: + void () -> +com.android.jack.shrob.test015.jack.A -> pcz.nbqfcvq.wnpx.gufco.hrgh015.wnpx.N: + void () -> + com.android.jack.shrob.test015.jack.B m() -> z__ + void m(com.android.jack.shrob.test015.jack.A) -> z_Ydpn/boespje/kbdl/tispc/uftu015/kbdl/B;_ +com.android.jack.shrob.test015.jack.A$I -> pcz.nbqfcvq.wnpx.gufco.hrgh015.wnpx.N$V: +com.android.jack.shrob.test015.jack.A$J -> pcz.nbqfcvq.wnpx.gufco.hrgh015.wnpx.N$W: diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..e574c24e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsRepackageClasses/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test015.jack.A -> N: + void () -> + com.android.jack.shrob.test015.jack.B m() -> z__ + void m(com.android.jack.shrob.test015.jack.A) -> z_Ydpn/boespje/kbdl/tispc/uftu015/kbdl/B;_ +com.android.jack.shrob.test015.jack.A$I -> N$V: +com.android.jack.shrob.test015.jack.A$J -> N$W: +com.android.jack.shrob.test015.jack.B -> O: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsSeed/expected-001.txt new file mode 100644 index 00000000..438444c6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsSeed/expected-001.txt @@ -0,0 +1,14 @@ +com.android.jack.shrob.test015.jack.A +com.android.jack.shrob.test015.jack.A: A() +com.android.jack.shrob.test015.jack.A: com.android.jack.shrob.test015.jack.B m() +com.android.jack.shrob.test015.jack.A: void m(com.android.jack.shrob.test015.jack.A) +com.android.jack.shrob.test015.jack.A: void () +com.android.jack.shrob.test015.jack.A: void $init() +com.android.jack.shrob.test015.jack.A$I +com.android.jack.shrob.test015.jack.A$I: void () +com.android.jack.shrob.test015.jack.A$J +com.android.jack.shrob.test015.jack.A$J: void () +com.android.jack.shrob.test015.jack.B +com.android.jack.shrob.test015.jack.B: B() +com.android.jack.shrob.test015.jack.B: void () +com.android.jack.shrob.test015.jack.B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test015/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test015/refsShrinking/expected-001.txt new file mode 100644 index 00000000..f5975034 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test015/refsShrinking/expected-001.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test015/jack/A;: +()V +m()Lcom/android/jack/shrob/test015/jack/B; +m(Lcom/android/jack/shrob/test015/jack/A;)V +Lcom/android/jack/shrob/test015/jack/A$I;: +Lcom/android/jack/shrob/test015/jack/A$J;: +Lcom/android/jack/shrob/test015/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test016/applyMapping.flags b/jack-tests/tests/com/android/jack/shrob/test016/applyMapping.flags new file mode 100644 index 00000000..cd78296c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/applyMapping.flags @@ -0,0 +1 @@ +-applymapping proguard.flags001.mapping \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test016/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test016/dx/Tests.java new file mode 100644 index 00000000..1cb6c3f9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/dx/Tests.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.dx; + +import com.android.jack.shrob.test016.jack.KeepClass; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals("com.android.jack.shrob.test016.jack.a", KeepClass.value()); + Assert.assertEquals("Lcom.android.jack.shrob.test016.jack.A;", KeepClass.value2()); + Assert.assertEquals("com/android/jack/shrob/test016/jack/a", KeepClass.value3()); + Assert.assertEquals("Lcom/android/jack/shrob/test016/jack/A;", KeepClass.value4()); + Assert.assertEquals("A", KeepClass.value5()); + Assert.assertEquals("[com.android.jack.shrob.test016.jack.A", KeepClass.value6()); + Assert.assertEquals("com.android.jack.shrob.test016.jack.a[]", KeepClass.value7()); + Assert.assertEquals("dfgdgcom.android.jack.shrob.test016.jack.A", KeepClass.value8()); + Assert.assertEquals("com.android.jack.shrob.test016.jack.Afgdg", KeepClass.value9()); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/A.java new file mode 100644 index 00000000..01146abf --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/A.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +@Annot ("com.android.jack.shrob.test016.jack.A") +@Annot2 ("Lcom.android.jack.shrob.test016.jack.A;") +@Annot3 ("com/android/jack/shrob/test016/jack/A") +@Annot4 ("Lcom/android/jack/shrob/test016/jack/A;") +@Annot5 ("A") +public class A { +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot.java new file mode 100644 index 00000000..e63549ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot { + String value() default "1"; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot2.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot2.java new file mode 100644 index 00000000..d4a51231 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot2.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot2 { + String value() default "2"; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot3.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot3.java new file mode 100644 index 00000000..27a45643 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot3.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot3 { + String value() default "3"; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot4.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot4.java new file mode 100644 index 00000000..75beebcc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot4.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot4 { + String value() default "4"; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot5.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot5.java new file mode 100644 index 00000000..697feddd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/Annot5.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Annot5 { + String value() default "5"; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/jack/KeepClass.java b/jack-tests/tests/com/android/jack/shrob/test016/jack/KeepClass.java new file mode 100644 index 00000000..3f94c3f6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/jack/KeepClass.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test016.jack; + +public class KeepClass { + public static String value() { + return "com.android.jack.shrob.test016.jack.A"; + } + + public static String value2() { + return "Lcom.android.jack.shrob.test016.jack.A;"; + } + + public static String value3() { + return "com/android/jack/shrob/test016/jack/A"; + } + + public static String value4() { + return "Lcom/android/jack/shrob/test016/jack/A;"; + } + + public static String value5() { + return "A"; + } + + public static String value6() { + return "[com.android.jack.shrob.test016.jack.A"; + } + + public static String value7() { + return "com.android.jack.shrob.test016.jack.A[]"; + } + + public static String value8() { + return "dfgdgcom.android.jack.shrob.test016.jack.A"; + } + + public static String value9() { + return "com.android.jack.shrob.test016.jack.Afgdg"; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001 new file mode 100644 index 00000000..a59c774d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001 @@ -0,0 +1,8 @@ +-dontshrink +-keepclassmembernames class ** { + ; +} +-adaptclassstrings +-keepattributes RuntimeVisibleAnnotations + +-keepnames class com.android.jack.shrob.test016.jack.KeepClass \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001.mapping new file mode 100644 index 00000000..2a96f6c6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags001.mapping @@ -0,0 +1,17 @@ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.a: +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.b: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.c: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.d: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.e: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.f: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + java.lang.String value() -> value + java.lang.String value2() -> value2 + java.lang.String value3() -> value3 + java.lang.String value4() -> value4 + java.lang.String value5() -> value5 \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002 new file mode 100644 index 00000000..b804395e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002 @@ -0,0 +1,5 @@ +-dontshrink +-adaptclassstrings +-keepattributes RuntimeVisibleAnnotations + +-keepnames class com.android.jack.shrob.test016.jack.KeepClass diff --git a/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002.mapping b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002.mapping new file mode 100644 index 00000000..64c97e9a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/proguard.flags002.mapping @@ -0,0 +1,21 @@ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.a: +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.b: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.c: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.d: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.e: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.f: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + java.lang.String value() -> a + java.lang.String value2() -> b + java.lang.String value3() -> c + java.lang.String value4() -> d + java.lang.String value5() -> e + java.lang.String value6() -> f + java.lang.String value7() -> g + java.lang.String value8() -> h + java.lang.String value9() -> i \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..46f9ec3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-001.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> value + java.lang.String value2() -> value2 + java.lang.String value3() -> value3 + java.lang.String value4() -> value4 + java.lang.String value5() -> value5 + java.lang.String value6() -> value6 + java.lang.String value7() -> value7 + java.lang.String value8() -> value8 + java.lang.String value9() -> value9 +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.N: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.Nbbch2: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.Nbbch3: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..17e022f6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsFlattenPackage/expected-002.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> jnyir__ + java.lang.String value2() -> jnyir2__ + java.lang.String value3() -> jnyir3__ + java.lang.String value4() -> jnyir4__ + java.lang.String value5() -> jnyir5__ + java.lang.String value6() -> jnyir6__ + java.lang.String value7() -> jnyir7__ + java.lang.String value8() -> jnyir8__ + java.lang.String value9() -> jnyir9__ +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.N: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.Nbbch2: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.Nbbch3: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..3eb5acf7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.b: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> value + java.lang.String value2() -> value2 + java.lang.String value3() -> value3 + java.lang.String value4() -> value4 + java.lang.String value5() -> value5 + java.lang.String value6() -> value6 + java.lang.String value7() -> value7 + java.lang.String value8() -> value8 + java.lang.String value9() -> value9 +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.e: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.f: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.a: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.c: + java.lang.String value() -> value +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.d: + java.lang.String value() -> value diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-002.txt new file mode 100644 index 00000000..cb9d1db2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithMapping/expected-002.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.b: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> a + java.lang.String value2() -> b + java.lang.String value3() -> c + java.lang.String value4() -> d + java.lang.String value5() -> e + java.lang.String value6() -> f + java.lang.String value7() -> g + java.lang.String value8() -> h + java.lang.String value9() -> i +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.e: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.f: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.a: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.c: + java.lang.String value() -> a +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.d: + java.lang.String value() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..46f9ec3d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> value + java.lang.String value2() -> value2 + java.lang.String value3() -> value3 + java.lang.String value4() -> value4 + java.lang.String value5() -> value5 + java.lang.String value6() -> value6 + java.lang.String value7() -> value7 + java.lang.String value8() -> value8 + java.lang.String value9() -> value9 +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.N: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.Nbbch2: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.Nbbch3: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..17e022f6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.Annot -> com.android.jack.shrob.test016.jack.Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> jnyir__ + java.lang.String value2() -> jnyir2__ + java.lang.String value3() -> jnyir3__ + java.lang.String value4() -> jnyir4__ + java.lang.String value5() -> jnyir5__ + java.lang.String value6() -> jnyir6__ + java.lang.String value7() -> jnyir7__ + java.lang.String value8() -> jnyir8__ + java.lang.String value9() -> jnyir9__ +com.android.jack.shrob.test016.jack.Annot4 -> com.android.jack.shrob.test016.jack.Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot5 -> com.android.jack.shrob.test016.jack.Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.A -> com.android.jack.shrob.test016.jack.N: + void () -> +com.android.jack.shrob.test016.jack.Annot2 -> com.android.jack.shrob.test016.jack.Nbbch2: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> com.android.jack.shrob.test016.jack.Nbbch3: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..b9ac8157 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-001.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.A -> N: + void () -> +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> value + java.lang.String value2() -> value2 + java.lang.String value3() -> value3 + java.lang.String value4() -> value4 + java.lang.String value5() -> value5 + java.lang.String value6() -> value6 + java.lang.String value7() -> value7 + java.lang.String value8() -> value8 + java.lang.String value9() -> value9 +com.android.jack.shrob.test016.jack.Annot5 -> Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot -> Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> Nbbch3: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot4 -> Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot2 -> Nbbch2: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..415b0ffb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsRepackageClasses/expected-002.txt @@ -0,0 +1,23 @@ +com.android.jack.shrob.test016.jack.A -> N: + void () -> +com.android.jack.shrob.test016.jack.KeepClass -> com.android.jack.shrob.test016.jack.KeepClass: + void () -> + java.lang.String value() -> jnyir__ + java.lang.String value2() -> jnyir2__ + java.lang.String value3() -> jnyir3__ + java.lang.String value4() -> jnyir4__ + java.lang.String value5() -> jnyir5__ + java.lang.String value6() -> jnyir6__ + java.lang.String value7() -> jnyir7__ + java.lang.String value8() -> jnyir8__ + java.lang.String value9() -> jnyir9__ +com.android.jack.shrob.test016.jack.Annot5 -> Nbbch5: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot -> Nbbch: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot3 -> Nbbch3: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot4 -> Nbbch4: + java.lang.String value() -> jnyir__ +com.android.jack.shrob.test016.jack.Annot2 -> Nbbch2: + java.lang.String value() -> jnyir__ diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-001.txt new file mode 100644 index 00000000..2cc3b11f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-001.txt @@ -0,0 +1,26 @@ +com.android.jack.shrob.test016.jack.A: A() +com.android.jack.shrob.test016.jack.A: void () +com.android.jack.shrob.test016.jack.A: void $init() +com.android.jack.shrob.test016.jack.Annot: java.lang.String value() +com.android.jack.shrob.test016.jack.Annot: void () +com.android.jack.shrob.test016.jack.Annot2: java.lang.String value() +com.android.jack.shrob.test016.jack.Annot2: void () +com.android.jack.shrob.test016.jack.Annot3: java.lang.String value() +com.android.jack.shrob.test016.jack.Annot3: void () +com.android.jack.shrob.test016.jack.Annot4: java.lang.String value() +com.android.jack.shrob.test016.jack.Annot4: void () +com.android.jack.shrob.test016.jack.Annot5: java.lang.String value() +com.android.jack.shrob.test016.jack.Annot5: void () +com.android.jack.shrob.test016.jack.KeepClass +com.android.jack.shrob.test016.jack.KeepClass: KeepClass() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value2() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value3() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value4() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value5() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value6() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value7() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value8() +com.android.jack.shrob.test016.jack.KeepClass: java.lang.String value9() +com.android.jack.shrob.test016.jack.KeepClass: void () +com.android.jack.shrob.test016.jack.KeepClass: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-002.txt new file mode 100644 index 00000000..aeb6f96e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsSeed/expected-002.txt @@ -0,0 +1 @@ +com.android.jack.shrob.test016.jack.KeepClass diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-001.txt new file mode 100644 index 00000000..c76091cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-001.txt @@ -0,0 +1,23 @@ +Lcom/android/jack/shrob/test016/jack/Annot2;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/KeepClass;: +()V +value()Ljava/lang/String; +value2()Ljava/lang/String; +value3()Ljava/lang/String; +value4()Ljava/lang/String; +value5()Ljava/lang/String; +value6()Ljava/lang/String; +value7()Ljava/lang/String; +value8()Ljava/lang/String; +value9()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/A;: +()V +Lcom/android/jack/shrob/test016/jack/Annot4;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot3;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot5;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot;: +value()Ljava/lang/String; diff --git a/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-002.txt new file mode 100644 index 00000000..c76091cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/refsShrinking/expected-002.txt @@ -0,0 +1,23 @@ +Lcom/android/jack/shrob/test016/jack/Annot2;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/KeepClass;: +()V +value()Ljava/lang/String; +value2()Ljava/lang/String; +value3()Ljava/lang/String; +value4()Ljava/lang/String; +value5()Ljava/lang/String; +value6()Ljava/lang/String; +value7()Ljava/lang/String; +value8()Ljava/lang/String; +value9()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/A;: +()V +Lcom/android/jack/shrob/test016/jack/Annot4;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot3;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot5;: +value()Ljava/lang/String; +Lcom/android/jack/shrob/test016/jack/Annot;: +value()Ljava/lang/String; diff --git a/jack-tests/tests/com/android/jack/shrob/test016/test.mk b/jack-tests/tests/com/android/jack/shrob/test016/test.mk new file mode 100644 index 00000000..981a3378 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test016/test.mk @@ -0,0 +1,26 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := shrob/test016 +JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags001 \ + --proguard-flags $(private_path)/applyMapping.flags +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests.java +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect.java b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect.java new file mode 100644 index 00000000..0a9ec90c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test017.jack; + +import com.android.jack.shrob.test017.jack.Reflect2.A; +import com.android.jack.shrob.test017.jack.Reflect2.B; + +public class Reflect { + + void keep() throws ClassNotFoundException { + Class.forName("com.android.jack.shrob.test017.jack.Reflect2"); + Class.forName("ClassThatDoesNotExists"); + } + + void keep2() throws NoSuchFieldException, SecurityException { + Reflect2.class.getField("fieldPublic"); + Reflect2.class.getField("fieldPrivate"); + } + + void keep3() throws NoSuchFieldException, SecurityException { + Reflect2.class.getDeclaredField("fieldPublic2"); + Reflect2.class.getDeclaredField("fieldPrivate2"); + } + + void keep4() throws SecurityException, NoSuchMethodException { + Reflect2.class.getMethod("m", new Class[]{A.class}); + Reflect2.class.getMethod("m", new Class[]{B.class}); + Reflect2.class.getMethod("methodThatDoesNotExist", new Class[]{A.class}); + } + + void keep5() throws SecurityException, NoSuchMethodException { + Reflect2.class.getDeclaredMethod("m2", new Class[]{A.class}); + Reflect2.class.getDeclaredMethod("m2", new Class[]{B.class}); + } + +// void keep6() throws SecurityException { +// AtomicIntegerFieldUpdater.newUpdater(Reflect2.class, "fieldPublic3"); +// AtomicIntegerFieldUpdater.newUpdater(Reflect2.class, "fieldLong5"); +// AtomicIntegerFieldUpdater.newUpdater(Reflect2.class, "fieldFloat"); +// } +// +// void keep7() throws SecurityException { +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldPublic"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong2"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong3"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldLong4"); +// AtomicLongFieldUpdater.newUpdater(Reflect2.class, "fieldFloat2"); +// } +// +// void keep8() throws SecurityException { +// AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Reflect2.A.class, "a"); +// AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Reflect2.A.class, "b"); +// AtomicReferenceFieldUpdater.newUpdater(Reflect2.class, Object.class, "c"); +// } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect2.java b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect2.java new file mode 100644 index 00000000..ecc61065 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect2.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test017.jack; + +public class Reflect2 extends Reflect3 { + + class A { + + } + + class B { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect3.java b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect3.java new file mode 100644 index 00000000..059c8afa --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/jack/Reflect3.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test017.jack; + +import com.android.jack.shrob.test017.jack.Reflect2.A; +import com.android.jack.shrob.test017.jack.Reflect2.B; + +public class Reflect3 { + public int fieldPublic; + + private int fieldPrivate; + + public int fieldPublic2; + + private int fieldPrivate2; + + public int fieldPublic3; + + public long fieldLong; + + private long fieldLong2; + + long fieldLong3; + + protected long fieldLong4; + + public long fieldLong5; + + public float fieldFloat; + + public float fieldFloat2; + + A a; + + B b; + + private Object c; + + private void calledMethod() { + + } + + public void m(A a) { + + } + + public void m2(A a) { + + } + + private void privateMethod(B b) { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001 new file mode 100644 index 00000000..9745e1f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test017.jack.Reflect { + void keep?(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001.mapping new file mode 100644 index 00000000..602f21a4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/proguard.flags001.mapping @@ -0,0 +1,10 @@ +com.android.jack.shrob.test017.jack.Reflect2 -> com.android.jack.shrob.test017.jack.a: +com.android.jack.shrob.test017.jack.Reflect2$A -> com.android.jack.shrob.test017.jack.b: +com.android.jack.shrob.test017.jack.Reflect2$B -> com.android.jack.shrob.test017.jack.c: +com.android.jack.shrob.test017.jack.Reflect3 -> com.android.jack.shrob.test017.jack.d: + int fieldPublic -> a + long fieldLong -> b + long fieldLong3 -> c + long fieldLong4 -> d + com.android.jack.shrob.test017.jack.Reflect2$A a -> e + 47:47:void m(com.android.jack.shrob.test017.jack.Reflect2$A) -> a \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..b06be0f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsFlattenPackage/expected-001.txt @@ -0,0 +1,14 @@ +com.android.jack.shrob.test017.jack.Reflect -> com.android.jack.shrob.test017.jack.Reflect: + void () -> + void keep2() -> keep2 + void keep3() -> keep3 + void keep4() -> keep4 + void keep5() -> keep5 +com.android.jack.shrob.test017.jack.Reflect3 -> com.android.jack.shrob.test017.jack.Frsyrph3: + int fieldPublic -> svryqDioyvp:V + void () -> + void m(com.android.jack.shrob.test017.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh017/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test017.jack.Reflect2 -> com.android.jack.shrob.test017.jack.Frsyrph2: + void () -> +com.android.jack.shrob.test017.jack.Reflect2$A -> com.android.jack.shrob.test017.jack.Frsyrph2$N: +com.android.jack.shrob.test017.jack.Reflect2$B -> com.android.jack.shrob.test017.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b393f13c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,14 @@ +com.android.jack.shrob.test017.jack.Reflect -> com.android.jack.shrob.test017.jack.Reflect: + void () -> + void keep2() -> keep2 + void keep3() -> keep3 + void keep4() -> keep4 + void keep5() -> keep5 +com.android.jack.shrob.test017.jack.Reflect3 -> com.android.jack.shrob.test017.jack.d: + int fieldPublic -> a + void () -> + void m(com.android.jack.shrob.test017.jack.Reflect2$A) -> a +com.android.jack.shrob.test017.jack.Reflect2 -> com.android.jack.shrob.test017.jack.a: + void () -> +com.android.jack.shrob.test017.jack.Reflect2$A -> com.android.jack.shrob.test017.jack.b: +com.android.jack.shrob.test017.jack.Reflect2$B -> com.android.jack.shrob.test017.jack.c: diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..b06be0f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,14 @@ +com.android.jack.shrob.test017.jack.Reflect -> com.android.jack.shrob.test017.jack.Reflect: + void () -> + void keep2() -> keep2 + void keep3() -> keep3 + void keep4() -> keep4 + void keep5() -> keep5 +com.android.jack.shrob.test017.jack.Reflect3 -> com.android.jack.shrob.test017.jack.Frsyrph3: + int fieldPublic -> svryqDioyvp:V + void () -> + void m(com.android.jack.shrob.test017.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh017/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test017.jack.Reflect2 -> com.android.jack.shrob.test017.jack.Frsyrph2: + void () -> +com.android.jack.shrob.test017.jack.Reflect2$A -> com.android.jack.shrob.test017.jack.Frsyrph2$N: +com.android.jack.shrob.test017.jack.Reflect2$B -> com.android.jack.shrob.test017.jack.Frsyrph2$O: diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..b8e2b524 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsRepackageClasses/expected-001.txt @@ -0,0 +1,14 @@ +com.android.jack.shrob.test017.jack.Reflect2 -> Frsyrph2: + void () -> +com.android.jack.shrob.test017.jack.Reflect2$A -> Frsyrph2$N: +com.android.jack.shrob.test017.jack.Reflect2$B -> Frsyrph2$O: +com.android.jack.shrob.test017.jack.Reflect3 -> Frsyrph3: + int fieldPublic -> svryqDioyvp:V + void () -> + void m(com.android.jack.shrob.test017.jack.Reflect2$A) -> z_Ypcz/nbqfcvq/wnpx/gufco/hrgh017/wnpx/Sfgmfdu2$B;_ +com.android.jack.shrob.test017.jack.Reflect -> com.android.jack.shrob.test017.jack.Reflect: + void () -> + void keep2() -> keep2 + void keep3() -> keep3 + void keep4() -> keep4 + void keep5() -> keep5 diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsSeed/expected-001.txt new file mode 100644 index 00000000..71ba05ef --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test017.jack.Reflect +com.android.jack.shrob.test017.jack.Reflect: void keep2() +com.android.jack.shrob.test017.jack.Reflect: void keep3() +com.android.jack.shrob.test017.jack.Reflect: void keep4() +com.android.jack.shrob.test017.jack.Reflect: void keep5() diff --git a/jack-tests/tests/com/android/jack/shrob/test017/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test017/refsShrinking/expected-001.txt new file mode 100644 index 00000000..9607f1b4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test017/refsShrinking/expected-001.txt @@ -0,0 +1,14 @@ +Lcom/android/jack/shrob/test017/jack/Reflect2;: +()V +Lcom/android/jack/shrob/test017/jack/Reflect2$A;: +Lcom/android/jack/shrob/test017/jack/Reflect2$B;: +Lcom/android/jack/shrob/test017/jack/Reflect3;: +I fieldPublic +()V +m(Lcom/android/jack/shrob/test017/jack/Reflect2$A;)V +Lcom/android/jack/shrob/test017/jack/Reflect;: +()V +keep2()V +keep3()V +keep4()V +keep5()V diff --git a/jack-tests/tests/com/android/jack/shrob/test018/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test018/jack/A.java new file mode 100644 index 00000000..bccc7fe1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test018.jack; + + +public class A extends B { + private static final long serialVersionUID = -2492810581766474727L; + Object m; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test018/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test018/jack/B.java new file mode 100644 index 00000000..94e0aa46 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test018.jack; + +import java.io.Serializable; + +public class B implements Serializable { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test018/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test018/proguard.flags001 new file mode 100644 index 00000000..acf00848 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/proguard.flags001 @@ -0,0 +1,4 @@ +-keep class * extends java.io.Serializable { + static final long serialVersionUID; + java.lang.Object o; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..fc808f34 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test018.jack.B -> com.android.jack.shrob.test018.jack.B: + void () -> +com.android.jack.shrob.test018.jack.A -> com.android.jack.shrob.test018.jack.A: + long serialVersionUID -> serialVersionUID + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..fc808f34 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test018.jack.B -> com.android.jack.shrob.test018.jack.B: + void () -> +com.android.jack.shrob.test018.jack.A -> com.android.jack.shrob.test018.jack.A: + long serialVersionUID -> serialVersionUID + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..fc808f34 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test018.jack.B -> com.android.jack.shrob.test018.jack.B: + void () -> +com.android.jack.shrob.test018.jack.A -> com.android.jack.shrob.test018.jack.A: + long serialVersionUID -> serialVersionUID + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..df4ffca8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test018.jack.A -> com.android.jack.shrob.test018.jack.A: + long serialVersionUID -> serialVersionUID + void () -> +com.android.jack.shrob.test018.jack.B -> com.android.jack.shrob.test018.jack.B: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsSeed/expected-001.txt new file mode 100644 index 00000000..0241b236 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsSeed/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test018.jack.A +com.android.jack.shrob.test018.jack.A: long serialVersionUID +com.android.jack.shrob.test018.jack.B diff --git a/jack-tests/tests/com/android/jack/shrob/test018/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test018/refsShrinking/expected-001.txt new file mode 100644 index 00000000..857ce625 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test018/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test018/jack/A;: +J serialVersionUID +()V +Lcom/android/jack/shrob/test018/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test019/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test019/jack/A.java new file mode 100644 index 00000000..b6f726ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test019.jack; + +public class A { + private class Inner { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test019/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test019/jack/B.java new file mode 100644 index 00000000..21bc1c2a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/jack/B.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test019.jack; + +public class B { + private static class Inner2 { + private static class Inner3 { + + } + } + + private static class C { + private static class Inner4 { + } + } + + private static class D { + + } + + private static class E { + static Object m() { + return new Object() { + + }; + } + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test019/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test019/proguard.flags001 new file mode 100644 index 00000000..69f91f5f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/proguard.flags001 @@ -0,0 +1,5 @@ +-keep class **Inner* { +} + +-keep class **$1 { +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..3721796b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsFlattenPackage/expected-001.txt @@ -0,0 +1,11 @@ +com.android.jack.shrob.test019.jack.B$Inner2 -> com.android.jack.shrob.test019.jack.B$Inner2: + void () -> +com.android.jack.shrob.test019.jack.B$Inner2$Inner3 -> com.android.jack.shrob.test019.jack.B$Inner2$Inner3: + void () -> +com.android.jack.shrob.test019.jack.B$C$Inner4 -> com.android.jack.shrob.test019.jack.B$C$Inner4: + void () -> +com.android.jack.shrob.test019.jack.B$E -> com.android.jack.shrob.test019.jack.O$R: + void () -> +com.android.jack.shrob.test019.jack.B$E$1 -> com.android.jack.shrob.test019.jack.B$E$1: + void () -> +com.android.jack.shrob.test019.jack.A$Inner -> com.android.jack.shrob.test019.jack.A$Inner: diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b108b6f0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,11 @@ +com.android.jack.shrob.test019.jack.B$Inner2 -> com.android.jack.shrob.test019.jack.B$Inner2: + void () -> +com.android.jack.shrob.test019.jack.B$Inner2$Inner3 -> com.android.jack.shrob.test019.jack.B$Inner2$Inner3: + void () -> +com.android.jack.shrob.test019.jack.B$C$Inner4 -> com.android.jack.shrob.test019.jack.B$C$Inner4: + void () -> +com.android.jack.shrob.test019.jack.B$E -> com.android.jack.shrob.test019.jack.a: + void () -> +com.android.jack.shrob.test019.jack.B$E$1 -> com.android.jack.shrob.test019.jack.B$E$1: + void () -> +com.android.jack.shrob.test019.jack.A$Inner -> com.android.jack.shrob.test019.jack.A$Inner: diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..3721796b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,11 @@ +com.android.jack.shrob.test019.jack.B$Inner2 -> com.android.jack.shrob.test019.jack.B$Inner2: + void () -> +com.android.jack.shrob.test019.jack.B$Inner2$Inner3 -> com.android.jack.shrob.test019.jack.B$Inner2$Inner3: + void () -> +com.android.jack.shrob.test019.jack.B$C$Inner4 -> com.android.jack.shrob.test019.jack.B$C$Inner4: + void () -> +com.android.jack.shrob.test019.jack.B$E -> com.android.jack.shrob.test019.jack.O$R: + void () -> +com.android.jack.shrob.test019.jack.B$E$1 -> com.android.jack.shrob.test019.jack.B$E$1: + void () -> +com.android.jack.shrob.test019.jack.A$Inner -> com.android.jack.shrob.test019.jack.A$Inner: diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..6d3f9fb8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsRepackageClasses/expected-001.txt @@ -0,0 +1,11 @@ +com.android.jack.shrob.test019.jack.A$Inner -> com.android.jack.shrob.test019.jack.A$Inner: +com.android.jack.shrob.test019.jack.B$Inner2 -> com.android.jack.shrob.test019.jack.B$Inner2: + void () -> +com.android.jack.shrob.test019.jack.B$Inner2$Inner3 -> com.android.jack.shrob.test019.jack.B$Inner2$Inner3: + void () -> +com.android.jack.shrob.test019.jack.B$C$Inner4 -> com.android.jack.shrob.test019.jack.B$C$Inner4: + void () -> +com.android.jack.shrob.test019.jack.B$E -> O$R: + void () -> +com.android.jack.shrob.test019.jack.B$E$1 -> com.android.jack.shrob.test019.jack.B$E$1: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsSeed/expected-001.txt new file mode 100644 index 00000000..40c93a0e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test019.jack.A$Inner +com.android.jack.shrob.test019.jack.B$C$Inner4 +com.android.jack.shrob.test019.jack.B$E$1 +com.android.jack.shrob.test019.jack.B$Inner2 +com.android.jack.shrob.test019.jack.B$Inner2$Inner3 diff --git a/jack-tests/tests/com/android/jack/shrob/test019/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test019/refsShrinking/expected-001.txt new file mode 100644 index 00000000..419c55ff --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test019/refsShrinking/expected-001.txt @@ -0,0 +1,11 @@ +Lcom/android/jack/shrob/test019/jack/A$Inner;: +Lcom/android/jack/shrob/test019/jack/B$Inner2;: +()V +Lcom/android/jack/shrob/test019/jack/B$Inner2$Inner3;: +()V +Lcom/android/jack/shrob/test019/jack/B$C$Inner4;: +()V +Lcom/android/jack/shrob/test019/jack/B$E;: +()V +Lcom/android/jack/shrob/test019/jack/B$E$1;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test020/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test020/dx/Tests.java new file mode 100644 index 00000000..13c272ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test020/dx/Tests.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test020.dx; + +import com.android.jack.shrob.test020.jack.Shrob020; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(5, Shrob020.test()); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test020/jack/Shrob020.java b/jack-tests/tests/com/android/jack/shrob/test020/jack/Shrob020.java new file mode 100644 index 00000000..594cdcf9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test020/jack/Shrob020.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test020.jack; + +import com.android.jack.shrob.test020.lib.Shrob20Lib; + +public class Shrob020 { + + public static int test() { + return Shrob20Lib.f; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test020/lib/Shrob20Lib.java b/jack-tests/tests/com/android/jack/shrob/test020/lib/Shrob20Lib.java new file mode 100644 index 00000000..cc01e60f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test020/lib/Shrob20Lib.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test020.lib; + +public class Shrob20Lib { + + public static int f = 5; + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test020/proguard.flags b/jack-tests/tests/com/android/jack/shrob/test020/proguard.flags new file mode 100644 index 00000000..84738f00 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test020/proguard.flags @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test020.jack.Shrob020 { +int test(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test021/jack/Shrob021.java b/jack-tests/tests/com/android/jack/shrob/test021/jack/Shrob021.java new file mode 100644 index 00000000..638a53ed --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/jack/Shrob021.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test021.jack; + +public class Shrob021 { + + public static int f; + + public static interface KeptInterface { + public void interfaceMethod(); + } + + + public int toKeep() { + KeptInterface arg = null; + arg.interfaceMethod(); + return 5; + } + + @SuppressWarnings("unused") + private void toDelete() { + KeptInterface annonymous = new KeptInterface() { + + @Override + public void interfaceMethod() { + f++; + } + }; + } + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test021/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test021/proguard.flags001 new file mode 100644 index 00000000..9abb5deb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test021.jack.Shrob021 { +int toKeep(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..268022ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test021.jack.Shrob021 -> com.android.jack.shrob.test021.jack.Shrob021: + void () -> + int toKeep() -> toKeep +com.android.jack.shrob.test021.jack.Shrob021$KeptInterface -> com.android.jack.shrob.test021.jack.Gufco021$XrdhVbhrfsnpr: + void interfaceMethod() -> vbhrfsnprZrhucq__ diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..9e8e7d87 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test021.jack.Shrob021 -> com.android.jack.shrob.test021.jack.Shrob021: + void () -> + int toKeep() -> toKeep +com.android.jack.shrob.test021.jack.Shrob021$KeptInterface -> com.android.jack.shrob.test021.jack.a: + void interfaceMethod() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..268022ad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test021.jack.Shrob021 -> com.android.jack.shrob.test021.jack.Shrob021: + void () -> + int toKeep() -> toKeep +com.android.jack.shrob.test021.jack.Shrob021$KeptInterface -> com.android.jack.shrob.test021.jack.Gufco021$XrdhVbhrfsnpr: + void interfaceMethod() -> vbhrfsnprZrhucq__ diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..cfeecbb0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test021.jack.Shrob021 -> com.android.jack.shrob.test021.jack.Shrob021: + void () -> + int toKeep() -> toKeep +com.android.jack.shrob.test021.jack.Shrob021$KeptInterface -> Gufco021$XrdhVbhrfsnpr: + void interfaceMethod() -> vbhrfsnprZrhucq__ diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsSeed/expected-001.txt new file mode 100644 index 00000000..070a3273 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test021.jack.Shrob021 +com.android.jack.shrob.test021.jack.Shrob021: int toKeep() diff --git a/jack-tests/tests/com/android/jack/shrob/test021/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test021/refsShrinking/expected-001.txt new file mode 100644 index 00000000..ac282fad --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test021/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test021/jack/Shrob021;: +()V +toKeep()I +Lcom/android/jack/shrob/test021/jack/Shrob021$KeptInterface;: +interfaceMethod()V diff --git a/jack-tests/tests/com/android/jack/shrob/test022/jack/Shrob022.java b/jack-tests/tests/com/android/jack/shrob/test022/jack/Shrob022.java new file mode 100644 index 00000000..cd1a30f5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/jack/Shrob022.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test022.jack; + +public class Shrob022 extends AbstractClass { + + @Override + public void method() { + } + + +} + +abstract class AbstractClass { + public abstract void method(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test022/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test022/proguard.flags001 new file mode 100644 index 00000000..9d1600f9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test022.jack.Shrob022 { + public void method(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..4f0bf00f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test022.jack.Shrob022 -> com.android.jack.shrob.test022.jack.Shrob022: + void () -> + void method() -> method +com.android.jack.shrob.test022.jack.AbstractClass -> com.android.jack.shrob.test022.jack.NoghfnphPyngg: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..c0c3b709 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test022.jack.Shrob022 -> com.android.jack.shrob.test022.jack.Shrob022: + void () -> + void method() -> method +com.android.jack.shrob.test022.jack.AbstractClass -> com.android.jack.shrob.test022.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..4f0bf00f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test022.jack.Shrob022 -> com.android.jack.shrob.test022.jack.Shrob022: + void () -> + void method() -> method +com.android.jack.shrob.test022.jack.AbstractClass -> com.android.jack.shrob.test022.jack.NoghfnphPyngg: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..ef95c4bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test022.jack.Shrob022 -> com.android.jack.shrob.test022.jack.Shrob022: + void () -> + void method() -> method +com.android.jack.shrob.test022.jack.AbstractClass -> NoghfnphPyngg: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsSeed/expected-001.txt new file mode 100644 index 00000000..be694314 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsSeed/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test022.jack.AbstractClass: void method() +com.android.jack.shrob.test022.jack.Shrob022 +com.android.jack.shrob.test022.jack.Shrob022: void method() diff --git a/jack-tests/tests/com/android/jack/shrob/test022/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test022/refsShrinking/expected-001.txt new file mode 100644 index 00000000..8555379a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test022/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test022/jack/Shrob022;: +()V +method()V +Lcom/android/jack/shrob/test022/jack/AbstractClass;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test023/jack/Outer.java b/jack-tests/tests/com/android/jack/shrob/test023/jack/Outer.java new file mode 100644 index 00000000..ff53c2a1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/jack/Outer.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test023.jack; + +public class Outer { + public static class Inner { + Inner() { + m(); + } + + Inner(int i) { + m2(); + } + + void m() { + + } + + void m2() { + + } + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test023/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test023/proguard.flags001 new file mode 100644 index 00000000..df47af4e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test023.jack.Outer$Inner { + Outer$Inner(int); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..18651e04 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test023.jack.Outer$Inner -> com.android.jack.shrob.test023.jack.Outer$Inner: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..c3debfc2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test023.jack.Outer$Inner -> com.android.jack.shrob.test023.jack.Outer$Inner: + void () -> + void (int) -> + void m() -> a + void m2() -> b diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..18651e04 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test023.jack.Outer$Inner -> com.android.jack.shrob.test023.jack.Outer$Inner: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..18651e04 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test023.jack.Outer$Inner -> com.android.jack.shrob.test023.jack.Outer$Inner: + void () -> + void (int) -> + void m() -> z__ + void m2() -> z2__ diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsSeed/expected-001.txt new file mode 100644 index 00000000..0f669765 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test023.jack.Outer$Inner +com.android.jack.shrob.test023.jack.Outer$Inner: Outer$Inner(int) diff --git a/jack-tests/tests/com/android/jack/shrob/test023/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test023/refsShrinking/expected-001.txt new file mode 100644 index 00000000..74279c90 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test023/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test023/jack/Outer$Inner;: +()V +(I)V +m()V +m2()V diff --git a/jack-tests/tests/com/android/jack/shrob/test024/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test024/jack/I.java new file mode 100644 index 00000000..d9b762bb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test024/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test024.jack; + +public interface I { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test024/jack/Keep.java b/jack-tests/tests/com/android/jack/shrob/test024/jack/Keep.java new file mode 100644 index 00000000..fa89e911 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test024/jack/Keep.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test024.jack; + +public class Keep { + public static boolean keep(I i) { + return i.equals(null); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test024/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test024/proguard.flags001 new file mode 100644 index 00000000..6d411504 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test024/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class com.android.jack.shrob.test024.jack.Keep { + boolean keep(com.android.jack.shrob.test024.jack.I); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test025/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test025/dx/Tests.java new file mode 100644 index 00000000..41939721 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test025.dx; + + +import com.android.jack.shrob.test025.jack.Keep; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals("foo", Keep.keep()); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test025/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test025/jack/A.java new file mode 100644 index 00000000..b6b2f462 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/jack/A.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test025.jack; + +public class A { + public static interface I extends I2 { + } + + public static interface I2 { + static String s = new StringBuilder("foo").toString(); + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test025/jack/Keep.java b/jack-tests/tests/com/android/jack/shrob/test025/jack/Keep.java new file mode 100644 index 00000000..4c9db1fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/jack/Keep.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test025.jack; + +import com.android.jack.shrob.test025.jack.A.I; + +public class Keep { + + static String m(String s) { + return s; + } + + public static String keep() { + return m(I.s); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test025/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test025/proguard.flags001 new file mode 100644 index 00000000..e032a157 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/proguard.flags001 @@ -0,0 +1,4 @@ +-dontobfuscate +-keep class **.Keep { + java.lang.String keep(); +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..0072c414 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsFlattenPackage/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test025.jack.Keep -> com.android.jack.shrob.test025.jack.Keep: + void () -> + java.lang.String keep() -> keep + java.lang.String m(java.lang.String) -> m +com.android.jack.shrob.test025.jack.A$I -> com.android.jack.shrob.test025.jack.A$I: +com.android.jack.shrob.test025.jack.A$I2 -> com.android.jack.shrob.test025.jack.A$I2: + java.lang.String s -> s + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..c297699a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test025.jack.Keep -> com.android.jack.shrob.test025.jack.Keep: + void () -> + java.lang.String m(java.lang.String) -> m + java.lang.String keep() -> keep +com.android.jack.shrob.test025.jack.A$I -> com.android.jack.shrob.test025.jack.A$I: +com.android.jack.shrob.test025.jack.A$I2 -> com.android.jack.shrob.test025.jack.A$I2: + java.lang.String s -> s + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..c297699a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test025.jack.Keep -> com.android.jack.shrob.test025.jack.Keep: + void () -> + java.lang.String m(java.lang.String) -> m + java.lang.String keep() -> keep +com.android.jack.shrob.test025.jack.A$I -> com.android.jack.shrob.test025.jack.A$I: +com.android.jack.shrob.test025.jack.A$I2 -> com.android.jack.shrob.test025.jack.A$I2: + java.lang.String s -> s + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..88d83879 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsRepackageClasses/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test025.jack.A$I -> com.android.jack.shrob.test025.jack.A$I: +com.android.jack.shrob.test025.jack.A$I2 -> com.android.jack.shrob.test025.jack.A$I2: + java.lang.String s -> s + void () -> +com.android.jack.shrob.test025.jack.Keep -> com.android.jack.shrob.test025.jack.Keep: + void () -> + java.lang.String m(java.lang.String) -> m + java.lang.String keep() -> keep diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsSeed/expected-001.txt new file mode 100644 index 00000000..1e1e026b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsSeed/expected-001.txt @@ -0,0 +1,2 @@ +com.android.jack.shrob.test025.jack.Keep +com.android.jack.shrob.test025.jack.Keep: java.lang.String keep() diff --git a/jack-tests/tests/com/android/jack/shrob/test025/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test025/refsShrinking/expected-001.txt new file mode 100644 index 00000000..42bdc82a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/refsShrinking/expected-001.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test025/jack/A$I;: +Lcom/android/jack/shrob/test025/jack/A$I2;: +Ljava/lang/String; s +()V +Lcom/android/jack/shrob/test025/jack/Keep;: +()V +m(Ljava/lang/String;)Ljava/lang/String; +keep()Ljava/lang/String; diff --git a/jack-tests/tests/com/android/jack/shrob/test025/test.mk b/jack-tests/tests/com/android/jack/shrob/test025/test.mk new file mode 100644 index 00000000..b4d43075 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test025/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := shrob/test025 +JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags001 +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests.java +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/shrob/test026/includedflags b/jack-tests/tests/com/android/jack/shrob/test026/includedflags new file mode 100644 index 00000000..8c49d57f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/includedflags @@ -0,0 +1,6 @@ +-keepclassmembers enum ** { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep enum ** \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test026/jack/Enum.java b/jack-tests/tests/com/android/jack/shrob/test026/jack/Enum.java new file mode 100644 index 00000000..e5e232f5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/jack/Enum.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test026.jack; + +public enum Enum { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test026/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test026/proguard.flags001 new file mode 100644 index 00000000..ed3ae70c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/proguard.flags001 @@ -0,0 +1 @@ +-include includedflags \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..c948d2e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test026.jack.Enum -> com.android.jack.shrob.test026.jack.Enum: + com.android.jack.shrob.test026.jack.Enum[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh026/wnpx/Rbiz; + com.android.jack.shrob.test026.jack.Enum valueOf(java.lang.String) -> valueOf + com.android.jack.shrob.test026.jack.Enum[] values() -> values + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..c64557f8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test026.jack.Enum -> com.android.jack.shrob.test026.jack.Enum: + com.android.jack.shrob.test026.jack.Enum[] $VALUES -> a + void () -> + com.android.jack.shrob.test026.jack.Enum valueOf(java.lang.String) -> valueOf + com.android.jack.shrob.test026.jack.Enum[] values() -> values diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..8de834dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test026.jack.Enum -> com.android.jack.shrob.test026.jack.Enum: + com.android.jack.shrob.test026.jack.Enum[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh026/wnpx/Rbiz; + void () -> + com.android.jack.shrob.test026.jack.Enum valueOf(java.lang.String) -> valueOf + com.android.jack.shrob.test026.jack.Enum[] values() -> values diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..8de834dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test026.jack.Enum -> com.android.jack.shrob.test026.jack.Enum: + com.android.jack.shrob.test026.jack.Enum[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh026/wnpx/Rbiz; + void () -> + com.android.jack.shrob.test026.jack.Enum valueOf(java.lang.String) -> valueOf + com.android.jack.shrob.test026.jack.Enum[] values() -> values diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsSeed/expected-001.txt new file mode 100644 index 00000000..07eeef58 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsSeed/expected-001.txt @@ -0,0 +1,3 @@ +com.android.jack.shrob.test026.jack.Enum +com.android.jack.shrob.test026.jack.Enum: com.android.jack.shrob.test026.jack.Enum[] values() +com.android.jack.shrob.test026.jack.Enum: com.android.jack.shrob.test026.jack.Enum valueOf(java.lang.String) diff --git a/jack-tests/tests/com/android/jack/shrob/test026/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test026/refsShrinking/expected-001.txt new file mode 100644 index 00000000..0df21f49 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test026/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test026/jack/Enum;: +[Lcom/android/jack/shrob/test026/jack/Enum; $VALUES +()V +valueOf(Ljava/lang/String;)Lcom/android/jack/shrob/test026/jack/Enum; +values()[Lcom/android/jack/shrob/test026/jack/Enum; diff --git a/jack-tests/tests/com/android/jack/shrob/test027/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test027/jack/A.java new file mode 100644 index 00000000..5a2cabac --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test027/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test027.jack; + +public class A { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.class b/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.class new file mode 100644 index 00000000..be729eeb Binary files /dev/null and b/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.class differ diff --git a/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.java b/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.java new file mode 100644 index 00000000..2b797c9e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test027/lib/ForName.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test027.lib; + +public class ForName { + public static Class keptMethod() throws ClassNotFoundException { + return Class.forName("com.android.jack.shrob.test027.jack.A"); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test027/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test027/proguard.flags001 new file mode 100644 index 00000000..0be8a6a8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test027/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.ForName { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test027/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test027/refsShrinking/expected-001.txt new file mode 100644 index 00000000..8525ee80 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test027/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test027/jack/A;: +()V +Lcom/android/jack/shrob/test027/lib/ForName;: +()V +keptMethod()Ljava/lang/Class; diff --git a/jack-tests/tests/com/android/jack/shrob/test028/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test028/jack/Kept.java new file mode 100644 index 00000000..269b4b20 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test028/jack/Kept.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test028.jack; + +public class Kept { + + public static int m() { + return 3; + } + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test028/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test028/proguard.flags001 new file mode 100644 index 00000000..23e2f45f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test028/proguard.flags001 @@ -0,0 +1,2 @@ +-keep class com.android.jack.shrob.test028.jack.Kept +-dontobfuscate \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test029/info.txt b/jack-tests/tests/com/android/jack/shrob/test029/info.txt new file mode 100644 index 00000000..74ed0266 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/info.txt @@ -0,0 +1,3 @@ +This test creates a complicated inheritance with generics to check that +shrink and obfuscation detect overriding methods with generics. +The goal is to check that the method get(I) in B will be kept. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/A.java new file mode 100644 index 00000000..4ed6c7eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public abstract class A extends B{ + abstract T get(U u); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/B.java new file mode 100644 index 00000000..f93cac9d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/B.java @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public abstract class B implements D { + @Override + public abstract V get(F f); + @Override + public V get(I i) { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/C.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/C.java new file mode 100644 index 00000000..4c15712e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/C.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class C extends A { + + @Override + public C get(F f) { + return null; + } + + @Override + C get(G u) { + return null; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/D.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/D.java new file mode 100644 index 00000000..017600c7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/D.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public interface D { + D get(F f); + D get(I i); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/E.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/E.java new file mode 100644 index 00000000..cf441ba9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/E.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class E { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/F.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/F.java new file mode 100644 index 00000000..af081bc8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/F.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class F { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/G.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/G.java new file mode 100644 index 00000000..7c901eda --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/G.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class G extends E { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/I.java new file mode 100644 index 00000000..a378e54f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class I { + +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test029/jack/Kept.java new file mode 100644 index 00000000..1af44c48 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/jack/Kept.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test029.jack; + +public class Kept { + void kept() { + new C().get((I) null); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001 new file mode 100644 index 00000000..b9bf8ed9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001.mapping new file mode 100644 index 00000000..11178a1c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/proguard.flags001.mapping @@ -0,0 +1,5 @@ +com.android.jack.shrob.test029.jack.I -> com.android.jack.shrob.test029.jack.a: +com.android.jack.shrob.test029.jack.B -> com.android.jack.shrob.test029.jack.b: + com.android.jack.shrob.test029.jack.B get(com.android.jack.shrob.test029.jack.I) -> a +com.android.jack.shrob.test029.jack.C -> com.android.jack.shrob.test029.jack.c: +com.android.jack.shrob.test029.jack.A -> com.android.jack.shrob.test029.jack.d: diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..4ade2d7f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsFlattenPackage/expected-001.txt @@ -0,0 +1,12 @@ +com.android.jack.shrob.test029.jack.Kept -> com.android.jack.shrob.test029.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test029.jack.I -> com.android.jack.shrob.test029.jack.V: + void () -> +com.android.jack.shrob.test029.jack.B -> com.android.jack.shrob.test029.jack.O: + void () -> + com.android.jack.shrob.test029.jack.B get(com.android.jack.shrob.test029.jack.I) -> trh_Ypcz/nbqfcvq/wnpx/gufco/hrgh029/wnpx/J;_ +com.android.jack.shrob.test029.jack.C -> com.android.jack.shrob.test029.jack.P: + void () -> +com.android.jack.shrob.test029.jack.A -> com.android.jack.shrob.test029.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b3feff8b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,12 @@ +com.android.jack.shrob.test029.jack.Kept -> com.android.jack.shrob.test029.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test029.jack.I -> com.android.jack.shrob.test029.jack.a: + void () -> +com.android.jack.shrob.test029.jack.B -> com.android.jack.shrob.test029.jack.b: + void () -> + com.android.jack.shrob.test029.jack.B get(com.android.jack.shrob.test029.jack.I) -> a +com.android.jack.shrob.test029.jack.C -> com.android.jack.shrob.test029.jack.c: + void () -> +com.android.jack.shrob.test029.jack.A -> com.android.jack.shrob.test029.jack.d: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..4ade2d7f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,12 @@ +com.android.jack.shrob.test029.jack.Kept -> com.android.jack.shrob.test029.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test029.jack.I -> com.android.jack.shrob.test029.jack.V: + void () -> +com.android.jack.shrob.test029.jack.B -> com.android.jack.shrob.test029.jack.O: + void () -> + com.android.jack.shrob.test029.jack.B get(com.android.jack.shrob.test029.jack.I) -> trh_Ypcz/nbqfcvq/wnpx/gufco/hrgh029/wnpx/J;_ +com.android.jack.shrob.test029.jack.C -> com.android.jack.shrob.test029.jack.P: + void () -> +com.android.jack.shrob.test029.jack.A -> com.android.jack.shrob.test029.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..87c84c73 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsRepackageClasses/expected-001.txt @@ -0,0 +1,12 @@ +com.android.jack.shrob.test029.jack.A -> N: + void () -> +com.android.jack.shrob.test029.jack.B -> O: + void () -> + com.android.jack.shrob.test029.jack.B get(com.android.jack.shrob.test029.jack.I) -> trh_Ypcz/nbqfcvq/wnpx/gufco/hrgh029/wnpx/J;_ +com.android.jack.shrob.test029.jack.I -> V: + void () -> +com.android.jack.shrob.test029.jack.Kept -> com.android.jack.shrob.test029.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test029.jack.C -> P: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsSeed/expected-001.txt new file mode 100644 index 00000000..0211420f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test029.jack.Kept +com.android.jack.shrob.test029.jack.Kept: Kept() +com.android.jack.shrob.test029.jack.Kept: void kept() +com.android.jack.shrob.test029.jack.Kept: void () +com.android.jack.shrob.test029.jack.Kept: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test029/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test029/refsShrinking/expected-001.txt new file mode 100644 index 00000000..785e9b8c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test029/refsShrinking/expected-001.txt @@ -0,0 +1,12 @@ +Lcom/android/jack/shrob/test029/jack/C;: +()V +Lcom/android/jack/shrob/test029/jack/Kept;: +()V +kept()V +Lcom/android/jack/shrob/test029/jack/I;: +()V +Lcom/android/jack/shrob/test029/jack/A;: +()V +Lcom/android/jack/shrob/test029/jack/B;: +get(Lcom/android/jack/shrob/test029/jack/I;)Lcom/android/jack/shrob/test029/jack/B; +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java b/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java new file mode 100644 index 00000000..da316275 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test030.dx; + + +import com.android.jack.shrob.test030.jack.B; +import com.android.jack.shrob.test030.jack.I; +import com.android.jack.shrob.test030.jack.Kept; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + I i = new B(); + Assert.assertEquals(5, Kept.kept(i)); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test030/info.txt b/jack-tests/tests/com/android/jack/shrob/test030/info.txt new file mode 100644 index 00000000..9d262e0b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/info.txt @@ -0,0 +1,2 @@ +This test creates a class with a method m() and its subclass which implements an interface that defines a method m as well. +Both m() methods should be kept. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java new file mode 100644 index 00000000..6d7b52eb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test030.jack; + +public class A { + public int m() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java new file mode 100644 index 00000000..6d01d8ce --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/B.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test030.jack; + +public class B extends A implements I { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java new file mode 100644 index 00000000..549c3f29 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test030.jack; + +public interface I { + int m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java new file mode 100644 index 00000000..36f33b73 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/jack/Kept.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test030.jack; + + +public class Kept { + public static int kept(I i) { + return i.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001 new file mode 100644 index 00000000..286c4f3f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001 @@ -0,0 +1,7 @@ +-keep class **.Kept { + *; +} + +-keep class **.B { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping new file mode 100644 index 00000000..a8740da7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/proguard.flags001.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.a: + int m() -> a +com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.b: + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..d6ac9784 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsFlattenPackage/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test030.jack.I) -> kept +com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.V: + int m() -> z__ +com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B: + void () -> +com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..5ba496e4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test030.jack.I) -> kept +com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.a: + int m() -> a +com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B: + void () -> +com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.b: + void () -> + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..d6ac9784 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test030.jack.I) -> kept +com.android.jack.shrob.test030.jack.I -> com.android.jack.shrob.test030.jack.V: + int m() -> z__ +com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B: + void () -> +com.android.jack.shrob.test030.jack.A -> com.android.jack.shrob.test030.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..33ab2e45 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsRepackageClasses/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test030.jack.A -> N: + void () -> + int m() -> z__ +com.android.jack.shrob.test030.jack.B -> com.android.jack.shrob.test030.jack.B: + void () -> +com.android.jack.shrob.test030.jack.I -> V: + int m() -> z__ +com.android.jack.shrob.test030.jack.Kept -> com.android.jack.shrob.test030.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test030.jack.I) -> kept diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt new file mode 100644 index 00000000..0f7bbb2d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsSeed/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test030.jack.A: A() +com.android.jack.shrob.test030.jack.A: int m() +com.android.jack.shrob.test030.jack.B +com.android.jack.shrob.test030.jack.B: B() +com.android.jack.shrob.test030.jack.Kept +com.android.jack.shrob.test030.jack.Kept: Kept() +com.android.jack.shrob.test030.jack.Kept: int kept(com.android.jack.shrob.test030.jack.I) diff --git a/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt new file mode 100644 index 00000000..7332628b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/refsShrinking/expected-001.txt @@ -0,0 +1,10 @@ +Lcom/android/jack/shrob/test030/jack/Kept;: +()V +kept(Lcom/android/jack/shrob/test030/jack/I;)I +Lcom/android/jack/shrob/test030/jack/I;: +m()I +Lcom/android/jack/shrob/test030/jack/A;: +()V +m()I +Lcom/android/jack/shrob/test030/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test030/test.mk b/jack-tests/tests/com/android/jack/shrob/test030/test.mk new file mode 100644 index 00000000..4bf92c66 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test030/test.mk @@ -0,0 +1,25 @@ +# Copyright (C) 2013 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +private_path:= $(call my-dir) + +include $(JACK_CLEAR_VARS) + +JACKTEST_MODULE := shrob/test030 +JACKTEST_ARGS := --proguard-flags $(private_path)/proguard.flags001 --proguard-flags $(private_path)/../dontobfuscate.flags +JACKTEST_WITHJACK_SRC := $(call all-java-files-under, $(abspath $(private_path)/jack/)) +JACKTEST_WITHDX_SRC := $(private_path)/dx/Tests.java +JACKTEST_JUNIT := com.android.jack.$(subst /,.,$(JACKTEST_MODULE)).dx.Tests + +include $(JACK_RUN_TEST) diff --git a/jack-tests/tests/com/android/jack/shrob/test031/info.txt b/jack-tests/tests/com/android/jack/shrob/test031/info.txt new file mode 100644 index 00000000..2d7086c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/info.txt @@ -0,0 +1,3 @@ +This test creates a class with a method m() and its subclass which implements an interface that defines a method m as well. +Both m() methods should be kept (see test030). +Another inheritance branch with the same methods has been added but should not be kept. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/A.java new file mode 100644 index 00000000..840504c0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public class A extends F { + public int m() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/B.java new file mode 100644 index 00000000..65c1e48d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/B.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public class B extends A implements I { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/D.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/D.java new file mode 100644 index 00000000..c0812b95 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/D.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public class D extends E implements I2 { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/E.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/E.java new file mode 100644 index 00000000..934b886b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/E.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public class E { + public int m() { + return 7; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/F.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/F.java new file mode 100644 index 00000000..af7154b8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/F.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public abstract class F { + public abstract int m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/I.java new file mode 100644 index 00000000..44308525 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public interface I { + int m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/I2.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/I2.java new file mode 100644 index 00000000..eade4669 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/I2.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + +public interface I2 { + int m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test031/jack/Kept.java new file mode 100644 index 00000000..2b55b60c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/jack/Kept.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test031.jack; + + +public class Kept { + public static int kept(I i) { + return i.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001 new file mode 100644 index 00000000..020753dd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001 @@ -0,0 +1,11 @@ +-keep class **.B { + *; +} + +-keep class **.D + +-keep class **.E + +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001.mapping new file mode 100644 index 00000000..6a76a4c2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/proguard.flags001.mapping @@ -0,0 +1,16 @@ +com.android.jack.shrob.test031.jack.E -> com.android.jack.shrob.test031.jack.E: + void () -> +com.android.jack.shrob.test031.jack.Kept -> com.android.jack.shrob.test031.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test031.jack.I) -> kept +com.android.jack.shrob.test031.jack.I -> com.android.jack.shrob.test031.jack.a: + int m() -> a +com.android.jack.shrob.test031.jack.F -> com.android.jack.shrob.test031.jack.b: + void () -> +com.android.jack.shrob.test031.jack.B -> com.android.jack.shrob.test031.jack.B: + void () -> +com.android.jack.shrob.test031.jack.D -> com.android.jack.shrob.test031.jack.D: + void () -> +com.android.jack.shrob.test031.jack.A -> com.android.jack.shrob.test031.jack.c: + void () -> + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..7570bf55 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsFlattenPackage/expected-001.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test031.jack.E -> com.android.jack.shrob.test031.jack.E: + void () -> +com.android.jack.shrob.test031.jack.Kept -> com.android.jack.shrob.test031.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test031.jack.I) -> kept +com.android.jack.shrob.test031.jack.I -> com.android.jack.shrob.test031.jack.V: + int m() -> z__ +com.android.jack.shrob.test031.jack.F -> com.android.jack.shrob.test031.jack.S: + void () -> +com.android.jack.shrob.test031.jack.B -> com.android.jack.shrob.test031.jack.B: + void () -> +com.android.jack.shrob.test031.jack.D -> com.android.jack.shrob.test031.jack.D: + void () -> +com.android.jack.shrob.test031.jack.A -> com.android.jack.shrob.test031.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..d5d1daf1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test031.jack.E -> com.android.jack.shrob.test031.jack.E: + void () -> +com.android.jack.shrob.test031.jack.Kept -> com.android.jack.shrob.test031.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test031.jack.I) -> kept +com.android.jack.shrob.test031.jack.I -> com.android.jack.shrob.test031.jack.a: + int m() -> a +com.android.jack.shrob.test031.jack.F -> com.android.jack.shrob.test031.jack.b: + void () -> +com.android.jack.shrob.test031.jack.B -> com.android.jack.shrob.test031.jack.B: + void () -> +com.android.jack.shrob.test031.jack.D -> com.android.jack.shrob.test031.jack.D: + void () -> +com.android.jack.shrob.test031.jack.A -> com.android.jack.shrob.test031.jack.c: + void () -> + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..7570bf55 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test031.jack.E -> com.android.jack.shrob.test031.jack.E: + void () -> +com.android.jack.shrob.test031.jack.Kept -> com.android.jack.shrob.test031.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test031.jack.I) -> kept +com.android.jack.shrob.test031.jack.I -> com.android.jack.shrob.test031.jack.V: + int m() -> z__ +com.android.jack.shrob.test031.jack.F -> com.android.jack.shrob.test031.jack.S: + void () -> +com.android.jack.shrob.test031.jack.B -> com.android.jack.shrob.test031.jack.B: + void () -> +com.android.jack.shrob.test031.jack.D -> com.android.jack.shrob.test031.jack.D: + void () -> +com.android.jack.shrob.test031.jack.A -> com.android.jack.shrob.test031.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..37ff366f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsRepackageClasses/expected-001.txt @@ -0,0 +1,16 @@ +com.android.jack.shrob.test031.jack.A -> N: + void () -> + int m() -> z__ +com.android.jack.shrob.test031.jack.B -> com.android.jack.shrob.test031.jack.B: + void () -> +com.android.jack.shrob.test031.jack.F -> S: + void () -> +com.android.jack.shrob.test031.jack.I -> V: + int m() -> z__ +com.android.jack.shrob.test031.jack.D -> com.android.jack.shrob.test031.jack.D: + void () -> +com.android.jack.shrob.test031.jack.Kept -> com.android.jack.shrob.test031.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test031.jack.I) -> kept +com.android.jack.shrob.test031.jack.E -> com.android.jack.shrob.test031.jack.E: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsSeed/expected-001.txt new file mode 100644 index 00000000..a3d10402 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsSeed/expected-001.txt @@ -0,0 +1,11 @@ +com.android.jack.shrob.test031.jack.A: A() +com.android.jack.shrob.test031.jack.A: int m() +com.android.jack.shrob.test031.jack.B +com.android.jack.shrob.test031.jack.B: B() +com.android.jack.shrob.test031.jack.D +com.android.jack.shrob.test031.jack.E +com.android.jack.shrob.test031.jack.F: F() +com.android.jack.shrob.test031.jack.F: int m() +com.android.jack.shrob.test031.jack.Kept +com.android.jack.shrob.test031.jack.Kept: Kept() +com.android.jack.shrob.test031.jack.Kept: int kept(com.android.jack.shrob.test031.jack.I) diff --git a/jack-tests/tests/com/android/jack/shrob/test031/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test031/refsShrinking/expected-001.txt new file mode 100644 index 00000000..d2759dbe --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test031/refsShrinking/expected-001.txt @@ -0,0 +1,16 @@ +Lcom/android/jack/shrob/test031/jack/D;: +()V +Lcom/android/jack/shrob/test031/jack/Kept;: +()V +kept(Lcom/android/jack/shrob/test031/jack/I;)I +Lcom/android/jack/shrob/test031/jack/I;: +m()I +Lcom/android/jack/shrob/test031/jack/A;: +()V +m()I +Lcom/android/jack/shrob/test031/jack/E;: +()V +Lcom/android/jack/shrob/test031/jack/B;: +()V +Lcom/android/jack/shrob/test031/jack/F;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test032/info.txt b/jack-tests/tests/com/android/jack/shrob/test032/info.txt new file mode 100644 index 00000000..333c8649 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/info.txt @@ -0,0 +1,5 @@ +This test creates a class with a method m() and its subclass which implements an interface +that defines a method m as well. +Both m() methods should be kept (see test030). +Another inheritance branch with the same methods has been added and it contains a reference +to the enclosing type of the concrete m() method in the other branch. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test032/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test032/jack/A.java new file mode 100644 index 00000000..4f8e1895 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/jack/A.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test032.jack; + +public class A { + public int m() { + return 5; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test032/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test032/jack/B.java new file mode 100644 index 00000000..9086345e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/jack/B.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test032.jack; + +public class B extends A implements I { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test032/jack/C.java b/jack-tests/tests/com/android/jack/shrob/test032/jack/C.java new file mode 100644 index 00000000..320b13da --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/jack/C.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test032.jack; + +public class C implements I { + @Override + public int m() { + B b = new B(); + return 7; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test032/jack/I.java b/jack-tests/tests/com/android/jack/shrob/test032/jack/I.java new file mode 100644 index 00000000..16eba74b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/jack/I.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test032.jack; + +public interface I { + int m(); +} diff --git a/jack-tests/tests/com/android/jack/shrob/test032/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test032/jack/Kept.java new file mode 100644 index 00000000..489696fc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/jack/Kept.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test032.jack; + + +public class Kept { + public static int kept(I i) { + C c = new C(); + return i.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001 new file mode 100644 index 00000000..ec1c2ac2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001 @@ -0,0 +1,5 @@ +-keep class **.C + +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001.mapping new file mode 100644 index 00000000..ac19db9f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/proguard.flags001.mapping @@ -0,0 +1,4 @@ +com.android.jack.shrob.test032.jack.I -> com.android.jack.shrob.test032.jack.a: +com.android.jack.shrob.test032.jack.B -> com.android.jack.shrob.test032.jack.b: +com.android.jack.shrob.test032.jack.A -> com.android.jack.shrob.test032.jack.c: + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..c99e1063 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsFlattenPackage/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test032.jack.Kept -> com.android.jack.shrob.test032.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test032.jack.I) -> kept +com.android.jack.shrob.test032.jack.I -> com.android.jack.shrob.test032.jack.V: + int m() -> z__ +com.android.jack.shrob.test032.jack.B -> com.android.jack.shrob.test032.jack.O: + void () -> +com.android.jack.shrob.test032.jack.C -> com.android.jack.shrob.test032.jack.C: + void () -> + int m() -> z__ +com.android.jack.shrob.test032.jack.A -> com.android.jack.shrob.test032.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..c9a8f93b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test032.jack.Kept -> com.android.jack.shrob.test032.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test032.jack.I) -> kept +com.android.jack.shrob.test032.jack.I -> com.android.jack.shrob.test032.jack.a: + int m() -> a +com.android.jack.shrob.test032.jack.B -> com.android.jack.shrob.test032.jack.b: + void () -> +com.android.jack.shrob.test032.jack.C -> com.android.jack.shrob.test032.jack.C: + void () -> + int m() -> a +com.android.jack.shrob.test032.jack.A -> com.android.jack.shrob.test032.jack.c: + void () -> + int m() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..c99e1063 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test032.jack.Kept -> com.android.jack.shrob.test032.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test032.jack.I) -> kept +com.android.jack.shrob.test032.jack.I -> com.android.jack.shrob.test032.jack.V: + int m() -> z__ +com.android.jack.shrob.test032.jack.B -> com.android.jack.shrob.test032.jack.O: + void () -> +com.android.jack.shrob.test032.jack.C -> com.android.jack.shrob.test032.jack.C: + void () -> + int m() -> z__ +com.android.jack.shrob.test032.jack.A -> com.android.jack.shrob.test032.jack.N: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..369f8010 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsRepackageClasses/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test032.jack.A -> N: + void () -> + int m() -> z__ +com.android.jack.shrob.test032.jack.B -> O: + void () -> +com.android.jack.shrob.test032.jack.I -> V: + int m() -> z__ +com.android.jack.shrob.test032.jack.Kept -> com.android.jack.shrob.test032.jack.Kept: + void () -> + int kept(com.android.jack.shrob.test032.jack.I) -> kept +com.android.jack.shrob.test032.jack.C -> com.android.jack.shrob.test032.jack.C: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsSeed/expected-001.txt new file mode 100644 index 00000000..1e2f4db3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsSeed/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test032.jack.C +com.android.jack.shrob.test032.jack.Kept +com.android.jack.shrob.test032.jack.Kept: Kept() +com.android.jack.shrob.test032.jack.Kept: int kept(com.android.jack.shrob.test032.jack.I) +com.android.jack.shrob.test032.jack.Kept: void () +com.android.jack.shrob.test032.jack.Kept: void $init() \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test032/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test032/refsShrinking/expected-001.txt new file mode 100644 index 00000000..6395beb4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test032/refsShrinking/expected-001.txt @@ -0,0 +1,13 @@ +Lcom/android/jack/shrob/test032/jack/C;: +()V +m()I +Lcom/android/jack/shrob/test032/jack/Kept;: +()V +kept(Lcom/android/jack/shrob/test032/jack/I;)I +Lcom/android/jack/shrob/test032/jack/I;: +m()I +Lcom/android/jack/shrob/test032/jack/A;: +()V +m()I +Lcom/android/jack/shrob/test032/jack/B;: +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test033/info.txt b/jack-tests/tests/com/android/jack/shrob/test033/info.txt new file mode 100644 index 00000000..edb28eae --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/info.txt @@ -0,0 +1,4 @@ +This tests contains two classes with the same enclosing package. +In test 001, one has a mapping entry, the other has not. +They have to stay in the same package for the test to pass. +In test 002, they are mapped to two different packages. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test033/jack/A.java new file mode 100644 index 00000000..a532adf0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test033.jack; + +public class A { + static int f = 8; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test033/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test033/jack/B.java new file mode 100644 index 00000000..3ed07a95 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test033.jack; + +public class B { + public static int m() { + return A.f; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test033/mapping.flags b/jack-tests/tests/com/android/jack/shrob/test033/mapping.flags new file mode 100644 index 00000000..67f9227f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/mapping.flags @@ -0,0 +1 @@ +com.android.jack.shrob.test033.jack.A -> p.C: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/mapping2.flags b/jack-tests/tests/com/android/jack/shrob/test033/mapping2.flags new file mode 100644 index 00000000..7b4a197a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/mapping2.flags @@ -0,0 +1,2 @@ +com.android.jack.shrob.test033.jack.A -> p.C: +com.android.jack.shrob.test033.jack.B -> p2.D: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags001 new file mode 100644 index 00000000..6388f59d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags001 @@ -0,0 +1,5 @@ +-applymapping mapping.flags + +-keep,allowobfuscation class * { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags002 b/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags002 new file mode 100644 index 00000000..c248049a --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/proguard.flags002 @@ -0,0 +1,5 @@ +-applymapping mapping2.flags + +-keep,allowobfuscation class * { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..933c0951 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test033.jack.B -> flatpackage.wnpx.O: + void () -> + int m() -> z__ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> s:V + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-002.txt new file mode 100644 index 00000000..6848edf5 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsFlattenPackage/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test033.jack.B -> p2.D: + void () -> + int m() -> z__ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> s:V + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..5d5eb214 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> a +com.android.jack.shrob.test033.jack.B -> p.O: + int m() -> a \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-002.txt new file mode 100644 index 00000000..1f6b2816 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsObfuscationWithoutMapping/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> s:V + void () -> + void () -> +com.android.jack.shrob.test033.jack.B -> p2.D: + int m() -> z__ + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..1e17c7ab --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> s:V + void () -> + void () -> +com.android.jack.shrob.test033.jack.B -> O: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-002.txt new file mode 100644 index 00000000..9c9cc066 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsRepackageClasses/expected-002.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> s:V + void () -> + void () -> +com.android.jack.shrob.test033.jack.B -> p2.D: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-001.txt new file mode 100644 index 00000000..4eb01b8e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test033.jack.A +com.android.jack.shrob.test033.jack.A: int f +com.android.jack.shrob.test033.jack.A: A() +com.android.jack.shrob.test033.jack.A: void () +com.android.jack.shrob.test033.jack.A: void $init() +com.android.jack.shrob.test033.jack.B +com.android.jack.shrob.test033.jack.B: B() +com.android.jack.shrob.test033.jack.B: int m() +com.android.jack.shrob.test033.jack.B: void () +com.android.jack.shrob.test033.jack.B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-002.txt new file mode 100644 index 00000000..4eb01b8e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsSeed/expected-002.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test033.jack.A +com.android.jack.shrob.test033.jack.A: int f +com.android.jack.shrob.test033.jack.A: A() +com.android.jack.shrob.test033.jack.A: void () +com.android.jack.shrob.test033.jack.A: void $init() +com.android.jack.shrob.test033.jack.B +com.android.jack.shrob.test033.jack.B: B() +com.android.jack.shrob.test033.jack.B: int m() +com.android.jack.shrob.test033.jack.B: void () +com.android.jack.shrob.test033.jack.B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-001.txt new file mode 100644 index 00000000..5c818383 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-001.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test033/jack/A;: +I f +()V +()V +Lcom/android/jack/shrob/test033/jack/B;: +()V +m()I diff --git a/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-002.txt b/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-002.txt new file mode 100644 index 00000000..5c818383 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test033/refsShrinking/expected-002.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test033/jack/A;: +I f +()V +()V +Lcom/android/jack/shrob/test033/jack/B;: +()V +m()I diff --git a/jack-tests/tests/com/android/jack/shrob/test034/info.txt b/jack-tests/tests/com/android/jack/shrob/test034/info.txt new file mode 100644 index 00000000..9b07ebe4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/info.txt @@ -0,0 +1,2 @@ +This tests contains two classes with the same enclosing package. One has a mapping entry, the other has not. +They have to stay in the same package for the test to pass. This time we use the -repackageclasses option. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test034/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test034/jack/A.java new file mode 100644 index 00000000..f7a841aa --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test034.jack; + +public class A { + static int f = 8; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test034/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test034/jack/B.java new file mode 100644 index 00000000..420dc46d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test034.jack; + +public class B { + public static int m() { + return A.f; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test034/mapping.flags b/jack-tests/tests/com/android/jack/shrob/test034/mapping.flags new file mode 100644 index 00000000..d805e647 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/mapping.flags @@ -0,0 +1 @@ +com.android.jack.shrob.test034.jack.A -> p.C: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test034/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test034/proguard.flags001 new file mode 100644 index 00000000..bd19413d --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/proguard.flags001 @@ -0,0 +1,7 @@ +-applymapping mapping.flags + +-repackageclasses 'p2' + +-keep,allowobfuscation class * { + *; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test034/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test034/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..4bbe7ec3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/refsFlattenPackage/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test034.jack.B -> d2.O: + void () -> + int m() -> z__ +com.android.jack.shrob.test034.jack.A -> p.C: + int f -> s:V + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test034/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test034/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..5d5eb214 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,4 @@ +com.android.jack.shrob.test033.jack.A -> p.C: + int f -> a +com.android.jack.shrob.test033.jack.B -> p.O: + int m() -> a \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test034/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test034/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..8155bbcc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/refsRepackageClasses/expected-001.txt @@ -0,0 +1,7 @@ +com.android.jack.shrob.test034.jack.A -> p.C: + int f -> s:V + void () -> + void () -> +com.android.jack.shrob.test034.jack.B -> O: + void () -> + int m() -> z__ diff --git a/jack-tests/tests/com/android/jack/shrob/test034/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test034/refsSeed/expected-001.txt new file mode 100644 index 00000000..fc576908 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/refsSeed/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test034.jack.A +com.android.jack.shrob.test034.jack.A: int f +com.android.jack.shrob.test034.jack.A: A() +com.android.jack.shrob.test034.jack.A: void () +com.android.jack.shrob.test034.jack.A: void $init() +com.android.jack.shrob.test034.jack.B +com.android.jack.shrob.test034.jack.B: B() +com.android.jack.shrob.test034.jack.B: int m() +com.android.jack.shrob.test034.jack.B: void () +com.android.jack.shrob.test034.jack.B: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test034/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test034/refsShrinking/expected-001.txt new file mode 100644 index 00000000..bebd1bf3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test034/refsShrinking/expected-001.txt @@ -0,0 +1,7 @@ +Lcom/android/jack/shrob/test034/jack/A;: +I f +()V +()V +Lcom/android/jack/shrob/test034/jack/B;: +()V +m()I diff --git a/jack-tests/tests/com/android/jack/shrob/test035/info.txt b/jack-tests/tests/com/android/jack/shrob/test035/info.txt new file mode 100644 index 00000000..4190dba2 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/info.txt @@ -0,0 +1,2 @@ +This tests contains two classes with the same enclosing package. One has a mapping entry, the other has not. +They have to stay in the same package for the test to pass. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test035/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test035/jack/A.java new file mode 100644 index 00000000..cb074a81 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/jack/A.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test035.jack; + +public class A { + static int f = 8; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test035/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test035/jack/B.java new file mode 100644 index 00000000..90ff12af --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test035.jack; + +public class B { + public static int m() { + return A.f; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test035/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test035/jack/Kept.java new file mode 100644 index 00000000..233bd680 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/jack/Kept.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test035.jack; + +public class Kept { + public int kept() { + return B.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test035/mapping.flags b/jack-tests/tests/com/android/jack/shrob/test035/mapping.flags new file mode 100644 index 00000000..4053ca36 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/mapping.flags @@ -0,0 +1 @@ +com.android.jack.shrob.test035.jack.A -> p.C: \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test035/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test035/proguard.flags001 new file mode 100644 index 00000000..72c0b4e9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/proguard.flags001 @@ -0,0 +1,5 @@ +-applymapping mapping.flags + +-keep,allowobfuscation class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test035/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test035/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..8fbf56ed --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/refsFlattenPackage/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test035.jack.Kept -> flatpackage.wnpx.Xrdh: + void () -> + int kept() -> xrdh__ +com.android.jack.shrob.test035.jack.B -> flatpackage.wnpx.O: + void () -> + int m() -> z__ +com.android.jack.shrob.test035.jack.A -> p.C: + int f -> s:V + void () -> + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test035/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test035/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..18ca5c9f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,6 @@ +com.android.jack.shrob.test035.jack.A -> p.C: + int f -> a +com.android.jack.shrob.test035.jack.B -> p.O: + int m() -> a +com.android.jack.shrob.test035.jack.Kept -> p.Xrcg: + int kept() -> a diff --git a/jack-tests/tests/com/android/jack/shrob/test035/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test035/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..159237d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/refsRepackageClasses/expected-001.txt @@ -0,0 +1,10 @@ +com.android.jack.shrob.test035.jack.A -> p.C: + int f -> s:V + void () -> + void () -> +com.android.jack.shrob.test035.jack.B -> O: + void () -> + int m() -> z__ +com.android.jack.shrob.test035.jack.Kept -> Xrdh: + void () -> + int kept() -> xrdh__ diff --git a/jack-tests/tests/com/android/jack/shrob/test035/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test035/refsSeed/expected-001.txt new file mode 100644 index 00000000..3c7eb094 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test035.jack.Kept +com.android.jack.shrob.test035.jack.Kept: Kept() +com.android.jack.shrob.test035.jack.Kept: int kept() +com.android.jack.shrob.test035.jack.Kept: void () +com.android.jack.shrob.test035.jack.Kept: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test035/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test035/refsShrinking/expected-001.txt new file mode 100644 index 00000000..542a201c --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test035/refsShrinking/expected-001.txt @@ -0,0 +1,10 @@ +Lcom/android/jack/shrob/test035/jack/Kept;: +()V +kept()I +Lcom/android/jack/shrob/test035/jack/A;: +I f +()V +()V +Lcom/android/jack/shrob/test035/jack/B;: +m()I +()V diff --git a/jack-tests/tests/com/android/jack/shrob/test036/info.txt b/jack-tests/tests/com/android/jack/shrob/test036/info.txt new file mode 100644 index 00000000..9eaad4ee --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/info.txt @@ -0,0 +1 @@ +This tests contains an enum and a switch statement. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test036/jack/E.java b/jack-tests/tests/com/android/jack/shrob/test036/jack/E.java new file mode 100644 index 00000000..51b9d8e1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/jack/E.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test036.jack; + +public enum E { + A,B,C; +} diff --git a/jack-tests/tests/com/android/jack/shrob/test036/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test036/jack/Kept.java new file mode 100644 index 00000000..324d596e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/jack/Kept.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test036.jack; + +public class Kept { + public int kept(E e) { + switch (e) { + case A: + return 1; + case B: + return 2; + case C: + return 3; + default: + return -1; + } + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test036/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test036/proguard.flags001 new file mode 100644 index 00000000..b9bf8ed9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..68f21442 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsFlattenPackage/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test036.jack.E -> com.android.jack.shrob.test036.jack.R: + com.android.jack.shrob.test036.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + void (java.lang.String,int) -> + com.android.jack.shrob.test036.jack.E[] values() -> jnyirg__ + void () -> +com.android.jack.shrob.test036.jack.Kept -> com.android.jack.shrob.test036.jack.Kept: + int[] -ESwitchesValues -> -ESwitchesValues + void () -> + int kept(com.android.jack.shrob.test036.jack.E) -> kept + int[] -getESwitchesValues() -> -getESwitchesValues diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b024d024 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test036.jack.E -> com.android.jack.shrob.test036.jack.a: + com.android.jack.shrob.test036.jack.E A -> a + com.android.jack.shrob.test036.jack.E B -> b + com.android.jack.shrob.test036.jack.E C -> c + com.android.jack.shrob.test036.jack.E[] $VALUES -> d + void (java.lang.String,int) -> + com.android.jack.shrob.test036.jack.E[] values() -> a + void () -> +com.android.jack.shrob.test036.jack.Kept -> com.android.jack.shrob.test036.jack.Kept: + int[] -ESwitchesValues -> -ESwitchesValues + void () -> + int kept(com.android.jack.shrob.test036.jack.E) -> kept + int[] -getESwitchesValues() -> -getESwitchesValues diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..68f21442 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test036.jack.E -> com.android.jack.shrob.test036.jack.R: + com.android.jack.shrob.test036.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + void (java.lang.String,int) -> + com.android.jack.shrob.test036.jack.E[] values() -> jnyirg__ + void () -> +com.android.jack.shrob.test036.jack.Kept -> com.android.jack.shrob.test036.jack.Kept: + int[] -ESwitchesValues -> -ESwitchesValues + void () -> + int kept(com.android.jack.shrob.test036.jack.E) -> kept + int[] -getESwitchesValues() -> -getESwitchesValues diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..2f704ff0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsRepackageClasses/expected-001.txt @@ -0,0 +1,13 @@ +com.android.jack.shrob.test036.jack.E -> R: + com.android.jack.shrob.test036.jack.E A -> N:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E B -> O:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E C -> P:Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + com.android.jack.shrob.test036.jack.E[] $VALUES -> $JNYIRG:[Ypcz/nbqfcvq/wnpx/gufco/hrgh036/wnpx/F; + void (java.lang.String,int) -> + com.android.jack.shrob.test036.jack.E[] values() -> jnyirg__ + void () -> +com.android.jack.shrob.test036.jack.Kept -> com.android.jack.shrob.test036.jack.Kept: + int[] -ESwitchesValues -> -ESwitchesValues + void () -> + int kept(com.android.jack.shrob.test036.jack.E) -> kept + int[] -getESwitchesValues() -> -getESwitchesValues diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsSeed/expected-001.txt new file mode 100644 index 00000000..3341709f --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test036.jack.Kept +com.android.jack.shrob.test036.jack.Kept: Kept() +com.android.jack.shrob.test036.jack.Kept: int kept(com.android.jack.shrob.test036.jack.E) +com.android.jack.shrob.test036.jack.Kept: void () +com.android.jack.shrob.test036.jack.Kept: void $init() \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test036/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test036/refsShrinking/expected-001.txt new file mode 100644 index 00000000..856fe450 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test036/refsShrinking/expected-001.txt @@ -0,0 +1,13 @@ +Lcom/android/jack/shrob/test036/jack/E;: +Lcom/android/jack/shrob/test036/jack/E; A +Lcom/android/jack/shrob/test036/jack/E; B +Lcom/android/jack/shrob/test036/jack/E; C +[Lcom/android/jack/shrob/test036/jack/E; $VALUES +(Ljava/lang/String;I)V +values()[Lcom/android/jack/shrob/test036/jack/E; +()V +Lcom/android/jack/shrob/test036/jack/Kept;: +[I -ESwitchesValues +()V +kept(Lcom/android/jack/shrob/test036/jack/E;)I +-getESwitchesValues()[I diff --git a/jack-tests/tests/com/android/jack/shrob/test037/info.txt b/jack-tests/tests/com/android/jack/shrob/test037/info.txt new file mode 100644 index 00000000..54113732 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/info.txt @@ -0,0 +1,2 @@ +This test creates a class with a static method m() and another which extends it. +A static call is made using the second one as receiver. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test037/jack/A.java b/jack-tests/tests/com/android/jack/shrob/test037/jack/A.java new file mode 100644 index 00000000..781994dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/jack/A.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test037.jack; + +public class A extends B { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test037/jack/B.java b/jack-tests/tests/com/android/jack/shrob/test037/jack/B.java new file mode 100644 index 00000000..e5894215 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/jack/B.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test037.jack; + +public class B { + public static void m() { + + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test037/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test037/jack/Kept.java new file mode 100644 index 00000000..1f2d1841 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/jack/Kept.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test037.jack; + + +public class Kept { + public static void kept() { + A.m(); + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001 new file mode 100644 index 00000000..b9bf8ed9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001.mapping b/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001.mapping new file mode 100644 index 00000000..c6b7a145 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/proguard.flags001.mapping @@ -0,0 +1,3 @@ +com.android.jack.shrob.test037.jack.B -> com.android.jack.shrob.test037.jack.a: + void m() -> a +com.android.jack.shrob.test037.jack.A -> com.android.jack.shrob.test037.jack.b: diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..d9e5b774 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsFlattenPackage/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test037.jack.Kept -> com.android.jack.shrob.test037.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test037.jack.B -> com.android.jack.shrob.test037.jack.O: + void () -> + void m() -> z__ +com.android.jack.shrob.test037.jack.A -> com.android.jack.shrob.test037.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..b4e8d032 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test037.jack.Kept -> com.android.jack.shrob.test037.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test037.jack.B -> com.android.jack.shrob.test037.jack.a: + void () -> + void m() -> a +com.android.jack.shrob.test037.jack.A -> com.android.jack.shrob.test037.jack.b: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..d9e5b774 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test037.jack.Kept -> com.android.jack.shrob.test037.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test037.jack.B -> com.android.jack.shrob.test037.jack.O: + void () -> + void m() -> z__ +com.android.jack.shrob.test037.jack.A -> com.android.jack.shrob.test037.jack.N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..585221bf --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsRepackageClasses/expected-001.txt @@ -0,0 +1,8 @@ +com.android.jack.shrob.test037.jack.Kept -> com.android.jack.shrob.test037.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test037.jack.B -> O: + void () -> + void m() -> z__ +com.android.jack.shrob.test037.jack.A -> N: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsSeed/expected-001.txt new file mode 100644 index 00000000..62d9cf05 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test037.jack.Kept +com.android.jack.shrob.test037.jack.Kept: Kept() +com.android.jack.shrob.test037.jack.Kept: void kept() +com.android.jack.shrob.test037.jack.Kept: void () +com.android.jack.shrob.test037.jack.Kept: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test037/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test037/refsShrinking/expected-001.txt new file mode 100644 index 00000000..eae25bbb --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test037/refsShrinking/expected-001.txt @@ -0,0 +1,8 @@ +Lcom/android/jack/shrob/test037/jack/Kept;: +()V +kept()V +Lcom/android/jack/shrob/test037/jack/A;: +()V +Lcom/android/jack/shrob/test037/jack/B;: +()V +m()V \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test038/info.txt b/jack-tests/tests/com/android/jack/shrob/test038/info.txt new file mode 100644 index 00000000..65585c22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/info.txt @@ -0,0 +1 @@ +This test contains an array declaration with no other reference to the leaf type. \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test038/jack/Element.java b/jack-tests/tests/com/android/jack/shrob/test038/jack/Element.java new file mode 100644 index 00000000..f9ac6abd --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/jack/Element.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test038.jack; + +public class Element { +} diff --git a/jack-tests/tests/com/android/jack/shrob/test038/jack/Kept.java b/jack-tests/tests/com/android/jack/shrob/test038/jack/Kept.java new file mode 100644 index 00000000..b79f3d0e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/jack/Kept.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.shrob.test038.jack; + +public class Kept { + public void kept() { + Element[] array; + } +} diff --git a/jack-tests/tests/com/android/jack/shrob/test038/proguard.flags001 b/jack-tests/tests/com/android/jack/shrob/test038/proguard.flags001 new file mode 100644 index 00000000..b9bf8ed9 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/proguard.flags001 @@ -0,0 +1,3 @@ +-keep class **.Kept { + *; +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsFlattenPackage/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsFlattenPackage/expected-001.txt new file mode 100644 index 00000000..5250acef --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsFlattenPackage/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test038.jack.Kept -> com.android.jack.shrob.test038.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test038.jack.Element -> com.android.jack.shrob.test038.jack.Ryrzrbh: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithMapping/expected-001.txt new file mode 100644 index 00000000..db5c11ea --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test038.jack.Kept -> com.android.jack.shrob.test038.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test038.jack.Element -> com.android.jack.shrob.test038.jack.a: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithoutMapping/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithoutMapping/expected-001.txt new file mode 100644 index 00000000..5250acef --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsObfuscationWithoutMapping/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test038.jack.Kept -> com.android.jack.shrob.test038.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test038.jack.Element -> com.android.jack.shrob.test038.jack.Ryrzrbh: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsRepackageClasses/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsRepackageClasses/expected-001.txt new file mode 100644 index 00000000..9e936061 --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsRepackageClasses/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test038.jack.Kept -> com.android.jack.shrob.test038.jack.Kept: + void () -> + void kept() -> kept +com.android.jack.shrob.test038.jack.Element -> Ryrzrbh: + void () -> diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsSeed/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsSeed/expected-001.txt new file mode 100644 index 00000000..581d8c9b --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsSeed/expected-001.txt @@ -0,0 +1,5 @@ +com.android.jack.shrob.test038.jack.Kept +com.android.jack.shrob.test038.jack.Kept: Kept() +com.android.jack.shrob.test038.jack.Kept: void kept() +com.android.jack.shrob.test038.jack.Kept: void () +com.android.jack.shrob.test038.jack.Kept: void $init() diff --git a/jack-tests/tests/com/android/jack/shrob/test038/refsShrinking/expected-001.txt b/jack-tests/tests/com/android/jack/shrob/test038/refsShrinking/expected-001.txt new file mode 100644 index 00000000..82427b0e --- /dev/null +++ b/jack-tests/tests/com/android/jack/shrob/test038/refsShrinking/expected-001.txt @@ -0,0 +1,5 @@ +Lcom/android/jack/shrob/test038/jack/Kept;: +()V +kept()V +Lcom/android/jack/shrob/test038/jack/Element;: +()V diff --git a/jack-tests/tests/com/android/jack/string/concat001/dx/Tests.java b/jack-tests/tests/com/android/jack/string/concat001/dx/Tests.java new file mode 100644 index 00000000..8e704da8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/string/concat001/dx/Tests.java @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.string.concat001.dx; + +import com.android.jack.string.concat001.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about string concatenation. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals("test0" + "test1", Data.test001("test0", "test1")); + Assert.assertEquals(null + "test1", Data.test001(null, "test1")); + Assert.assertEquals("test0" + null, Data.test001("test0", null)); + } + + @Test + public void test2() { + Object object = new String[] {"test2"}; + Assert.assertEquals("test0" + object, Data.test002("test0", object)); + Assert.assertEquals(((String)null) + object, Data.test002(null, object)); + Assert.assertEquals("test0" + null, Data.test002("test0", null)); + Assert.assertEquals(((String)null) + null, Data.test002(null, null)); + } + + @Test + public void test3() { + Assert.assertEquals("test0" + "literal1", Data.test003("test0")); + Assert.assertEquals(null + "literal1", Data.test003(null)); + } + + @Test + public void test4() { + Object object = new String[] {"test2"}; + Assert.assertEquals(object + "literal2", Data.test004(object)); + Assert.assertEquals("test1" + "literal2", Data.test004("test1")); + Assert.assertEquals(null + "literal2", Data.test004(null)); + } + + @Test + public void test5() { + Object object = new String[] {"test2"}; + Assert.assertEquals("test0" + object + "literal3", Data.test005("test0", object)); + Assert.assertEquals("test0" + null + "literal3", Data.test005("test0", null)); + Assert.assertEquals(((String)null) + object + "literal3", Data.test005(null, object)); + Assert.assertEquals(((String)null) + null + "literal3", Data.test005(null, null)); + } + + @Test + public void test6() { + Object a = new String[] {"test2"}; + Object b = new String[] {"5test5"}; + Assert.assertEquals("literal4" + a + b, Data.test006(a, b)); + } + + @Test + public void test7() { + Object a = new String[] {"test2"}; + Object b = new String[] {"5test5"}; + Assert.assertEquals( a + "literal5" + b, Data.test007(a, b)); + } + + @Test + public void test8() { + String a = "A"; + String b = "B"; + Assert.assertEquals( a + b, Data.test008(a, b)); + } + + @Test + public void test9() { + String a = "A"; + String b = "B"; + Assert.assertEquals( a + (b + "literal6"), Data.test009(a, b)); + } + @Test + public void test10() { + String a = "A"; + String b = "B"; + Assert.assertEquals((a + b) + "literal7", Data.test010(a, b)); + } + + @Test + public void test11() { + String a = "A"; + String b = "B"; + Assert.assertEquals( a + b + "literal8", Data.test011(a, b)); + } + + @Test + public void test12() { + String a = "A"; + String b = "B"; + CharSequence c = "C"; + Assert.assertEquals( a + b + c, Data.test012(a, b, c)); + } +} diff --git a/jack-tests/tests/com/android/jack/string/concat001/jack/Data.java b/jack-tests/tests/com/android/jack/string/concat001/jack/Data.java new file mode 100644 index 00000000..5ba5c743 --- /dev/null +++ b/jack-tests/tests/com/android/jack/string/concat001/jack/Data.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.string.concat001.jack; + +public class Data { + + public static String test001(String a, String b) { + return a + b; + } + + public static String test002(String a, Object b) { + return a + b; + } + + public static String test003(String a) { + return a + "literal1"; + } + + public static String test004(Object a) { + return a + "literal2"; + } + + public static String test005(String a, Object b) { + return a + b + "literal3"; + } + + public static String test006(Object a, Object b) { + return "literal4" + a + b; + } + + public static String test007(Object a, Object b) { + return a + "literal5" + b; + } + + public static String test008(String a, String b) { + return a += b; + } + + public static String test009(String a, Object b) { + return a + (b + "literal6"); + } + + public static String test010(String a, Object b) { + return (a + b) + "literal7"; + } + + public static String test011(String a, Object b) { + return a += b + "literal8"; + } + + public static String test012(String a, String b, CharSequence c) { + return a += b + c; + } +} diff --git a/jack-tests/tests/com/android/jack/string/concat002/dx/Tests.java b/jack-tests/tests/com/android/jack/string/concat002/dx/Tests.java new file mode 100644 index 00000000..f14ab7ec --- /dev/null +++ b/jack-tests/tests/com/android/jack/string/concat002/dx/Tests.java @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.string.concat002.dx; + +import com.android.jack.string.concat002.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test1() { + String a = "abcd"; + boolean b = false; + Assert.assertEquals(a + b, Data.test001(a, b)); + } + + @Test + public void test2() { + String a = "abcd"; + byte b = 127; + Assert.assertEquals(a + b, Data.test002(a, b)); + } + + @Test + public void test3() { + String a = "abcd"; + char b = 'e'; + Assert.assertEquals(a + b, Data.test003(a, b)); + } + + @Test + public void test4() { + String a = "abcd"; + short b = -48; + Assert.assertEquals(a + b, Data.test004(a, b)); + } + + @Test + public void test5() { + String a = "abcd"; + int b = 157895; + Assert.assertEquals(a + b, Data.test005(a, b)); + } + + @Test + public void test6() { + String a = "abcd"; + long b = 12345678901l; + Assert.assertEquals(a + b, Data.test006(a, b)); + } + + @Test + public void test7() { + String a = "abcd"; + float b = 158.157f; + Assert.assertEquals(a + b, Data.test007(a, b)); + } + + @Test + public void test8() { + String a = "abcd"; + double b = 1570.1598; + Assert.assertEquals(a + b, Data.test008(a, b)); + } + + @Test + public void test9() { + boolean a = true; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test009(a, b)); + } + + @Test + public void test10() { + byte a = -123; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test010(a, b)); + } + + @Test + public void test11() { + char a = 'z'; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test011(a, b)); + } + + @Test + public void test12() { + short a = -12783; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test012(a, b)); + } + + @Test + public void test13() { + int a = -12345678; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test013(a, b)); + } + + @Test + public void test14() { + long a = -123456789012l; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test014(a, b)); + } + + @Test + public void test15() { + float a = -123.12587f; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test015(a, b)); + } + + @Test + public void test16() { + double a = -123.125789; + String b = "abcd"; + Assert.assertEquals(a + b, Data.test016(a, b)); + } +} diff --git a/jack-tests/tests/com/android/jack/string/concat002/jack/Data.java b/jack-tests/tests/com/android/jack/string/concat002/jack/Data.java new file mode 100644 index 00000000..3216a877 --- /dev/null +++ b/jack-tests/tests/com/android/jack/string/concat002/jack/Data.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.string.concat002.jack; + +public class Data { + + public static String test001(String a, boolean b) { + return a + b; + } + + public static String test002(String a, byte b) { + return a + b; + } + + public static String test003(String a, char b) { + return a + b; + } + + public static String test004(String a, short b) { + return a + b; + } + + public static String test005(String a, int b) { + return a + b; + } + + public static String test006(String a, long b) { + return a + b; + } + + public static String test007(String a, float b) { + return a + b; + } + + public static String test008(String a, double b) { + return a + b; + } + + public static String test009(boolean a, String b) { + return a + b; + } + + public static String test010(byte a, String b) { + return a + b; + } + + public static String test011(char a, String b) { + return a + b; + } + + public static String test012(short a, String b) { + return a + b; + } + + public static String test013(int a, String b) { + return a + b; + } + + public static String test014(long a, String b) { + return a + b; + } + + public static String test015(float a, String b) { + return a + b; + } + + public static String test016(double a, String b) { + return a + b; + } +} diff --git a/jack-tests/tests/com/android/jack/string001/jack/Strings.java b/jack-tests/tests/com/android/jack/string001/jack/Strings.java new file mode 100644 index 00000000..76abb8f7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/string001/jack/Strings.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.string001.jack; + +public class Strings { + + public void newString() { + String str = new String(); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test001/dx/Tests.java new file mode 100644 index 00000000..24c18b25 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test001/dx/Tests.java @@ -0,0 +1,174 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.switchstatement.test001.jack.Switches001; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Switches001.switch001(1)); + Assert.assertEquals(2, Switches001.switch001(2)); + Assert.assertEquals(3, Switches001.switch001(3)); + } + + @Test + public void testNoDefault() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch003(-1)); + Assert.assertEquals(2, t.switch003(15)); + Assert.assertEquals(-1, t.switch003(2)); + } + + @Test + public void testNested() { + Switches001 t = new Switches001(); + Assert.assertEquals(11, t.switch004(1, 10)); + Assert.assertEquals(12, t.switch004(1, 20)); + Assert.assertEquals(21, t.switch004(2, 10)); + Assert.assertEquals(22, t.switch004(2, 20)); + Assert.assertEquals(-1, t.switch004(2, 30)); + } + + @Test + public void testWithBlocks() { + Switches001 t = new Switches001(); + Assert.assertEquals(2, t.switch005(1)); + Assert.assertEquals(4, t.switch005(3)); + Assert.assertEquals(-1, t.switch005(5)); + } + + @Test + public void testN1() { + Switches001 t = new Switches001(); + Assert.assertEquals(2, t.switch002(-1)); + + Assert.assertEquals(-1, t.switch002(9)); + Assert.assertEquals(20, t.switch002(10)); + Assert.assertEquals(-1, t.switch002(11)); + + Assert.assertEquals(-1, t.switch002(14)); + Assert.assertEquals(20, t.switch002(15)); + Assert.assertEquals(-1, t.switch002(16)); + } + + @Test + public void testB1() { + Switches001 t = new Switches001(); + Assert.assertEquals(-1, t.switch002(Integer.MAX_VALUE)); + } + + @Test + public void testB2() { + Switches001 t = new Switches001(); + Assert.assertEquals(-1, t.switch002(Integer.MIN_VALUE)); + } + + @Test + public void unorderedSwitch() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch006(1)); + Assert.assertEquals(2, t.switch006(2)); + Assert.assertEquals(3, t.switch006(3)); + } + + @Test + public void switchWithFallThrough() { + Switches001 t = new Switches001(); + Assert.assertEquals(4, t.switch007(1)); + Assert.assertEquals(2, t.switch007(2)); + Assert.assertEquals(4, t.switch007(3)); + } + + @Test + public void nestedSwitch() { + Switches001 t = new Switches001(); + Assert.assertEquals(6, t.switch008(1)); + Assert.assertEquals(2, t.switch008(2)); + Assert.assertEquals(8, t.switch008(3)); + } + + @Test + public void switchWithChar() { + Switches001 t = new Switches001(); + Assert.assertTrue('#' == t.switch009('#')); + Assert.assertTrue('A' == t.switch009('A')); + } + + @Test + public void switchWithByteShort() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch010((byte)1)); + Assert.assertEquals(2, t.switch010((byte)2)); + } + + @Test + public void switchWithOnlyDefault() { + Switches001 t = new Switches001(); + Assert.assertEquals(2, t.switch011(1)); + Assert.assertEquals(2, t.switch011(2)); + } + + @Test + public void switchWithNoCases() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch012(1)); + Assert.assertEquals(1, t.switch012(2)); + } + + @Test + public void switchWithOnlyDefault2() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch013(1)); + Assert.assertEquals(1, t.switch013(2)); + } + + @Test + public void switchWithOnlyDefault3() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch014(1)); + Assert.assertEquals(1, t.switch015(2)); + } + + @Test + public void switchWithOnlyDefaultWithSwitch() { + Switches001 t = new Switches001(); + Assert.assertEquals(1, t.switch016(1)); + Assert.assertEquals(2, t.switch016(2)); + } + + @Test + public void switchWithOnlyDefaultWithLoopBreak() { + Switches001 t = new Switches001(); + Assert.assertEquals(6, t.switch017(1)); + Assert.assertEquals(2, t.switch017(2)); + } + + @Test + public void switchWithOnlyDefaultWithLabledBreak() { + Switches001 t = new Switches001(); + Assert.assertEquals(2, t.switch018(1)); + Assert.assertEquals(2, t.switch018(2)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test001/jack/Switches001.java b/jack-tests/tests/com/android/jack/switchstatement/test001/jack/Switches001.java new file mode 100644 index 00000000..d418de72 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test001/jack/Switches001.java @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test001.jack; + +/** + * Switch tests. + */ +public class Switches001 { + + public static int switch001(int a) { + switch (a) { + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } + } + + public int switch002(int i) { + switch (i) { + case -1: + return 2; + case 10: + case 15: + return 20; + default: + return -1; + } + } + + public int switch003(int i) { + switch (i) { + case -1: + return 1; + case 15: + return 2; + } + return -1; + } + + public int switch004(int i, int j) { + switch (i) { + case 1: + switch (j) { + case 10: + return 11; + case 20: + return 12; + default: + break; + } + case 2: + switch (j) { + case 10: + return 21; + case 20: + return 22; + default: + break; + } + default: + return -1; + } + } + + public int switch005(int i) { + switch (i) { + case 1: { + return 2; + } + case 3: { + return 4; + } + default: { + break; + } + } + return -1; + } + + public int switch006(int i) { + switch (i) { + case 3: { + return 3; + } + case 1: { + return 1; + } + case 2: { + return 2; + } + default: { + break; + } + } + return -1; + } + + public int switch007(int i) { + int result = 0; + switch (i) { + case 3: + case 1: { + result = result + 2; + break; + } + case 2: { + return 2; + } + default: { + break; + } + } + result = result + 2; + return result; + } + + public int switch008(int i) { + int result = 0; + switch (i) { + case 3: + case 1: { + result = result + 2; + switch (i) { + case 3: + result = result + 2; + break; + case 1: + } + result = result + 2; + break; + } + case 2: { + return 2; + } + default: { + break; + } + } + result = result + 2; + return result; + } + + public char switch009(char c) { + switch (c) { + case '#': + return '#'; + case 'A': + return 'A'; + } + return ' '; + } + + public int switch010(byte c) { + switch (c) { + case (byte) 1: + return 1; + case (short) 2: + return 2; + } + return 3; + } + + public int switch011(int c) { + switch (c) { + default: + return 2; + } + } + + public int switch012(int c) { + switch (c) { + } + return 1; + } + + public int switch013(int c) { + switch (c) { + default: + } + return 1; + } + + public int switch014(int c) { + switch (c) { + default: + break; + } + return 1; + } + + public int switch015(int c) { + switch (c) { + default: + if (c == 5) { + break; + } + break; + } + return 1; + } + + public int switch016(int c) { + switch (c) { + default: + if (c == 1) { + switch (c) { + case 1: + return 1; + case 3 : + break; + default: + break; + } + break; + } + break; + } + return 2; + } + + public int switch017(int c) { + switch (c) { + default: + if (c == 1) { + int lv = c; + while (true) { + lv += 5; + break; + } + return lv; + } + break; + } + return 2; + } + + public int switch018(int c) { + labelSwitch: switch (c) { + default: + if (c == 1) { + int lv = c; + while (true) { + lv += 5; + break; + } + switch (c) { + case 1: + break labelSwitch; + default: + break; + } + return 1; + } + break; + } + return 2; + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test002/dx/Tests.java new file mode 100644 index 00000000..78cd45e8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test002/dx/Tests.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test002.dx; + +import com.android.jack.switchstatement.test002.jack.Switches002; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Switches002 s = new Switches002(); + Assert.assertEquals(3, s.f); + Assert.assertEquals(0, s.m(new int[]{1,2,3})); + Assert.assertEquals(0, s.m(5, 8)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test002/jack/Switches002.java b/jack-tests/tests/com/android/jack/switchstatement/test002/jack/Switches002.java new file mode 100644 index 00000000..978dd09e --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test002/jack/Switches002.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test002.jack; + +/** + * Switch tests. + */ +public class Switches002 { + public int f = 2; + + { + int a = 0; + switch (a) { + case 0: + f = 3; + } + } + + public static int m(int[] tab) { + switch (tab.length) { + } + + return 0; + } + + public static int m(int a, int b) { + switch (a+b) { + } + return 0; + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test003/dx/Tests.java new file mode 100644 index 00000000..b7784ed6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test003/dx/Tests.java @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test003.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.switchstatement.test003.jack.Switches003; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test2() { + Switches003 s = new Switches003(); + try { + s.getValue(null); + Assert.fail(); + } catch (NullPointerException npe) { + // OK + } + } + + @Test + public void test3() { + Assert.assertEquals(0, Switches003.getValue2(2)); + Assert.assertEquals(Integer.MIN_VALUE, Switches003.getValue2(Integer.MIN_VALUE)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test003/jack/Switches003.java b/jack-tests/tests/com/android/jack/switchstatement/test003/jack/Switches003.java new file mode 100644 index 00000000..ad650649 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test003/jack/Switches003.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test003.jack; + +/** + * Switch tests. + */ +public class Switches003 { + public void getValue(int[] a) { + switch(a[0]) { + default : + } + } + + public static int getValue2(int a) { + switch(a) { + case Integer.MIN_VALUE: + return Integer.MIN_VALUE; + case 1: + return 1; + default : + return 0; + } + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test004/dx/Tests.java new file mode 100644 index 00000000..0488f16d --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test004/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test004.dx; + +import com.android.jack.switchstatement.test004.jack.Data; + +import org.junit.Assert; +import org.junit.Test; + +public class Tests { + + @Test + public void test() { + Assert.assertEquals(2, Data.get(0)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test004/jack/Data.java b/jack-tests/tests/com/android/jack/switchstatement/test004/jack/Data.java new file mode 100644 index 00000000..19a556cc --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test004/jack/Data.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test004.jack; + +public class Data { + + private static final int SHIFT = 30; + public static final int VALUE1 = 1 << SHIFT; + public static final int VALUE2 = 2 << SHIFT; + + public static int getSwitchValue() { + return VALUE2; + } + + public static int get(int v) { + switch(getSwitchValue()) { + case VALUE1: return 1; + case VALUE2: return 2; + default: return 0; + } + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test005/dx/Tests.java new file mode 100644 index 00000000..252b4eb1 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test005/dx/Tests.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test005.dx; + +import com.android.jack.switchstatement.test005.jack.Switch; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Switch.switch001(1)); + Assert.assertEquals(2, Switch.switch001(2)); + Assert.assertEquals(3, Switch.switch001(3)); + } + + @Test + public void test2() { + Assert.assertEquals(1, Switch.switch002(1)); + Assert.assertEquals(2, Switch.switch002(2)); + Assert.assertEquals(3, Switch.switch002(3)); + } + + @Test + public void test3() { + Assert.assertEquals(1, Switch.switch003(1)); + Assert.assertEquals(2, Switch.switch003(2)); + Assert.assertEquals(3, Switch.switch003(3)); + } + + @Test + public void test4() { + Assert.assertEquals(1, Switch.switch004(1)); + Assert.assertEquals(2, Switch.switch004(2)); + Assert.assertEquals(3, Switch.switch004(3)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test005/jack/Switch.java b/jack-tests/tests/com/android/jack/switchstatement/test005/jack/Switch.java new file mode 100644 index 00000000..3fd90b2e --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test005/jack/Switch.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test005.jack; + +public class Switch { + public static int switch001(int a) { + switch (a) { + case 1: + return 1; + case 2: + return 2; + default: + return 3; + } + } + + public static int switch002(int a) { + switch (a) { + case 1: + return 1; + case 2: { + switch (a) { + case 1: + return 11; + default: + break; + } + return 2; + } + } + return 3; + } + + public static int switch003(int a) { + switch (a) { + case (byte) 1: + return 1; + case (short) 3: + return 3; + case (char) 2: + return 2; + default: + return 3; + } + } + + public static int switch004(int a) { + switch (a) { + case 1: + return 1; + case 3: + return 3; + case (char) 2: + return 2; + case (char) -1: + return -1; + case -2: + return -2; + default: + return 3; + } + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test006/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test006/dx/Tests.java new file mode 100644 index 00000000..60e0aee4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test006/dx/Tests.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test006.dx; + +import com.android.jack.switchstatement.test006.jack.Switch; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(3, Switch.switch001(new Switch.A())); + try { + Switch.switch001(null); + Assert.fail(); + } catch (NullPointerException npe) { + // It is ok + } + } + + @Test + public void test2() { + try { + Switch.switch002(); + Assert.fail(); + } catch (ExceptionInInitializerError npe) { + // It is ok + } + } + + public void test3() { + try { + Switch.switch003(new Switch.A()); + Assert.fail(); + } catch (ExceptionInInitializerError npe) { + // It is ok + } + } + + public void test4() { + Assert.assertEquals(1, Switch.switch004(0)) ; + } + +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test006/jack/Switch.java b/jack-tests/tests/com/android/jack/switchstatement/test006/jack/Switch.java new file mode 100644 index 00000000..83251db0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test006/jack/Switch.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test006.jack; + +public class Switch { + + public static class A { + public int value; + } + + public static class B { + public static int value; + static { + int i = 0; + if (i != 1) { + throw new NullPointerException(); + } + } + } + + public static int switch001(A a) { + switch (a.value) { + default: + return 3; + } + } + + public static int switch002() { + switch (B.value) { + default: + return 3; + } + } + + @SuppressWarnings({"boxing", "cast"}) + public static int switch003(A a) { + switch ((Integer) a.value) { + default: + return 3; + } + } + + public static int switch004(int i) { + int [] array = {1, 2}; + switch (array[i++]) { + default: + return i; + } + } + +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test007/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test007/dx/Tests.java new file mode 100644 index 00000000..a976bd05 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test007/dx/Tests.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test007.dx; + +import com.android.jack.switchstatement.test007.jack.Switch; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Switch.switch001()); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test007/jack/Switch.java b/jack-tests/tests/com/android/jack/switchstatement/test007/jack/Switch.java new file mode 100644 index 00000000..4a22a26e --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test007/jack/Switch.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test007.jack; + +public class Switch { + + public static int switch001() { + switch (1) { + default: + return 3; + case 1: { + return 1; + } + case 2: { + return 2; + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test008/dx/Tests.java b/jack-tests/tests/com/android/jack/switchstatement/test008/dx/Tests.java new file mode 100644 index 00000000..550b5880 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test008/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test008.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.switchstatement.test008.jack.Switch; + +/** + * Tests about switches. + */ +public class Tests { + + @Test + public void test1() { + Assert.assertEquals(1, Switch.switch001(1)); + Assert.assertEquals(-1, Switch.switch001(2)); + Assert.assertEquals(-1, Switch.switch001(255)); + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test008/jack/Switch.java b/jack-tests/tests/com/android/jack/switchstatement/test008/jack/Switch.java new file mode 100644 index 00000000..d9ac67d7 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test008/jack/Switch.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test008.jack; + +public class Switch { + + public final class SwitchValues { + public static final int ZERO = 0; + public static final int ONE = 1; + public static final int UNSUPPORTED = 255; + } + + /** + * Check that the control flow graph does not contains useless edge/block when a case fall-through + * to the default case. The case SwitchValues.UNSUPPORTED and SwitchValues.ZERO are uselesses and + * must be remove to generate packed switch instead of sparsed switch. + */ + public static int switch001(int switchValue) { + int retValue; + switch (switchValue) { + case SwitchValues.ONE: { + retValue = 1; + break; + } + case SwitchValues.ZERO: + case SwitchValues.UNSUPPORTED: { + } + default: + retValue = -1; + } + + return retValue; + } +} diff --git a/jack-tests/tests/com/android/jack/switchstatement/test009/jack/Switch.java b/jack-tests/tests/com/android/jack/switchstatement/test009/jack/Switch.java new file mode 100644 index 00000000..f1a12bf8 --- /dev/null +++ b/jack-tests/tests/com/android/jack/switchstatement/test009/jack/Switch.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.switchstatement.test009.jack; + +/** + * Test allowing to check that 'packed-switch-payload' into generated dex is as small as possible. + */ +public class Switch { + + public static enum Num { + ZERO, + ONE, + TWO, + THREE, + FOUR, + FIVE, + SIX, + SEVEN, + EIGHT, + NINE, + TEN + } + + public static boolean switch1(Num num) { + switch (num) { + case ZERO: + case ONE: + case TWO: + case THREE: + case TEN: + return true; + default: + return false; + } + } +} diff --git a/jack-tests/tests/com/android/jack/synchronize/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/synchronize/test001/dx/Tests.java new file mode 100644 index 00000000..1545979a --- /dev/null +++ b/jack-tests/tests/com/android/jack/synchronize/test001/dx/Tests.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.synchronize.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.synchronize.test001.jack.Synchronize; + +/** + * Tests Synchronization. + */ +public class Tests { + @Test + public void lockUnlockWithSameObject() { + Assert.assertEquals(1, Synchronize.syncBlock()); + } + + @Test + public void waitFor() { + Assert.assertEquals(1, Synchronize.waitFor()); + } + + @Test + public void exceptionRange() { + Assert.assertEquals(1, Synchronize.exceptionRange(new Integer(1))); + try { + Synchronize.exceptionRange(new Integer(0)); + Assert.fail(); + } catch (IllegalArgumentException e) { + // Ok + } + } + + @Test + public void exceptionRange2() { + Synchronize.result = 0; + Synchronize.exceptionRange2(); + Assert.assertEquals(3, Synchronize.result); + } + + @Test + public void synchronizeIntoACatch() { + Synchronize.result = 0; + Synchronize.synchronizeIntoACatch(); + Assert.assertEquals(1, Synchronize.result); + } +} diff --git a/jack-tests/tests/com/android/jack/synchronize/test001/jack/Synchronize.java b/jack-tests/tests/com/android/jack/synchronize/test001/jack/Synchronize.java new file mode 100644 index 00000000..d5c404db --- /dev/null +++ b/jack-tests/tests/com/android/jack/synchronize/test001/jack/Synchronize.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.synchronize.test001.jack; + +/** + * Synchronize test. + */ +public class Synchronize { + + public static Object getObject() { + return new Object(); + } + + // Check that jlock/junlock use the same object, otherwise java.lang.IllegalMonitorStateException + // will be trigger. + public static int syncBlock() { + synchronized(getObject()) { + return 1; + } + } + + public static int waitFor() { + Object exitValueMutex = new Object(); + Integer exitValue = null; + synchronized (exitValueMutex) { + while (exitValue != null) { + } + return 1; + } + } + + public static synchronized int exceptionRange(Integer i) throws IllegalArgumentException { + if (i.intValue() > 0) { + synchronized (i) { + return i.intValue(); + } + } + throw new IllegalArgumentException(); + } + + public static int result = 0; + + public static synchronized void exceptionRange2() { + try { + result += 1; + } finally { + synchronized (Synchronize.class) { + try { + result += 1; + } finally { + result += 1; + } + } + } + } + + public static void synchronizeIntoACatch() { + try { + result += 1; + } catch (Exception e) { + synchronized (Synchronize.class) { + result += 1; + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized.java b/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized.java new file mode 100644 index 00000000..36101a67 --- /dev/null +++ b/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.synchronize.test002.jack; + +public class Synchronized { + + public static int sync(int a) { + synchronized (Synchronized.class) { + return 1; + } + } + + public static synchronized int syncMethod(int a) { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized2.java b/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized2.java new file mode 100644 index 00000000..d56f11a4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/synchronize/test002/jack/Synchronized2.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.synchronize.test002.jack; + +public class Synchronized2 { + + public static synchronized int syncStaticMethod(int a) { + return 1; + } + + public synchronized int syncInstanceMethod(int a) { + return 1; + } + + public int syncBlock(int a) { + synchronized (this) { + return 1; + } + } +} diff --git a/jack-tests/tests/com/android/jack/threeaddress/dx/Tests.java b/jack-tests/tests/com/android/jack/threeaddress/dx/Tests.java new file mode 100644 index 00000000..eca3c3b6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/threeaddress/dx/Tests.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.threeaddress.dx; + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.threeaddress.jack.ThreeAddressCode001; +import com.android.jack.threeaddress.jack.ThreeAddressCode002; +import com.android.jack.threeaddress.jack.ThreeAddressCode003; + +public class Tests { + + @Test + public void multiAdd_001() { + Assert.assertEquals(6, ThreeAddressCode001.threadAddressCode001()); + } + + @Test + public void multiAdd_002() { + Assert.assertEquals(6, ThreeAddressCode001.threadAddressCode002(1, 2, 3)); + } + + @Test + public void arrayAdd_001() { + int [] a = {5, 6, 7}; + int [] b = {7, 8, 9}; + int [] c = {10, 11, 12}; + Assert.assertEquals(25, ThreeAddressCode001.threadAddressCode003(a, b, c)); + } + + @Test + public void methodCall_001() { + Assert.assertEquals(1, ThreeAddressCode001.threadAddressCode004(7)); + } + + @Test + public void anonymous_001() { + Assert.assertEquals(17, ThreeAddressCode001.threeAddressCode005(3, 5)); + } + + @Test + public void conditional_001() { + Assert.assertEquals(1, ThreeAddressCode001.test_conditionalCode001(3)); + Assert.assertEquals(-1, ThreeAddressCode001.test_conditionalCode001(-3)); + Assert.assertEquals(1, ThreeAddressCode001.test_conditionalCode001(Integer.MAX_VALUE)); + Assert.assertEquals(-1, ThreeAddressCode001.test_conditionalCode001(Integer.MIN_VALUE)); + } + + @Test + public void conditional_002() { + Assert.assertEquals(3, ThreeAddressCode001.test_conditionalCode002(2, 3)); + Assert.assertEquals(3, ThreeAddressCode001.test_conditionalCode002(3, 2)); + Assert.assertEquals(-1, ThreeAddressCode001.test_conditionalCode002(-2, 3)); + Assert.assertEquals(-1, ThreeAddressCode001.test_conditionalCode002(-2, -3)); + } + + @Test + public void conditional_003() { + Assert.assertEquals(1, ThreeAddressCode001.test_conditionalCode003(2, 3)); + Assert.assertEquals(1, ThreeAddressCode001.test_conditionalCode003(3, 2)); + Assert.assertEquals(3, ThreeAddressCode001.test_conditionalCode003(-2, 3)); + Assert.assertEquals(3, ThreeAddressCode001.test_conditionalCode003(-2, -3)); + } + + @Test + public void conditional_004() { + Assert.assertEquals(-1, ThreeAddressCode001.test_conditionalCode004(1, 2, 3, 4, 5, 6, 7)); + Assert.assertEquals(6, ThreeAddressCode001.test_conditionalCode004(1, 6, 30, 4, 6, 6, 7)); + Assert.assertEquals(30, ThreeAddressCode001.test_conditionalCode004(30, 6, 30, 4, 6, 6, 7)); + Assert.assertEquals(4, ThreeAddressCode001.test_conditionalCode004(3, 6, 2, 1, 30, 30, 4)); + } + + @Test + public void conditional_005() { + Assert.assertEquals(1, ThreeAddressCode001.test_conditionalCode005(1, 2)); + } + + @Test + public void multiAssign_001() { + Assert.assertEquals(4, ThreeAddressCode002.threadAddressCode002()); + } + + @Test + public void withoutBlock_001() { + Assert.assertEquals(3, ThreeAddressCode002.threadAddressWithoutBlock(1, 2, 5)); + } + + @Test + public void assignIntoExpr001() { + Assert.assertEquals(1, ThreeAddressCode003.assignIntoExpr001()); + } + + @Test + public void assignIntoExpr002() { + Assert.assertEquals(2, ThreeAddressCode003.assignIntoExpr002()); + } + + @Test + public void assignIntoExpr003() { + Assert.assertEquals(1, ThreeAddressCode003.assignIntoExpr003()); + } + + @Test + public void assignIntoExpr004() { + Assert.assertEquals(3, ThreeAddressCode003.assignIntoExpr004()); + } + + @Test + public void testFromLibCore() { + Assert.assertEquals(16, ThreeAddressCode003.test()); + } + + @Test + public void incIntoMethodCall() { + Assert.assertEquals('c', new ThreeAddressCode003().next()); + } +} diff --git a/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode001.java b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode001.java new file mode 100644 index 00000000..a525ea0c --- /dev/null +++ b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode001.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.threeaddress.jack; + + +public class ThreeAddressCode001 { + + public static int threadAddressCode001() { + int a = 1; + int b = 2; + int c = 3; + int d; + d = a + b + c; + return d; + } + + public static int threadAddressCode002(int a, int b, int c) { + int t = a + b + c; + return t; + } + + public static int threadAddressCode003(int[] a, int[] b, int[] c) { + int t = a[0] + b[1] + c[2]; + return t; + } + + public static int threadAddressCode004(int c) { + int t = ThreeAddressCode001.getValue(c + 1); + return t; + } + + public static int threeAddressCode005(int a, int b) { + int c; + c = a + b + new ThreeAddressCodeUtil001() { + + @Override + public int f(int a, int b) { + return a + b + 1; + } + }.f(a, b); + return c; + } + + public static int test_conditionalCode001(int a) { + int b = (a > 0) ? 1 : -1; + return b; + } + + public static int test_conditionalCode002(int a, int b) { + int c = (a > 0) ? ((b > a) ? b : a) : -1; + return c; + } + + public static int test_conditionalCode003(int a, int b) { + int c; + if (((a > 0) ? ((b > a) ? b : a) : -1) > 0) { + c = 1; + } else { + c = 3; + } + return c; + } + + public static int test_conditionalCode004(int a, int b, int c, int d, int e, int f, int g) { + int i = + ((c > d) ? (e == f) : (g == a)) ? ((((b == f) ? e : g) > a) ? ((a < c) ? b : g) : a) : -1; + return i; + } + + public static int test_conditionalCode005(int a, int b) { + int x = (a < b) ? (1) : (getValue((b > 0) ? 2 : 3)); + return x; + } + + public static int getValue(int c) { + return 1; + } +} diff --git a/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode002.java b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode002.java new file mode 100644 index 00000000..ff201b69 --- /dev/null +++ b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode002.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.threeaddress.jack; + +public class ThreeAddressCode002 { + + public static int threadAddressCode002() { + int a, b, c; + a = b = c = 4; + return a; + } + + public static void threadAddressWithLabel(int a, int b, int c) { + label: + while (a < (b + c)) { + continue label; + } + } + + public static int threadAddressWithoutBlock(int a, int b, int c) { + int d = 0; + if (a < b) + c = a + b +d; + return c; + } +} diff --git a/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode003.java b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode003.java new file mode 100644 index 00000000..bd9753d0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCode003.java @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.threeaddress.jack; + +public class ThreeAddressCode003 { + + public static int assignIntoExpr001() { + int lv1 = 1; + int lv2; + return lv2 = lv1; + } + + public static int assignIntoExpr002() { + int lv1 = 1; + int lv2; + int lv3; + return lv3 = lv2 = ++lv1; + } + + public static int index = 0; + + public static int getIndex() { + return index++; + } + + public static int assignIntoExpr003() { + int lv1 = 1; + int a[] = new int[5]; + int j = 0; + j = a[getIndex()] = ++lv1; + return getIndex(); + } + + public static int assignIntoExpr004() { + int lv1 = 1; + int a[] = new int[5]; + int j = 0; + if ((j = a[getIndex()] = ++lv1) == 2) { + return 3; + } + return getIndex(); + } + + public static int test() { + byte[] tokenTypes = new byte[256]; + byte TOKEN_DIGIT = 16; + + tokenTypes['.'] |= TOKEN_DIGIT; + + return tokenTypes['.']; + } + + private int offset = 1; + public char next() { + String string = "abc"; + return string.charAt(++offset); + } +} diff --git a/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCodeUtil001.java b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCodeUtil001.java new file mode 100644 index 00000000..e84e841e --- /dev/null +++ b/jack-tests/tests/com/android/jack/threeaddress/jack/ThreeAddressCodeUtil001.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.threeaddress.jack; + +public abstract class ThreeAddressCodeUtil001 { + public abstract int f(int a, int b); +} diff --git a/jack-tests/tests/com/android/jack/throwstatement/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/throwstatement/test001/dx/Tests.java new file mode 100644 index 00000000..26e5c054 --- /dev/null +++ b/jack-tests/tests/com/android/jack/throwstatement/test001/dx/Tests.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.throwstatement.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.throwstatement.test001.jack.ThrowStmt; + +/** + * Tests about throw. + */ +public class Tests { + + private class MyException extends RuntimeException { + + private static final long serialVersionUID = 1L; + } + + private class MySecondException extends RuntimeException { + + private static final long serialVersionUID = 1L; + } + + @Test + public void throwException() { + try { + ThrowStmt.throwException(new MyException()); + Assert.fail(); + } catch (MyException e) { + // Ok + } + } + + @Test + public void reThrowException() { + try { + ThrowStmt.reThrowException(new MyException()); + Assert.fail(); + } catch (MyException e) { + // Ok + } + } + + @Test + public void reThrowSecondException() { + try { + ThrowStmt.reThrowException(new MyException(), new MySecondException()); + Assert.fail(); + } catch (MySecondException e) { + // Ok + } + } +} diff --git a/jack-tests/tests/com/android/jack/throwstatement/test001/jack/ThrowStmt.java b/jack-tests/tests/com/android/jack/throwstatement/test001/jack/ThrowStmt.java new file mode 100644 index 00000000..7045557d --- /dev/null +++ b/jack-tests/tests/com/android/jack/throwstatement/test001/jack/ThrowStmt.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.jack.throwstatement.test001.jack; + +/** + * Throw tests. + */ +public class ThrowStmt { + + public static void throwException(RuntimeException e) { + throw e; + } + + public static void reThrowException(RuntimeException e) { + try { + throw e; + } catch (RuntimeException e1) { + throw e1; + } + } + + public static void reThrowException(RuntimeException e1, RuntimeException e2) { + try { + try { + throw e1; + } catch (RuntimeException e3) { + throw e3; + } + } catch (RuntimeException e4) { + throw e2; + } + } +} diff --git a/jack-tests/tests/com/android/jack/transformations/cast/jack/Data.java b/jack-tests/tests/com/android/jack/transformations/cast/jack/Data.java new file mode 100644 index 00000000..bfea9858 --- /dev/null +++ b/jack-tests/tests/com/android/jack/transformations/cast/jack/Data.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.transformations.cast.jack; + +import java.io.Serializable; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.text.CharacterIterator; + +@SuppressWarnings("cast") +public class Data { + + public static Object[] castObjectToArray(Object s) { + return (Object[]) s; + } + + public static Object castObjectToObject(Object s) { + return (Object) s; + } + + public static Object castStringToObject(String s) { + return (Object) s; + } + + public static Serializable castStringToSerializable(String s) { + return (Serializable) s; + } + + public static Cloneable castArrayToCloneable(int[] a) { + return (Cloneable) a; + } + + public static String castNullToString() { + return (String) null; + } + + public static Throwable castExceptionToThrowable(Exception e) { + return (Throwable) e; + } + + public static Cloneable castCharacterIteratorToCloneable(CharacterIterator c) { + return (Cloneable) c; + } + + public static Object[] castMultiToObjectArray(int[][] a) { + return (Object[]) a; + } + + public static Object[] castStringArrayToObjectArray(String[] a) { + return (Object[]) a; + } + + public static InetAddress castExternalTypes(Inet4Address ia) { + return (InetAddress) ia; + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/trycatch/test001/dx/Tests.java new file mode 100644 index 00000000..79f8bb85 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test001/dx/Tests.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test001.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.trycatch.test001.jack.TryCatch; + +/** + * Tests about try/catch. + */ +public class Tests { + + @Test + public void testDiv() { + Assert.assertEquals(0, TryCatch.div(0)); + } + + @Test + public void testNestedDiv() { + Assert.assertEquals(0, TryCatch.nestedDiv(0, 0)); + Assert.assertEquals(-1, TryCatch.nestedDiv(1, 0)); + Assert.assertEquals(-2, TryCatch.nestedDiv(0, 1)); + } + + @Test + public void emptyCatch() { + Assert.assertEquals(0, TryCatch.emptyCatch(0)); + } + + @Test + public void nestedTry() { + Assert.assertEquals(1, TryCatch.nestedTry(0)); + } + + @Test + public void nestedTry2() { + Assert.assertEquals(5, TryCatch.nestedTry2(0)); + } + + @Test + public void nestedTryWithFallThrough() { + Assert.assertEquals(8, TryCatch.nestedTryWithFallThrough(0)); + } + + @Test + public void similarCatches() { + Assert.assertEquals(1, TryCatch.similarCatches()); + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test001/jack/TryCatch.java b/jack-tests/tests/com/android/jack/trycatch/test001/jack/TryCatch.java new file mode 100644 index 00000000..501d0927 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test001/jack/TryCatch.java @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test001.jack; + +public class TryCatch { + + public static int div(int i) { + try { + int r = 1 / i; + return -1; + } catch (Throwable t) { + return 0; + } + } + + public static int nestedDiv(int i, int j) { + try { + int r1 = 1 / i; + return -1; + } catch (Throwable t1) { + try { + int r2 = 1 / j; + return -2; + } catch (Throwable t2) { + return 0; + } + } + } + + public static int emptyCatch(int i) { + try { + int r = 1 / i; + return -1; + } catch (Throwable t) { + } + return 0; + } + + public static int nestedTry(int i) { + try { + try { + int r = 1 / i; + return -1; + } catch (Throwable t) { + } + } catch (Throwable t) { + return 0; + } + return 1; + } + + public static int nestedTry2(int i) { + int result = 1; + try { + try { + int r = 1 / i; + return -1; + } catch (Throwable t) { + result = 5; + } + } catch (Throwable t) { + return result; + } + return result; + } + + public static int nestedTryWithFallThrough(int i) { + int result = 0; + try { + try { + result = result + 2; + } catch (Throwable t) { + result = 0; + } + result = result + 2; + int r = 1 / i; + } catch (Throwable t) { + result = result + 2; + } + result = result + 2; + return result; + } + + public static int similarCatches() { + int result = 0; + try { + try { + throw new AssertionError(); + } catch (AssertionError t) { + result += 1; + } + } catch (AssertionError t) { + result += 2; + } + return result; + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/trycatch/test002/dx/Tests.java new file mode 100644 index 00000000..ca491e60 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test002/dx/Tests.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test002.dx; + +import com.android.jack.trycatch.test002.jack.TryCatch; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test001() { + Assert.assertNull(TryCatch.tryWithLoop1()); + } + @Test + public void test002() { + Assert.assertNull(TryCatch.tryWithLoop2()); + } + @Test + public void test003() { + Assert.assertNull(TryCatch.tryWithLoop3()); + } + @Test + public void test004() { + Assert.assertNull(TryCatch.tryWithLoop4()); + } + @Test + public void test005() { + Assert.assertEquals(1, TryCatch.tryWithLoop5()); + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test002/jack/TryCatch.java b/jack-tests/tests/com/android/jack/trycatch/test002/jack/TryCatch.java new file mode 100644 index 00000000..dc7c69e0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test002/jack/TryCatch.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test002.jack; + +import java.util.LinkedList; +import java.util.List; + + +public class TryCatch { + + public static Object tryWithLoop1() { + try { + for(int i = 0; i<1; i++) { + i++; + } + + } catch (RuntimeException e) { + return new Object(); + } + return null; + } + + public static Object tryWithLoop2() { + try { + for(int i = 0; i<1; i++) { + m(i); + } + + } catch (RuntimeException e) { + return null; + } + return new Object(); + } + + + public static Object tryWithLoop3() { + try { + for(int i = 0; i<1; i++) { + i++; + } + + } catch (RuntimeException e) { + } + return null; + } + + public static Object tryWithLoop4() { + try { + for(int i = 0; i<1; i++) { + m(i); + } + + } catch (RuntimeException e) { + } + return null; + } + + private static void m(int i) { + throw new NullPointerException(); + } + + public static int tryWithLoop5() { + List values = new LinkedList(); + values.add(new Integer(1)); + values.add(new Integer(2)); + values.add(new Integer(3)); + try { + try { + return 1; + } catch (Throwable ex) { + return 2; + } + } finally { + for (Integer i : values) + i.intValue(); + } + } + +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/trycatch/test003/dx/Tests.java new file mode 100644 index 00000000..84b6f98a --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test003/dx/Tests.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test003.dx; + +import com.android.jack.trycatch.test003.jack.TryCatch; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test001() { + try { + TryCatch.noThrow(); + } catch (Throwable t) { + Assert.fail("No throwable should have been thrown"); + } + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test003/jack/TryCatch.java b/jack-tests/tests/com/android/jack/trycatch/test003/jack/TryCatch.java new file mode 100644 index 00000000..69b7d063 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test003/jack/TryCatch.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test003.jack; + +public class TryCatch { + + public static void noThrow() { + try { + } catch (Throwable t) { + } + } + +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test004/jack/TryCatch.java b/jack-tests/tests/com/android/jack/trycatch/test004/jack/TryCatch.java new file mode 100644 index 00000000..95bef459 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test004/jack/TryCatch.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test004.jack; + +public class TryCatch { + Object mCurApp; + + private class Drawable { + } + + private String loadLabel(Object p) { + return null; + } + + private Drawable loadIcon(Object p) { + return null; + } + + private void setDrawable(int iconId, Drawable d) {} + + private void setText(int actionId, String text) {} + + private String getString(int actionStr, CharSequence appName) { + return null; + } + + // The generated dex should not contain useless 'mov' instructions into empty catch. + void setIconAndText(int iconId, int actionId, int descriptionId, String packageName, + int actionStr, int descriptionStr) { + CharSequence appName = ""; + Drawable appIcon = null; + + try { + appName = loadLabel(null); + appIcon = loadIcon(null); + } catch (Exception e) { + } + + + setDrawable(iconId, appIcon); + setText(actionId, getString(actionStr, appName)); + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/trycatch/test005/dx/Tests.java new file mode 100644 index 00000000..c420202c --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test005/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test005.dx; + + +import junit.framework.Assert; + +import org.junit.Test; + +import com.android.jack.trycatch.test005.jack.TryCatch; + +public class Tests { + @Test + public void test001() { + try { + new TryCatch(); + } catch (NullPointerException npe) { + Assert.fail("Npe not caught"); + } + } +} diff --git a/jack-tests/tests/com/android/jack/trycatch/test005/jack/TryCatch.java b/jack-tests/tests/com/android/jack/trycatch/test005/jack/TryCatch.java new file mode 100644 index 00000000..d1a0e3f6 --- /dev/null +++ b/jack-tests/tests/com/android/jack/trycatch/test005/jack/TryCatch.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.trycatch.test005.jack; + +/** + * Test checking that exception is catched in init block. + */ +public class TryCatch { + { + try { + m(); + } catch (NullPointerException e) { + } + } + + public void m() { + throw new NullPointerException(); + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally002/dx/Tests.java b/jack-tests/tests/com/android/jack/tryfinally/finally002/dx/Tests.java new file mode 100644 index 00000000..fe76cb1f --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally002/dx/Tests.java @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally002.dx; + +import com.android.jack.tryfinally.finally002.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test001() { + Assert.assertEquals(8, Data.get001(1)); + } + + @Test + public void test002() { + Assert.assertEquals(10, Data.get001(2)); + } + + @Test + public void test003() { + Assert.assertEquals(14, Data.get001(3)); + } + + @Test + public void test004() { + Assert.assertEquals(3, Data.get001(4)); + } + + @Test + public void test005() { + Assert.assertEquals(66, Data.get002(-1)); + } + + @Test + public void test006() { + Assert.assertEquals(32, Data.get002(1)); + } + + @Test + public void test007() { + Assert.assertEquals(37, Data.get003(-1)); + } + + @Test + public void test008() { + Assert.assertEquals(33, Data.get003(1)); + } + + @Test + public void test009() { + try { + Data.get004(); + Assert.fail(); + } catch (NullPointerException e) { + // OK + } + } + + @Test + public void test010() { + Assert.assertEquals(3, Data.get005()); + } + + @Test + public void test011() { + try { + Assert.assertEquals(3, Data.get006()); + Assert.fail(); + } catch (NullPointerException e) { + //Ok + } + } + + @Test + public void test012() { + Assert.assertEquals(1, Data.get007()); + Assert.assertEquals(0, Data.field007); + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/Data.java b/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/Data.java new file mode 100644 index 00000000..df51fa5c --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/Data.java @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally002.jack; + +public class Data { + + public static int get001(int i) { + int result = 0; + try { + alwaysThrow(); + } catch (Exception e) { + try { + try { + try { + try { + canThrow(i); + } finally { + result += 3; + } + } catch (NullPointerException npe) { + result += 5; + } + } catch (OutOfMemoryError oom) { + result += 7; + } + } catch (TestException te) { + result += 11; + } + } + return result; + } + + public static int get002(int i) { + int result = 0; + try { + try { + alwaysThrow(); + } catch (Exception e) { + try { + alwaysThrow(); + } catch (Exception e2) { + try { + alwaysThrow(); + } catch (Exception e3) { + try { + alwaysThrow(); + } catch (Exception e4) { + try { + alwaysThrow(); + } catch (Exception e5) { + try { + canThrow(i); + } finally { + result += 3; + } + result += 5; + } + result += 7; + + } + result += 11; + + } + result += 17; + + } + result += 23; + + } + } catch (Exception e) { + result += 29; + } + return result; + } + + public static int get003(int i) { + int result = 0; + try { + try { + alwaysThrow(); + } catch (Exception e2) { + try { + alwaysThrow(); + } catch (Exception e3) { + try { + alwaysThrow(); + } catch (Exception e5) { + result += 1; + } finally { + try { + canThrow(i); + } finally { + result += 3; + } + result += 5; + + } + result += 11; + + } + result += 17; + + } + } catch (Exception e) { + result += 29; + } + return result; + } + + @SuppressWarnings("finally") + public static int get004() { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e) { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e1) { + try { + return 1; + } finally { + throw new NullPointerException(); + } + } + } catch (NullPointerException e) { + return 2; + } + } + + @SuppressWarnings("finally") + public static int get005() { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e) { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e1) { + try { + return 1; + } finally { + throw new NullPointerException(); + } + } + } catch (NullPointerException e) { + return 2; + } finally { + return 3; + } + } + + @SuppressWarnings("finally") + public static int get005Bis() { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e) { + try { + throw new ArrayIndexOutOfBoundsException(); + } catch (ArrayIndexOutOfBoundsException e1) { + try { + return 1; + } finally { + throw new NullPointerException(); + } + } + } catch (NullPointerException e) { + return 2; + } finally { + return 3; + } + } + + @SuppressWarnings("finally") + public static int get006() { + try { + return 1; + } finally { + try { + return 2; + } finally { + try { + return 3; + } finally { + throw new NullPointerException(); + } + } + } + } + + public static int field007; + + @SuppressWarnings("finally") + public static int get007() { + field007 = 0; + try { + return 1; + } + catch (NullPointerException e) { + field007 = 4; + return 4; + } + catch (ArrayIndexOutOfBoundsException e) { + try { + return 2; + } finally { + try { + return 3; + } finally { + throw new NullPointerException(); + } + } + } + } + + private static void canThrow(int i) throws TestException { + switch (i) { + case 1 : + throw new NullPointerException(); + case 2 : + throw new OutOfMemoryError(); + case 3 : + throw new TestException(); + } + } + private static void alwaysThrow() throws TestException { + throw new TestException(); + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/TestException.java b/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/TestException.java new file mode 100644 index 00000000..1f22ba41 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally002/jack/TestException.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally002.jack; + +public class TestException extends Exception { + + private static final long serialVersionUID = 1L; + + public TestException() { + } + + public TestException(String message) { + super(message); + } + + public TestException(Throwable cause) { + super(cause); + } + + public TestException(String message, Throwable cause) { + super(message, cause); + } + +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally003/dx/Tests.java b/jack-tests/tests/com/android/jack/tryfinally/finally003/dx/Tests.java new file mode 100644 index 00000000..8492a80d --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally003/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally003.dx; + +import com.android.jack.tryfinally.finally003.jack.Finally003; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(19, Finally003.get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally003/jack/Finally003.java b/jack-tests/tests/com/android/jack/tryfinally/finally003/jack/Finally003.java new file mode 100644 index 00000000..584b90e3 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally003/jack/Finally003.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally003.jack; + +public class Finally003 { + + public static int get() { + int i = 0; + try { + i += 12; + canThrow(); + } finally { + switch (i) { + case 0 : + i += 5; + default : + i += 7; + } + } + return i; + } + + private static void canThrow() { + // + } + +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally004/dx/Tests.java b/jack-tests/tests/com/android/jack/tryfinally/finally004/dx/Tests.java new file mode 100644 index 00000000..f4b86630 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally004/dx/Tests.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally004.dx; + +import com.android.jack.tryfinally.finally004.jack.Finally004; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + + @Test + public void test001() { + Assert.assertEquals(0, Finally004.get()); + } + +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally004/jack/Finally004.java b/jack-tests/tests/com/android/jack/tryfinally/finally004/jack/Finally004.java new file mode 100644 index 00000000..9c47f81b --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally004/jack/Finally004.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally004.jack; + +public class Finally004 { + + public static int get() { + boolean satisfied = false; + try { + satisfied = getSatisfied(); + return 0; + } finally { + if (!satisfied) { + return 1; + } + } + } + + private static boolean getSatisfied() { + return true; + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finally005/jack/Finally005.java b/jack-tests/tests/com/android/jack/tryfinally/finally005/jack/Finally005.java new file mode 100644 index 00000000..c0f1c065 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finally005/jack/Finally005.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finally005.jack; + +/** + * JUnit test allowing to verify that useless 'if' are not generated (if null != null). + */ +public class Finally005 { + + private static class A { + public int i = 10; + + public void call() { + } + } + + public static A newA() { + return new A(); + } + + public static void get() { + A a = null; + try { + a = newA(); + } finally { + // After FinallyRemover and ConstantRefinerAndVariableRemover, the following if is no longer + // required and should be removed since it is similar to if (null != null). + if (a != null) { + int l = a.i; + a.i = 10; + a.call(); + } + } + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/dx/Tests.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/dx/Tests.java new file mode 100644 index 00000000..e1a1aee0 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/dx/Tests.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.tryfinally.finallyblock.jack.B; +import com.android.jack.tryfinally.finallyblock.jack.Branching; +import com.android.jack.tryfinally.finallyblock.jack.Catch; +import com.android.jack.tryfinally.finallyblock.jack.EmptyBlocks; +import com.android.jack.tryfinally.finallyblock.jack.Nested; + +/** + * Tests about finally. + */ +public class Tests { + + @Test + public void branching1() { + Assert.assertEquals(2 * 5, Branching.returnInFinally1()); + Assert.assertEquals(2 * 5, Branching.returnInFinally2()); + Assert.assertEquals(2 * 3 * 5, Branching.returnInFinally3()); + Assert.assertEquals(2 * 3, Branching.returnInTry1()); + Assert.assertEquals(2 * 7, Branching.returnInCatch1()); + Assert.assertEquals("A", Branching.returnInTry2()); + Assert.assertEquals(2 * 3, Branching.returnInTry3(new B()).field); + Assert.assertEquals(-1, Branching.breakInFinally1()); + Assert.assertEquals(4, Branching.continueInFinally1()); + Assert.assertEquals(27, Branching.returnInNestedTry(true)); + } + + @Test + public void catch1() { + Assert.assertEquals(2 * 3 * 5, Catch.tryCatchFinally1()); + Assert.assertEquals(2 * 5, Catch.tryCatchFinally2()); + } + + @Test + public void catch2() { + Assert.assertEquals(2 * 3 * 7 * 13, Catch.shouldNotCatch1()); + Assert.assertEquals(2 * 3 * 7 * 23, Catch.shouldNotCatch2()); + try { + Catch.shouldNotCatch3(); + Assert.fail(); + } catch (NullPointerException e) { + // OK + } + Assert.assertEquals(0, Catch.value); + } + + @Test + public void nested1() { + Assert.assertEquals(2 * 23 * 7 * 19 * 13 * 17 * 5, Nested.inTry1()); + Assert.assertEquals(2 * 23 * 7 * 11 * 13 * 17 * 5, Nested.inTry2()); + Assert.assertEquals(2 * 23 * 7 * 13 * 3 * 5, Nested.inTry3()); + Assert.assertEquals(2 * 23 * 7 * 11 * 13 * 3 * 5, Nested.inTry4()); + Assert.assertEquals(2 * 19 * 5, Nested.inCatch1()); + Assert.assertEquals(2 * 3 * 7 * 13 * 17 * 5, Nested.inCatch2()); + Assert.assertEquals(2 * 3 * 7 * 11 * 13 * 17 * 5, Nested.inCatch3()); + Assert.assertEquals(2 * 3 * 7 * 11 * 13 * 5 * 31, Nested.inCatch4()); + Assert.assertEquals(2 * 23 * 5 * 7 * 19 * 13 * 17, Nested.inFinally1()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 17, Nested.inFinally2()); + Assert.assertEquals(2 * 23 * 5 * 7 * 19 * 13 * 17, Nested.inFinally6()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 17, Nested.inFinally7()); + } + + @Test + public void nested2() { + Assert.assertEquals(2 * 23 * 7 * 29 * 13 * 3 * 5, Nested.inTry5()); + Assert.assertEquals(2 * 23 * 7 * 11 * 13 * 3 * 5, Nested.inTry6()); + Assert.assertEquals(2 * 3 * 7 * 13 * 5 * 31, Nested.inCatch5()); + Assert.assertEquals(2 * 3 * 7 * 11 * 13 * 5 * 31, Nested.inCatch6()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 31, Nested.inFinally3()); + Assert.assertEquals(2 * 23 * 5 * 7 * 19 * 13 * 31, Nested.inFinally4()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 31, Nested.inFinally5()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 31, Nested.inFinally8()); + Assert.assertEquals(2 * 23 * 5 * 7 * 19 * 13 * 31, Nested.inFinally9()); + Assert.assertEquals(2 * 23 * 5 * 7 * 11 * 13 * 31, Nested.inFinally10()); + } + + @Test + public void emptyBlocks() { + Assert.assertEquals(5, EmptyBlocks.emptyTry()); + Assert.assertEquals(2 * 3 * 5, EmptyBlocks.emptyCatch1()); + Assert.assertEquals(2 * 5, EmptyBlocks.emptyCatch2()); + Assert.assertEquals(2 * 3, EmptyBlocks.emptyFinally1()); + Assert.assertEquals(2 * 5, EmptyBlocks.emptyFinally2()); + Assert.assertEquals(1, EmptyBlocks.allEmpty()); + } + + @Test + public void finallyWithNew() { + Assert.assertEquals(2, Catch.finallyWithNew()); + } + + @Test + public void loopIntoTryFinally() { + Assert.assertEquals(6, Branching.loopIntoTryFinally()); + } + + @Test + public void nestedFinally() { + Assert.assertEquals(7, Nested.inFinally11()); + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/B.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/B.java new file mode 100644 index 00000000..dd6ab378 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/B.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.jack; + +public class B { + public int field = 2; +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Branching.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Branching.java new file mode 100644 index 00000000..a51b0968 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Branching.java @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.jack; + +@SuppressWarnings("finally") +public class Branching { + + public static void throwException() { + throw new RuntimeException(); + } + + public static void doNotThrowException() { + return; + } + + public static int returnInFinally1() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 3; + } finally { + a = a * 5; + return a; + } + } + + public static int returnInFinally2() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 3; + return a; + } finally { + a = a * 5; + return a; + } + } + + public static int returnInFinally3() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + return a; + } finally { + a = a * 5; + return a; + } + } + + public static int returnInTry1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + return a; + } finally { + a = a * 5; + } + } + + public static int returnInCatch1() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 3; + return a; + } catch (Exception e) { + a = a * 7; + return a; + } finally { + a = a * 5; + } + } + + public static String returnInTry2() { + String a = "A"; + try { + doNotThrowException(); + return a; + } finally { + a = "B"; + } + } + + public static B returnInTry3(B b) { + b.field = 1; + try { + b.field = b.field * 2; + return b; + } finally { + b.field = b.field * 3; + } + } + + public static int breakInFinally1() { + int a = 1; + while (true) { + try { + a = a * 2; + return a; + } finally { + a = a * 3; + break; + } + } + return -1; + } + + public static int continueInFinally1() { + int a = 5; + int i = 0; + while (i<4) { + try { + a = a * 2; + i++; + return a; + } finally { + a = a * 3; + continue; + } + } + return i; + } + + public static int loopIntoTryFinally() { + int i = 0; + try { + while (i<5) { + i++; + } + } + finally { + i++; + } + return i; + } + + public static int returnInNestedTry(boolean b1) { + int a = 1; + try { + try { + if (b1) { + return 27; + } + } finally { + a = a * 3; + } + } finally { + a = a * 11; + } + return a; + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Catch.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Catch.java new file mode 100644 index 00000000..e6d91c1a --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Catch.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.jack; + +public class Catch { + + public static void throwException() { + throw new RuntimeException(); + } + + public static void doNotThrowException() { + return; + } + + public static int tryCatchFinally1() { + int a = 1; + try { + a = a * 2; + throwException(); + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int tryCatchFinally2() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int shouldNotCatch1() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + } catch (RuntimeException e) { + a = a * 5; + } finally { + a = a * 7; + throwException(); + a = a * 11; + } + } catch (RuntimeException e2) { + a = a * 13; + } + return a; + } + + public static int shouldNotCatch2() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + } catch (RuntimeException e) { + try { + a = a * 5; + doNotThrowException(); + a = a * 17; + } catch (RuntimeException e2) { + a = a * 13; + } + } finally { + a = a * 7; + throwException(); + a = a * 11; + } + } catch (RuntimeException e2) { + a = a * 23; + } + return a; + } + + public static int finallyWithNew() { + Integer i = null; + try { + i = new Integer(1); + } + finally { + i = new Integer(2); + } + return (i.intValue()); + } + + public static int value = 0; + + @SuppressWarnings("finally") + public static int shouldNotCatch3() { + value = 0; + try { + try { + try { + return -1; + } catch (NullPointerException e) { + value += 5; + } + } + finally { + throw new NullPointerException(); + } + } catch (ArrayIndexOutOfBoundsException e) { + value += 3; + } + return value; + } +} diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/EmptyBlocks.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/EmptyBlocks.java new file mode 100644 index 00000000..c20dde48 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/EmptyBlocks.java @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.jack; + +public class EmptyBlocks { + + public static void throwException() { + throw new RuntimeException(); + } + + public static void doNotThrowException() { + return; + } + + public static int emptyTry() { + int a = 1; + try { + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int emptyCatch1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + } catch (Exception e) { + } finally { + a = a * 5; + } + return a; + } + + public static int emptyCatch2() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 3; + } catch (Exception e) { + } finally { + a = a * 5; + } + return a; + } + + public static int emptyFinally1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 3; + } catch (Exception e) { + a = a * 5; + } finally { + } + return a; + } + + public static int emptyFinally2() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 3; + } catch (Exception e) { + a = a * 5; + } finally { + } + return a; + } + + public static int allEmpty() { + int a = 1; + try { + } catch (Exception e) { + } finally { + } + return a; + } +} \ No newline at end of file diff --git a/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Nested.java b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Nested.java new file mode 100644 index 00000000..519f4d46 --- /dev/null +++ b/jack-tests/tests/com/android/jack/tryfinally/finallyblock/jack/Nested.java @@ -0,0 +1,633 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.tryfinally.finallyblock.jack; + +public class Nested { + + public static void throwException() { + throw new RuntimeException(); + } + + public static void doNotThrowException() { + return; + } + + public static int inTry1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inTry2() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inTry3() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + throwException(); + a = a * 19; + } finally { + a = a * 13; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inTry4() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + throwException(); + a = a * 29; + } catch (Exception e) { + a = a * 11; + throwException(); + a = a * 19; + } finally { + a = a * 13; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inTry5() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + doNotThrowException(); + a = a * 29; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 19; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inTry6() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + try { + a = a * 7; + throwException(); + a = a * 29; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 19; + } + a = a * 17; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + } + return a; + } + + public static int inCatch1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } finally { + a = a * 5; + } + return a; + } + + public static int inCatch2() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } finally { + a = a * 5; + } + return a; + } + + public static int inCatch3() { + int a = 1; + try { + a = a * 2; + throwException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } finally { + a = a * 5; + } + return a; + } + + public static int inCatch4() { + int a = 1; + try { + try { + a = a * 2; + throwException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + throwException(); + a = a * 29; + } catch (Exception e2) { + a = a * 11; + throwException(); + a = a * 19; + } finally { + a = a * 13; + } + a = a * 17; + } finally { + a = a * 5; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inCatch5() { + int a = 1; + try { + try { + a = a * 2; + throwException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 19; + } + a = a * 17; + } finally { + a = a * 5; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inCatch6() { + int a = 1; + try { + try { + a = a * 2; + throwException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + try { + a = a * 7; + throwException(); + a = a * 29; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 19; + } + a = a * 17; + } finally { + a = a * 5; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally1() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } + return a; + } + + public static int inFinally2() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } + return a; + } + + public static int inFinally3() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + throwException(); + a = a * 29; + } finally { + a = a * 13; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally4() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 29; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally5() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 29; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally6() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } + return a; + } + + public static int inFinally7() { + int a = 1; + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + } + a = a * 17; + } + return a; + } + + public static int inFinally8() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + throwException(); + a = a * 29; + } finally { + a = a * 13; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally9() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + doNotThrowException(); + a = a * 19; + } catch (Exception e) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 29; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally10() { + int a = 1; + try { + try { + a = a * 2; + doNotThrowException(); + a = a * 23; + } catch (Exception e) { + a = a * 3; + } finally { + a = a * 5; + try { + a = a * 7; + throwException(); + a = a * 19; + } catch (Exception e2) { + a = a * 11; + } finally { + a = a * 13; + throwException(); + a = a * 29; + } + a = a * 17; + } + } catch (Exception e3) { + a = a * 31; + } + return a; + } + + public static int inFinally11() { + int result = 0; + try { + result += 1; + } finally { + result += 1; + try { + result += 1; + } finally { + try { + result += 1; + } finally { + result += 1; + try { + result += 1; + } finally { + result += 1; + } + } + } + } + return result; + } + +} diff --git a/jack-tests/tests/com/android/jack/type/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/type/test001/dx/Tests.java new file mode 100644 index 00000000..ae6d473f --- /dev/null +++ b/jack-tests/tests/com/android/jack/type/test001/dx/Tests.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.type.test001.dx; + +import com.android.jack.type.test001.jack.DataInputStream; + +import org.junit.Test; + +public class Tests { + @Test + public void test0001() { + new DataInputStream().skipBytes(0); + } +} diff --git a/jack-tests/tests/com/android/jack/type/test001/jack/DataInputStream.java b/jack-tests/tests/com/android/jack/type/test001/jack/DataInputStream.java new file mode 100644 index 00000000..5336e031 --- /dev/null +++ b/jack-tests/tests/com/android/jack/type/test001/jack/DataInputStream.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.type.test001.jack; + + +public class DataInputStream { + + public final int skipBytes(int count) { + int skipped = 0; + long skippppp = count; + long skip; + while (skipped < count && (skip = skippppp) != 0) { + skipped += skip; + } + return skipped; + } +} diff --git a/jack-tests/tests/com/android/jack/type/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/type/test002/dx/Tests.java new file mode 100644 index 00000000..b4ca2272 --- /dev/null +++ b/jack-tests/tests/com/android/jack/type/test002/dx/Tests.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.type.test002.dx; + +import com.android.jack.type.test002.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +public class Tests { + @Test + public void test0001() { + Assert.assertEquals(10, new Data().getInt(5)); + } +} diff --git a/jack-tests/tests/com/android/jack/type/test002/jack/Data.java b/jack-tests/tests/com/android/jack/type/test002/jack/Data.java new file mode 100644 index 00000000..afd3cbe4 --- /dev/null +++ b/jack-tests/tests/com/android/jack/type/test002/jack/Data.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.type.test002.jack; + + +public class Data { + + private int f = 10; + + private Data getData() { + return new Data(); + } + + private boolean isD(Object o) { + return o instanceof Data; + } + + public final int getInt(int count) { + Data d; + if (count > 3 && + (d = getData()) != null && + isD(d)) { + return d.f; + } + return 0; + } + +} diff --git a/jack-tests/tests/com/android/jack/unary/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/unary/test001/dx/Tests.java new file mode 100644 index 00000000..64d102fb --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test001/dx/Tests.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test001.dx; + +import com.android.jack.unary.test001.jack.Unary; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Tests about unary. + */ +public class Tests { + + @Test + public void intNeg() { + Assert.assertEquals(-5, Unary.neg(5)); + } + + @Test + public void intBitnot() { + Assert.assertEquals(-6, Unary.bitnot(5)); + } + + @Test + public void longNeg() { + Assert.assertEquals(-123456789123456L, Unary.neg(123456789123456L)); + } + + @Test + public void longBitnot() { + Assert.assertEquals(-123456789123457L, Unary.bitnot(123456789123456L)); + } + + @Test + public void floatNeg() { + Assert.assertEquals(1.23f, Unary.neg(-1.23f), 0); + } + + @Test + public void doubleNeg() { + Assert.assertEquals(-1.23e2, Unary.neg(1.23e2), 0); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test001/jack/Unary.java b/jack-tests/tests/com/android/jack/unary/test001/jack/Unary.java new file mode 100644 index 00000000..b8ee0505 --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test001/jack/Unary.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test001.jack; + +/** + * Unary test. + */ +public class Unary { + + public static int neg(int a) { + return -a; + } + + public static int bitnot(int a) { + return ~a; + } + + public static long neg(long a) { + return -a; + } + + public static long bitnot(long a) { + return ~a; + } + + public static float neg(float a) { + return -a; + } + + public static double neg(double a) { + return -a; + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test002/dx/Tests.java b/jack-tests/tests/com/android/jack/unary/test002/dx/Tests.java new file mode 100644 index 00000000..d9488831 --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test002/dx/Tests.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test002.dx; + +import org.junit.Assert; +import org.junit.Test; + +import java.util.Arrays; + +import com.android.jack.unary.test002.jack.Unary; + +/** + * Tests about unary. + */ +public class Tests { + @Test + public void postfixDec() { + Assert.assertEquals(5, Unary.postfixDec(5)); + } + + @Test + public void prefixDec() { + Assert.assertEquals(4, Unary.prefixDec(5)); + } + + @Test + public void postfixInc() { + Assert.assertEquals(5, Unary.postfixInc(5)); + } + + @Test + public void prefixInc() { + Assert.assertEquals(7, Unary.prefixInc(6)); + } + + @Test + public void postfixInc2() { + Assert.assertEquals(6, Unary.postfixInc2(5)); + } + + @Test + public void postfixInc3() { + Assert.assertEquals(4, Unary.postfixInc3()); + } + + @Test + public void postfixInc4() { + Assert.assertEquals(5, Unary.postfixInc4(new Unary())); + } + + @Test + public void postfixIncArray() { + Assert.assertTrue(Arrays.equals(new int[]{1,3,3}, Unary.postfixIncArray(new int[]{1,2,3}))); + } + + @Test + public void postfixIncArray2() { + Unary.tab = new int[]{1,2,3}; + Assert.assertTrue(Arrays.equals(new int[]{1,3,3}, Unary.postfixIncArray2())); + Assert.assertEquals(12, Unary.sfield2); + } + + @Test + public void notIntoMethodCall() { + Assert.assertTrue(Unary.notIntoMethodCall(false, false)); + } + + @Test + public void prefixIncIntoMethodCall() { + Assert.assertEquals('c', Unary.next()); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test002/jack/Unary.java b/jack-tests/tests/com/android/jack/unary/test002/jack/Unary.java new file mode 100644 index 00000000..aedb76fe --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test002/jack/Unary.java @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test002.jack; + +/** + * Unary test. + */ +public class Unary { + + public static int prefixInc(int a) { + return ++a; + } + + public static int prefixDec(int a) { + return --a; + } + + public static int postfixInc(int a) { + return a++; + } + + public static int postfixDec(int a) { + return a--; + } + + public static int postfixInc2(int a) { + a++; + return a; + } + + static int sfield = 3; + + public static int m(int i) { + return sfield; + } + + public static int postfixInc3() { + int b = m(sfield++); + return b; + } + + int field = 3; + + public static Unary get(Unary u) { + u.field++; + return u; + } + + public static int postfixInc4(Unary u) { + get(u).field++; + return u.field; + } + + public static int[] postfixIncArray(int[] tab) { + tab[1]++; + return tab; + } + + public static int sfield2 = 5; + public static int[] tab; + + public static int[] m1() { + sfield2++; + return tab; + } + + public static int m2() { + sfield2 = sfield2 * 2; + return 1; + } + + public static int[] postfixIncArray2() { + m1()[m2()]++; + return tab; + } + + private static boolean get(boolean val1, boolean val2) { + return val1 & val2; + } + public static boolean notIntoMethodCall(boolean val1, boolean val2) { + return get(!val1, !val2); + } + + public static char next() { + int offset = 1; + String string = "abc"; + return string.charAt(++offset); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test003/dx/Tests.java b/jack-tests/tests/com/android/jack/unary/test003/dx/Tests.java new file mode 100644 index 00000000..762f4a2e --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test003/dx/Tests.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test003.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.unary.test003.jack.Cast; + +/** + * Tests about unary. + */ +public class Tests { + @Test + public void cast() { + Assert.assertEquals(0, Cast.cast((byte) 0)); + Assert.assertEquals(-1, Cast.cast((byte) 1)); + Assert.assertEquals(2, Cast.cast((byte) -2)); + Assert.assertEquals(-128, Cast.cast((byte) -128)); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test003/jack/Cast.java b/jack-tests/tests/com/android/jack/unary/test003/jack/Cast.java new file mode 100644 index 00000000..4941765c --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test003/jack/Cast.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test003.jack; + +/** + * Test of a cast on a Unary. + */ +public class Cast { + + public static int cast(byte a) { + return (byte) -a; + } + +} diff --git a/jack-tests/tests/com/android/jack/unary/test004/dx/Tests.java b/jack-tests/tests/com/android/jack/unary/test004/dx/Tests.java new file mode 100644 index 00000000..97dfb0aa --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test004/dx/Tests.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test004.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.unary.test004.jack.Data; + +/** + * Tests pre/post increment. + */ +public class Tests { + + @Test + public void getPreIncValue() { + byte value = Byte.MAX_VALUE; + byte valueRes = Byte.MAX_VALUE; + Assert.assertEquals(++valueRes, Data.getPreIncValue(value)); + } + + @Test + public void getPostIncValue() { + byte value = Byte.MAX_VALUE; + byte valueRes = Byte.MAX_VALUE; + Assert.assertEquals(valueRes++, Data.getPostIncValue(value)); + } + + @Test + public void getPreIncShortValue() { + short value = Short.MAX_VALUE; + short valueRes = Short.MAX_VALUE; + Assert.assertEquals(++valueRes, Data.getPreIncShortValue(value)); + } + + @Test + public void getPreIncCharValue() { + char value = Character.MAX_VALUE; + char valueRes = Character.MAX_VALUE; + Assert.assertEquals(++valueRes, Data.getPreIncCharValue(value)); + } + + @Test + public void getPreIncIntValue() { + int value = Integer.MAX_VALUE; + int valueRes = Integer.MAX_VALUE; + Assert.assertEquals(++valueRes, Data.getPreIncIntValue(value)); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test004/jack/Data.java b/jack-tests/tests/com/android/jack/unary/test004/jack/Data.java new file mode 100644 index 00000000..4790b28c --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test004/jack/Data.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test004.jack; + +public class Data { + + public static int getPreIncValue(byte value) { + // This will be transform to value = value + 1 by jack + return ++value; + } + + public static int getPostIncValue(byte value) { + // This will be transform to (tmp = value + 1, value = tmp; tmp) by jack + return value++; + } + + public static int getPreIncShortValue(short value) { + // This will be transform to value = value + 1 by jack + return ++value; + } + + public static int getPreIncCharValue(char value) { + // This will be transform to value = value + 1 by jack + return ++value; + } + + public static long getPreIncIntValue(int value) { + // This will be transform to value = value + 1 by jack + return ++value; + } +} + diff --git a/jack-tests/tests/com/android/jack/unary/test005/dx/Tests.java b/jack-tests/tests/com/android/jack/unary/test005/dx/Tests.java new file mode 100644 index 00000000..fc625841 --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test005/dx/Tests.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test005.dx; + +import org.junit.Assert; +import org.junit.Test; + +import com.android.jack.unary.test005.jack.UnaryNot; + +/** + * Tests '!' operator with comparison operators. + */ +public class Tests { + + @Test + public void notWithAComparison() { + Assert.assertEquals(2, UnaryNot.getValue1(1, 2)); + Assert.assertEquals(2, UnaryNot.getValue1(3, 5)); + Assert.assertEquals(1, UnaryNot.getValue1(5, 3)); + Assert.assertEquals(1, UnaryNot.getValue1(2, 2)); + Assert.assertEquals(1, UnaryNot.getValue1(2, 1)); + } + + @Test + public void notWithComparisons() { + Assert.assertEquals(2, UnaryNot.getValue2(1, 2, 3, 5)); + Assert.assertEquals(2, UnaryNot.getValue2(3, 5, 6, 7)); + Assert.assertEquals(1, UnaryNot.getValue2(5, 3, 1, 2)); + Assert.assertEquals(1, UnaryNot.getValue2(2, 2, 5, 5)); + Assert.assertEquals(1, UnaryNot.getValue2(2, 1, 5, 3)); + } +} diff --git a/jack-tests/tests/com/android/jack/unary/test005/jack/UnaryNot.java b/jack-tests/tests/com/android/jack/unary/test005/jack/UnaryNot.java new file mode 100644 index 00000000..0dc58885 --- /dev/null +++ b/jack-tests/tests/com/android/jack/unary/test005/jack/UnaryNot.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.unary.test005.jack; + +/** + * JUnit test allowing to check that '!' support does not generate useless 'if' instructions. + */ +public class UnaryNot { + + // One 'if' instruction should be used into the generated code. + public static int getValue1(int i1, int i2) { + if (!(i1 < i2)) { + return 1; + } else { + return 2; + } + } + + // Two 'if' instructions should be used into the generated code. + public static int getValue2(int i1, int i2, int i3, int i4) { + if (!(i1 < i2 && i3 < i4)) { + return 1; + } else { + return 2; + } + } +} + diff --git a/jack-tests/tests/com/android/jack/verify/test001/dx/Tests.java b/jack-tests/tests/com/android/jack/verify/test001/dx/Tests.java new file mode 100644 index 00000000..b93e6a7d --- /dev/null +++ b/jack-tests/tests/com/android/jack/verify/test001/dx/Tests.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.verify.test001.dx; + +import com.android.jack.verify.test001.jack.Conversion; + +import org.junit.Test; + +public class Tests { + @Test + public void test() { + Conversion.toDecimalScaledString(null, 0); + } +} diff --git a/jack-tests/tests/com/android/jack/verify/test001/jack/Conversion.java b/jack-tests/tests/com/android/jack/verify/test001/jack/Conversion.java new file mode 100644 index 00000000..6017fe07 --- /dev/null +++ b/jack-tests/tests/com/android/jack/verify/test001/jack/Conversion.java @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.verify.test001.jack; + +import java.math.BigInteger; + +public class Conversion { + + public static String toDecimalScaledString(BigInteger val, int scale) { + int sign = 0; + int numberLength = 0; + int[] digits = new int[0]; + int resLengthInChars; + int currentChar; + char[] result; + + if (sign == 0) { + switch (scale) { + case 0: + return "0"; + case 1: + return "0.0"; + case 2: + return "0.00"; + case 3: + return "0.000"; + case 4: + return "0.0000"; + case 5: + return "0.00000"; + case 6: + return "0.000000"; + default: + StringBuilder result1 = new StringBuilder(); + if (scale < 0) { + result1.append("0E+"); + } else { + result1.append("0E"); + } + return null; + } + } + resLengthInChars = numberLength * 10 + 1 + 7; + result = new char[resLengthInChars + 1]; + currentChar = resLengthInChars; + if (numberLength == 1) { + int highDigit = digits[0]; + if (highDigit < 0) { + long v = highDigit & 0xFFFFFFFFL; + do { + long prev = v; + v /= 10; + result[--currentChar] = (char) (0x0030 + ((int) (prev - v * 10))); + } while (v != 0); + } else { + int v = highDigit; + do { + int prev = v; + v /= 10; + result[--currentChar] = (char) (0x0030 + (prev - v * 10)); + } while (v != 0); + } + } else { + int[] temp = new int[numberLength]; + int tempLen = numberLength; + System.arraycopy(digits, 0, temp, 0, tempLen); + BIG_LOOP: while (true) { + long result11 = 0; + for (int i1 = tempLen - 1; i1 >= 0; i1--) { + long temp1 = (result11 << 32) + + (temp[i1] & 0xFFFFFFFFL); + long res = 0; + temp[i1] = (int) res; + result11 = (int) (res >> 32); + } + int resDigit = (int) result11; + int previous = currentChar; + do { + result[--currentChar] = (char) (0x0030 + (resDigit % 10)); + } while (((resDigit /= 10) != 0) && (currentChar != 0)); + int delta = 9 - previous + currentChar; + for (int i = 0; (i < delta) && (currentChar > 0); i++) { + result[--currentChar] = '0'; + } + int j = tempLen - 1; + for (; temp[j] == 0; j--) { + break BIG_LOOP; + } + tempLen = j + 1; + } + } + boolean negNumber = (sign < 0); + int exponent = resLengthInChars - currentChar - scale - 1; + if (scale == 0) { + } + if ((scale > 0) && (exponent >= -6)) { + if (exponent >= 0) { + int insertPoint = 0; + for (int j = 0; j >= 0; j--) { + result[j + 1] = result[j]; + } + result[++insertPoint] = '.'; + result[--currentChar] = '-'; + return new String(result, currentChar, resLengthInChars + - currentChar + 1); + } + result[--currentChar] = '.'; + result[--currentChar] = '0'; + result[--currentChar] = '-'; + return new String(result, currentChar, resLengthInChars + - currentChar); + } + int startPoint = currentChar + 1; + int endPoint = resLengthInChars; + StringBuilder result1 = new StringBuilder(16 + endPoint - startPoint); + result1.append('-'); + result1.append('E'); + result1.append(Integer.toString(exponent)); + return null; + } +} \ No newline at end of file -- cgit v1.2.3